mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-09 08:21:48 +00:00
Make the unread message count 4 digits instead of 2. (#827)
* Make the unread message count 4 digits instead of 2. 99+ unread messages can be reached within an hour in some busy open groups. 4 digits allow for much more accurate reporting. * Improve appearance of unread counter by using rounded rectangle.
This commit is contained in:
@@ -756,9 +756,9 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
||||
}
|
||||
|
||||
private fun updateUnreadCountIndicator() {
|
||||
val formattedUnreadCount = if (unreadCount < 100) unreadCount.toString() else "99+"
|
||||
val formattedUnreadCount = if (unreadCount < 10000) unreadCount.toString() else "9999+"
|
||||
binding.unreadCountTextView.text = formattedUnreadCount
|
||||
val textSize = if (unreadCount < 100) 12.0f else 9.0f
|
||||
val textSize = if (unreadCount < 10000) 12.0f else 9.0f
|
||||
binding.unreadCountTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, textSize)
|
||||
binding.unreadCountTextView.setTypeface(Typeface.DEFAULT, if (unreadCount < 100) Typeface.BOLD else Typeface.NORMAL)
|
||||
binding.unreadCountIndicator.isVisible = (unreadCount != 0)
|
||||
|
||||
@@ -61,10 +61,10 @@ class ConversationView : LinearLayout {
|
||||
val formattedUnreadCount = if (thread.isRead) {
|
||||
null
|
||||
} else {
|
||||
if (unreadCount < 100) unreadCount.toString() else "99+"
|
||||
if (unreadCount < 10000) unreadCount.toString() else "9999+"
|
||||
}
|
||||
binding.unreadCountTextView.text = formattedUnreadCount
|
||||
val textSize = if (unreadCount < 100) 12.0f else 9.0f
|
||||
val textSize = if (unreadCount < 10000) 12.0f else 9.0f
|
||||
binding.unreadCountTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, textSize)
|
||||
binding.unreadCountTextView.setTypeface(Typeface.DEFAULT, if (unreadCount < 100) Typeface.BOLD else Typeface.NORMAL)
|
||||
binding.unreadCountIndicator.isVisible = (unreadCount != 0 && !thread.isRead)
|
||||
@@ -120,4 +120,4 @@ class ConversationView : LinearLayout {
|
||||
}
|
||||
}
|
||||
// endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user