From 343c5fca0782fadf5eb9efd95df921bae07f15dc Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sun, 17 Jul 2016 17:34:37 +0200 Subject: [PATCH] Fixed crashes in ChatFragment due to wrong date class. --- .../main/scala/com/nutomic/ensichat/views/DatesAdapter.scala | 2 +- .../main/scala/com/nutomic/ensichat/views/MessagesAdapter.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/src/main/scala/com/nutomic/ensichat/views/DatesAdapter.scala b/android/src/main/scala/com/nutomic/ensichat/views/DatesAdapter.scala index 5800c27..aefcdcb 100644 --- a/android/src/main/scala/com/nutomic/ensichat/views/DatesAdapter.scala +++ b/android/src/main/scala/com/nutomic/ensichat/views/DatesAdapter.scala @@ -15,7 +15,7 @@ object DatesAdapter { override def getSectionTitleForItem(item: Message): String = { DateFormat .getDateInstance(DateFormat.MEDIUM) - .format(item.header.time.get) + .format(item.header.time.get.toDate) } } diff --git a/android/src/main/scala/com/nutomic/ensichat/views/MessagesAdapter.scala b/android/src/main/scala/com/nutomic/ensichat/views/MessagesAdapter.scala index 35dc7f9..d1e6777 100644 --- a/android/src/main/scala/com/nutomic/ensichat/views/MessagesAdapter.scala +++ b/android/src/main/scala/com/nutomic/ensichat/views/MessagesAdapter.scala @@ -46,7 +46,7 @@ class MessagesAdapter(context: Context, items: Seq[Message], remoteAddress: Addr text.setText(msg.body.asInstanceOf[Text].text) val formattedDate = DateFormat .getTimeInstance(DateFormat.SHORT) - .format(msg.header.time.get) + .format(msg.header.time.get.toDate) time.setText(formattedDate) val paddingLarge = (MessagePaddingLarge * context.getResources.getDisplayMetrics.density).toInt