mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Banned users: use the counter as the title
This commit is contained in:
parent
562c6fbcce
commit
ace7ff464b
1 changed files with 35 additions and 31 deletions
|
@ -51,42 +51,46 @@ class RoomBannedMemberListController @Inject constructor(
|
||||||
override fun buildModels(data: RoomBannedMemberListViewState?) {
|
override fun buildModels(data: RoomBannedMemberListViewState?) {
|
||||||
val bannedList = data?.bannedMemberSummaries?.invoke() ?: return
|
val bannedList = data?.bannedMemberSummaries?.invoke() ?: return
|
||||||
|
|
||||||
buildProfileSection(
|
val quantityString = stringProvider.getQuantityString(R.plurals.room_settings_banned_users_count, bannedList.size, bannedList.size)
|
||||||
stringProvider.getString(R.string.room_settings_banned_users_title)
|
|
||||||
)
|
|
||||||
|
|
||||||
bannedList.join(
|
if (bannedList.isEmpty()) {
|
||||||
each = { _, roomMember ->
|
buildProfileSection(stringProvider.getString(R.string.room_settings_banned_users_title))
|
||||||
val actionInProgress = data.onGoingModerationAction.contains(roomMember.userId)
|
|
||||||
profileMatrixItemWithProgress {
|
genericFooterItem {
|
||||||
id(roomMember.userId)
|
id("footer")
|
||||||
matrixItem(roomMember.toMatrixItem())
|
text(quantityString)
|
||||||
avatarRenderer(avatarRenderer)
|
}
|
||||||
apply {
|
} else {
|
||||||
if (actionInProgress) {
|
buildProfileSection(quantityString)
|
||||||
inProgress(true)
|
|
||||||
editable(false)
|
bannedList.join(
|
||||||
} else {
|
each = { _, roomMember ->
|
||||||
inProgress(false)
|
val actionInProgress = data.onGoingModerationAction.contains(roomMember.userId)
|
||||||
editable(true)
|
profileMatrixItemWithProgress {
|
||||||
clickListener { _ ->
|
id(roomMember.userId)
|
||||||
callback?.onUnbanClicked(roomMember)
|
matrixItem(roomMember.toMatrixItem())
|
||||||
|
avatarRenderer(avatarRenderer)
|
||||||
|
apply {
|
||||||
|
if (actionInProgress) {
|
||||||
|
inProgress(true)
|
||||||
|
editable(false)
|
||||||
|
} else {
|
||||||
|
inProgress(false)
|
||||||
|
editable(true)
|
||||||
|
clickListener { _ ->
|
||||||
|
callback?.onUnbanClicked(roomMember)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
between = { _, roomMemberBefore ->
|
||||||
|
dividerItem {
|
||||||
|
id("divider_${roomMemberBefore.userId}")
|
||||||
|
color(dividerColor)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
)
|
||||||
between = { _, roomMemberBefore ->
|
|
||||||
dividerItem {
|
|
||||||
id("divider_${roomMemberBefore.userId}")
|
|
||||||
color(dividerColor)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
genericFooterItem {
|
|
||||||
id("footer")
|
|
||||||
text(stringProvider.getQuantityString(R.plurals.room_settings_banned_users_count, bannedList.size, bannedList.size))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue