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
@@ -202,7 +202,7 @@ fun RoomDetailsView(
PreferenceCategory {
if (state.hasNewContent) {
ListItem(
headlineContent = {
content = {
Text(
text = stringResource(id = R.string.screen_roomlist_mark_as_read),
style = MaterialTheme.typography.bodyLarge,
@@ -225,7 +225,7 @@ fun RoomDetailsView(
)
} else {
ListItem(
headlineContent = {
content = {
Text(
text = stringResource(id = R.string.screen_roomlist_mark_as_unread),
)
@@ -268,7 +268,7 @@ fun RoomDetailsView(
}
if (state.displayRolesAndPermissionsSettings) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_roles_and_permissions)) },
content = { Text(stringResource(R.string.screen_room_details_roles_and_permissions)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Admin())),
onClick = openAdminSettings,
)
@@ -317,7 +317,7 @@ fun RoomDetailsView(
) {
ListItem(
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())),
headlineContent = {
content = {
Text(stringResource(id = R.string.screen_room_details_encryption_enabled_title))
},
supportingContent = {
@@ -345,7 +345,7 @@ fun RoomDetailsView(
@Composable
private fun KnockRequestsItem(knockRequestsCount: Int?, onKnockRequestsClick: () -> Unit) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_requests_to_join_title)) },
content = { Text(stringResource(R.string.screen_room_details_requests_to_join_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.AskToJoin())),
trailingContent = if (knockRequestsCount == null || knockRequestsCount == 0) {
null
@@ -656,7 +656,7 @@ private fun TopicSection(
if (roomTopic is RoomTopicState.CanAddTopic) {
ListItem(
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Plus())),
headlineContent = {
content = {
Text(stringResource(id = R.string.screen_room_details_add_topic_title))
},
onClick = {
@@ -687,7 +687,7 @@ private fun NotificationItem(
stringResource(R.string.screen_room_details_notification_mode_custom)
}
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_room_details_notification_title)) },
content = { Text(text = stringResource(R.string.screen_room_details_notification_title)) },
supportingContent = { Text(text = subtitle) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Notifications())),
onClick = openRoomNotificationSettings,
@@ -700,7 +700,7 @@ private fun SecurityAndPrivacyItem(
modifier: Modifier = Modifier,
) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_security_and_privacy_title)) },
content = { Text(stringResource(R.string.screen_room_details_security_and_privacy_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())),
onClick = onClick,
modifier = modifier,
@@ -732,7 +732,7 @@ private fun ProfileItem(
) {
ListItem(
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.UserProfile())),
headlineContent = { Text(stringResource(id = R.string.screen_room_details_profile_row_title)) },
content = { Text(stringResource(id = R.string.screen_room_details_profile_row_title)) },
trailingContent = when (verificationState) {
UserProfileVerificationState.VERIFIED -> ListItemContent.Icon(
iconSource = IconSource.Vector(CompoundIcons.Verified()),
@@ -755,7 +755,7 @@ private fun MembersItem(
openRoomMemberList: () -> Unit,
) {
ListItem(
headlineContent = { Text(stringResource(CommonStrings.common_people)) },
content = { Text(stringResource(CommonStrings.common_people)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.User())),
trailingContent = if (hasVerificationViolations) {
ListItemContent.Icon(
@@ -774,7 +774,7 @@ private fun InviteItem(
onClick: () -> Unit,
) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_invite_title)) },
content = { Text(stringResource(R.string.screen_room_details_invite_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.UserAdd())),
onClick = onClick,
)
@@ -787,7 +787,7 @@ private fun PinnedMessagesItem(
) {
val analyticsService = LocalAnalyticsService.current
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_pinned_events_row_title)) },
content = { Text(stringResource(R.string.screen_room_details_pinned_events_row_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Pin())),
trailingContent =
if (pinnedMessagesCount == null) {
@@ -809,7 +809,7 @@ private fun PollsItem(
openPollHistory: () -> Unit,
) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_polls_history_title)) },
content = { Text(stringResource(R.string.screen_polls_history_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Polls())),
onClick = openPollHistory,
)
@@ -820,7 +820,7 @@ private fun MediaGalleryItem(
onClick: () -> Unit,
) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_media_gallery_title)) },
content = { Text(stringResource(R.string.screen_room_details_media_gallery_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Image())),
onClick = onClick,
)
@@ -840,7 +840,7 @@ private fun OtherActionsSection(
}
if (canReportRoom) {
ListItem(
headlineContent = {
content = {
Text(stringResource(CommonStrings.action_report_room))
},
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.ChatProblem())),
@@ -849,7 +849,7 @@ private fun OtherActionsSection(
)
}
ListItem(
headlineContent = {
content = {
Text(stringResource(CommonStrings.action_leave_room))
},
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Leave())),
@@ -868,7 +868,7 @@ private fun DebugInfoSection(
PreferenceCategory {
val toastMessage = stringResource(CommonStrings.common_copied_to_clipboard)
ListItem(
headlineContent = {
content = {
Text("Internal room ID")
},
supportingContent = {
@@ -888,7 +888,7 @@ private fun DebugInfoSection(
},
)
ListItem(
headlineContent = {
content = {
Text("Room version")
},
supportingContent = {
@@ -40,7 +40,7 @@ fun RoomNotificationSettingsOption(
ListItem(
modifier = modifier,
enabled = enabled,
headlineContent = { Text(title) },
content = { Text(title) },
supportingContent = subtitle?.let { { Text(it) } },
trailingContent = ListItemContent.RadioButton(selected = isSelected),
onClick = { onSelectOption(roomNotificationSettingsItem) },
@@ -66,7 +66,7 @@ fun UserDefinedRoomNotificationSettingsView(
}
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_notification_settings_edit_remove_setting)) },
content = { Text(stringResource(R.string.screen_room_notification_settings_edit_remove_setting)) },
style = ListItemStyle.Destructive,
onClick = {
state.eventSink(RoomNotificationSettingsEvent.DeleteCustomNotification)