From fe633f06a2ac97500c148a3bbd1882568e849652 Mon Sep 17 00:00:00 2001 From: Chumva Date: Fri, 17 Aug 2018 13:57:07 +0300 Subject: [PATCH] refactored getListItemLiveTimeDescr --- .../src/net/osmand/telegram/ui/LiveNowTabFragment.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt index f761d01f67..b45f1aee52 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt @@ -366,12 +366,12 @@ class LiveNowTabFragment : Fragment(), TelegramListener, TelegramIncomingMessage var description = "" if (item.lastUpdated > 0) { val duration = System.currentTimeMillis() / 1000 - item.lastUpdated - var formattedTime = OsmandFormatter.getFormattedDuration(app, duration) - if (duration > OsmandFormatter.MIN_DURATION_FOR_DATE_FORMAT) { - formattedTime = OsmandFormatter.getFormattedDate(item.lastUpdated.toLong()) - description = getString(R.string.last_response) + ": $formattedTime" + description = if (duration > OsmandFormatter.MIN_DURATION_FOR_DATE_FORMAT) { + val formattedTime = OsmandFormatter.getFormattedDate(item.lastUpdated.toLong()) + getString(R.string.last_response) + ": $formattedTime" } else { - description = getString(R.string.last_response) + ": $formattedTime " + + val formattedTime = OsmandFormatter.getFormattedDuration(app, duration) + getString(R.string.last_response) + ": $formattedTime " + getString(R.string.time_ago) } }