Use a different date format when device is inactive

This commit is contained in:
Maxime NATUREL 2022-09-02 15:07:58 +02:00
parent 5791a4d3cd
commit fbff8d6408
2 changed files with 3 additions and 2 deletions

View file

@ -27,7 +27,7 @@ enum class DateFormatKind {
// Will show hour or date relative (9:30am or yesterday or Sep 7 or 09/07/2020)
ROOM_LIST,
// Will show full date (Sep 7 2020)
// Will show full date (Sep 7, 2020)
TIMELINE_DAY_DIVIDER,
// Will show full date and time (Mon, Sep 7 2020, 9:30am)

View file

@ -43,7 +43,8 @@ class OtherSessionsController @Inject constructor(
}
} else {
data.take(NUMBER_OF_OTHER_DEVICES_TO_RENDER).forEach { device ->
val formattedLastActivityDate = host.dateFormatter.format(device.deviceInfo.lastSeenTs, DateFormatKind.DEFAULT_DATE_AND_TIME)
val dateFormatKind = if (device.isInactive) DateFormatKind.TIMELINE_DAY_DIVIDER else DateFormatKind.DEFAULT_DATE_AND_TIME
val formattedLastActivityDate = host.dateFormatter.format(device.deviceInfo.lastSeenTs, dateFormatKind)
val description = if (device.isInactive) {
stringProvider.getQuantityString(
R.plurals.device_manager_other_sessions_description_inactive,