Fixed crashes in ChatFragment due to wrong date class.

This commit is contained in:
Felix Ableitner 2016-07-17 17:34:37 +02:00
parent acbcd68384
commit 343c5fca07
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ object DatesAdapter {
override def getSectionTitleForItem(item: Message): String = { override def getSectionTitleForItem(item: Message): String = {
DateFormat DateFormat
.getDateInstance(DateFormat.MEDIUM) .getDateInstance(DateFormat.MEDIUM)
.format(item.header.time.get) .format(item.header.time.get.toDate)
} }
} }

View file

@ -46,7 +46,7 @@ class MessagesAdapter(context: Context, items: Seq[Message], remoteAddress: Addr
text.setText(msg.body.asInstanceOf[Text].text) text.setText(msg.body.asInstanceOf[Text].text)
val formattedDate = DateFormat val formattedDate = DateFormat
.getTimeInstance(DateFormat.SHORT) .getTimeInstance(DateFormat.SHORT)
.format(msg.header.time.get) .format(msg.header.time.get.toDate)
time.setText(formattedDate) time.setText(formattedDate)
val paddingLarge = (MessagePaddingLarge * context.getResources.getDisplayMetrics.density).toInt val paddingLarge = (MessagePaddingLarge * context.getResources.getDisplayMetrics.density).toInt