Fixed crashes in ChatFragment due to wrong date class.
This commit is contained in:
parent
acbcd68384
commit
343c5fca07
2 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Reference in a new issue