mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Fix deprecation warning on androidx.compose.material3.ListItem
This commit is contained in:
committed by
Benoit Marty
parent
d2b4a85453
commit
d1cf1aa09f
+7
-7
@@ -62,7 +62,7 @@ fun RolesAndPermissionsView(
|
||||
stringResource(R.string.screen_room_roles_and_permissions_admins)
|
||||
}
|
||||
ListItem(
|
||||
headlineContent = { Text(adminsTitle) },
|
||||
content = { Text(adminsTitle) },
|
||||
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Admin())),
|
||||
trailingContent = state.adminCount?.let { adminCount ->
|
||||
ListItemContent.Text("$adminCount")
|
||||
@@ -70,7 +70,7 @@ fun RolesAndPermissionsView(
|
||||
onClick = { rolesAndPermissionsNavigator.openAdminList() },
|
||||
)
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(R.string.screen_room_roles_and_permissions_moderators)) },
|
||||
content = { Text(stringResource(R.string.screen_room_roles_and_permissions_moderators)) },
|
||||
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.ChatProblem())),
|
||||
trailingContent = state.moderatorCount?.let { moderationCount ->
|
||||
ListItemContent.Text("$moderationCount")
|
||||
@@ -79,20 +79,20 @@ fun RolesAndPermissionsView(
|
||||
)
|
||||
if (state.canSelfDemote) {
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(R.string.screen_room_roles_and_permissions_change_my_role)) },
|
||||
content = { Text(stringResource(R.string.screen_room_roles_and_permissions_change_my_role)) },
|
||||
onClick = { state.eventSink(RolesAndPermissionsEvents.ChangeOwnRole) },
|
||||
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Edit()))
|
||||
)
|
||||
}
|
||||
HorizontalDivider()
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(R.string.screen_room_roles_and_permissions_permissions_header)) },
|
||||
content = { Text(stringResource(R.string.screen_room_roles_and_permissions_permissions_header)) },
|
||||
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Settings())),
|
||||
onClick = { rolesAndPermissionsNavigator.openEditPermissions() },
|
||||
)
|
||||
HorizontalDivider()
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(R.string.screen_room_roles_and_permissions_reset)) },
|
||||
content = { Text(stringResource(R.string.screen_room_roles_and_permissions_reset)) },
|
||||
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Delete())),
|
||||
onClick = { state.eventSink(RolesAndPermissionsEvents.ResetPermissions) },
|
||||
style = ListItemStyle.Destructive,
|
||||
@@ -173,7 +173,7 @@ private fun ChangeOwnRoleBottomSheet(
|
||||
)
|
||||
for (demoteAction in availableDemoteActions) {
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(demoteAction.titleRes)) },
|
||||
content = { Text(stringResource(demoteAction.titleRes)) },
|
||||
onClick = {
|
||||
sheetState.hide(coroutineScope) {
|
||||
eventSink(RolesAndPermissionsEvents.DemoteSelfTo(demoteAction.role))
|
||||
@@ -183,7 +183,7 @@ private fun ChangeOwnRoleBottomSheet(
|
||||
)
|
||||
}
|
||||
ListItem(
|
||||
headlineContent = { Text(stringResource(CommonStrings.action_cancel)) },
|
||||
content = { Text(stringResource(CommonStrings.action_cancel)) },
|
||||
onClick = ::dismiss,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user