diff --git a/OsmAnd-telegram/res/values/strings.xml b/OsmAnd-telegram/res/values/strings.xml index 75f99207a9..42f668e25d 100644 --- a/OsmAnd-telegram/res/values/strings.xml +++ b/OsmAnd-telegram/res/values/strings.xml @@ -1,4 +1,6 @@ + Live + Bot Registration in Telegram You need an account in Telegram to use the capabilities of OsmAnd Location Sharing. If you want to continue, please install the Telegram from Google Play and register your account. diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt index 49663ff04e..0098b99972 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt @@ -276,7 +276,7 @@ class LiveNowTabFragment : Fragment(), TelegramListener, TelegramIncomingMessage val chatTitle = item.chatTitle val stateTextInd = if (settings.isShowingChatOnMap(chatTitle)) 1 else 0 - holder.description?.text = "Chat description" // FIXME + holder.description?.text = getChatItemDescription(item) holder.imageButton?.visibility = View.GONE holder.showOnMapRow?.setOnClickListener { showPopupMenu(holder, chatTitle) } holder.showOnMapState?.text = menuList[stateTextInd] @@ -288,6 +288,16 @@ class LiveNowTabFragment : Fragment(), TelegramListener, TelegramIncomingMessage override fun getItemCount() = items.size + private fun getChatItemDescription(item: ChatItem): String { + return when { + item.chatWithBot -> getString(R.string.shared_string_bot) + item.privateChat -> "Chat description" // FIXME + else -> "${getString(R.string.shared_string_live)}: ${item.liveMembersCount} • ${getString( + R.string.shared_string_all + )}: ${item.membersCount}" + } + } + private fun showPopupMenu(holder: ChatViewHolder, chatTitle: String) { val ctx = holder.itemView.context