mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 18:26:57 +00:00
Remove inset for check circle and update copy for private and group story pickers.
This commit is contained in:
@@ -93,7 +93,13 @@ object ContactSearchItems {
|
||||
model.story.viewerCount
|
||||
}
|
||||
|
||||
number.text = context.resources.getQuantityString(R.plurals.SelectViewersFragment__d_viewers, count, count)
|
||||
val pluralId = when {
|
||||
model.story.recipient.isGroup -> R.plurals.ContactSearchItems__group_story_d_viewers
|
||||
model.story.recipient.isMyStory -> R.plurals.SelectViewersFragment__d_viewers
|
||||
else -> R.plurals.ContactSearchItems__private_story_d_viewers
|
||||
}
|
||||
|
||||
number.text = context.resources.getQuantityString(pluralId, count, count)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,8 +165,15 @@ object ContactSearchItems {
|
||||
protected open fun bindNumberField(model: T) {
|
||||
number.visible = getRecipient(model).isGroup
|
||||
if (getRecipient(model).isGroup) {
|
||||
val members = getRecipient(model).participants.size
|
||||
number.text = context.resources.getQuantityString(R.plurals.ContactSelectionListFragment_d_members, members, members)
|
||||
number.text = getRecipient(model).participants
|
||||
.take(10)
|
||||
.sortedWith(IsSelfComparator()).joinToString(", ") {
|
||||
if (it.isSelf) {
|
||||
context.getString(R.string.ConversationTitleView_you)
|
||||
} else {
|
||||
it.getShortDisplayName(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,4 +259,13 @@ object ContactSearchItems {
|
||||
itemView.setOnClickListener { expandListener.invoke(model.expand) }
|
||||
}
|
||||
}
|
||||
|
||||
private class IsSelfComparator : Comparator<Recipient> {
|
||||
override fun compare(lhs: Recipient?, rhs: Recipient?): Int {
|
||||
val isLeftSelf = lhs?.isSelf == true
|
||||
val isRightSelf = rhs?.isSelf == true
|
||||
|
||||
return if (isLeftSelf == isRightSelf) 0 else if (isLeftSelf) 1 else -1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user