Fix deprecation warning on androidx.compose.material3.ListItem

This commit is contained in:
Benoit Marty
2026-07-09 16:19:44 +02:00
committed by Benoit Marty
parent d2b4a85453
commit d1cf1aa09f
56 changed files with 205 additions and 206 deletions
@@ -140,7 +140,7 @@ private fun CheckableSpaceListItem(
enabled: Boolean = true,
) {
ListItem(
headlineContent = {
content = {
Text(text = headlineText)
},
supportingContent = supportingText?.let {
@@ -235,7 +235,7 @@ private fun RoomAccessSection(
modifier = modifier,
) {
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_anyone_option_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_anyone_option_title)) },
supportingContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_anyone_option_description)) },
trailingContent = ListItemContent.RadioButton(selected = edited == SecurityAndPrivacyRoomAccess.Anyone),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Public())),
@@ -243,7 +243,7 @@ private fun RoomAccessSection(
)
if (state.showSpaceMemberOption) {
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_space_members_option_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_space_members_option_title)) },
supportingContent = {
Text(text = state.spaceMemberDescription())
},
@@ -255,7 +255,7 @@ private fun RoomAccessSection(
}
if (state.showAskToJoinOption) {
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_ask_to_join_option_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_ask_to_join_option_title)) },
supportingContent = { Text(text = stringResource(R.string.screen_security_and_privacy_ask_to_join_option_description)) },
trailingContent = ListItemContent.RadioButton(selected = edited == SecurityAndPrivacyRoomAccess.AskToJoin),
onClick = { onSelectOption(SecurityAndPrivacyRoomAccess.AskToJoin) },
@@ -265,7 +265,7 @@ private fun RoomAccessSection(
}
if (state.showAskToJoinWithSpaceMemberOption) {
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_ask_to_join_option_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_ask_to_join_option_title)) },
supportingContent = { Text(text = state.askToJoinWithSpaceMembersDescription()) },
trailingContent = ListItemContent.RadioButton(selected = edited is SecurityAndPrivacyRoomAccess.AskToJoinWithSpaceMember),
onClick = ::onAskToJoinWithSpaceMembersClick,
@@ -274,7 +274,7 @@ private fun RoomAccessSection(
)
}
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_invite_only_option_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_invite_only_option_title)) },
supportingContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_invite_only_option_description)) },
trailingContent = ListItemContent.RadioButton(selected = edited == SecurityAndPrivacyRoomAccess.InviteOnly),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())),
@@ -330,7 +330,7 @@ private fun RoomAddressSection(
modifier = modifier,
) {
ListItem(
headlineContent = {
content = {
Text(text = roomAddress ?: stringResource(R.string.screen_security_and_privacy_add_room_address_action))
},
trailingContent = if (roomAddress.isNullOrEmpty()) ListItemContent.Icon(IconSource.Vector(CompoundIcons.Plus())) else null,
@@ -340,7 +340,7 @@ private fun RoomAddressSection(
)
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_directory_visibility_toggle_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_room_directory_visibility_toggle_title)) },
supportingContent = {
Text(text = stringResource(R.string.screen_security_and_privacy_room_directory_visibility_toggle_description, homeserverName))
},
@@ -387,7 +387,7 @@ private fun EncryptionSection(
modifier = modifier,
) {
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_encryption_toggle_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_encryption_toggle_title)) },
supportingContent = { Text(text = stringResource(R.string.screen_security_and_privacy_encryption_section_footer)) },
trailingContent = ListItemContent.Switch(
checked = isRoomEncrypted,
@@ -459,7 +459,7 @@ private fun HistoryVisibilityItem(
SecurityAndPrivacyHistoryVisibility.WorldReadable -> stringResource(R.string.screen_security_and_privacy_room_history_anyone_option_title)
}
ListItem(
headlineContent = { Text(text = headlineText) },
content = { Text(text = headlineText) },
trailingContent = ListItemContent.RadioButton(selected = isSelected, enabled = isEnabled),
onClick = { onSelectOption(option) },
enabled = isEnabled,