From d1cf1aa09f6515a4b5703ef583f4a93329f0b31d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 9 Jul 2026 16:19:44 +0200 Subject: [PATCH] Fix deprecation warning on `androidx.compose.material3.ListItem` --- .../preferences/AnalyticsPreferencesView.kt | 2 +- .../impl/configureroom/ConfigureRoomView.kt | 2 +- .../configureroom/SelectParentSpaceOptions.kt | 6 +- .../home/impl/roomlist/RoomListContextMenu.kt | 14 ++--- .../declineandblock/DeclineAndBlockView.kt | 4 +- .../impl/details/DependenciesDetailsView.kt | 2 +- .../impl/list/DependencyLicensesListView.kt | 2 +- .../location/impl/share/ShareLocationView.kt | 6 +- .../impl/settings/LockScreenSettingsView.kt | 4 +- .../impl/actionlist/ActionListView.kt | 4 +- .../preview/AttachmentsPreviewView.kt | 2 +- .../messagecomposer/AttachmentsBottomSheet.kt | 14 ++--- .../bottomsheet/ReadReceiptBottomSheet.kt | 2 +- .../poll/impl/create/CreatePollView.kt | 10 +-- .../preferences/impl/about/AboutView.kt | 4 +- .../impl/advanced/AdvancedSettingsView.kt | 18 +++--- .../impl/developer/DeveloperSettingsView.kt | 14 ++--- .../appsettings/AppDeveloperSettingsView.kt | 4 +- .../notifications/NotificationSettingsView.kt | 18 +++--- .../edit/DefaultNotificationSettingOption.kt | 2 +- .../EditDefaultNotificationSettingView.kt | 2 +- .../impl/root/PreferencesRootView.kt | 30 ++++----- .../preferences/RageshakePreferencesView.kt | 2 +- .../rageshake/impl/bugreport/BugReportView.kt | 2 +- .../reportroom/impl/ReportRoomView.kt | 2 +- .../impl/root/RolesAndPermissionsView.kt | 14 ++--- .../roomdetails/impl/RoomDetailsView.kt | 36 +++++------ .../RoomNotificationSettingsOption.kt | 2 +- ...UserDefinedRoomNotificationSettingsView.kt | 2 +- .../impl/RoomMemberModerationView.kt | 8 +-- .../impl/root/SecureBackupRootView.kt | 10 +-- .../ManageAuthorizedSpacesView.kt | 2 +- .../impl/root/SecurityAndPrivacyView.kt | 18 +++--- .../space/impl/settings/SpaceSettingsView.kt | 8 +-- .../userprofile/shared/UserProfileView.kt | 2 +- .../shared/blockuser/BlockUserSection.kt | 4 +- .../viewfolder/impl/folder/ViewFolderView.kt | 6 +- .../components/list/AvatarListItem.kt | 2 +- .../components/list/CheckboxListItem.kt | 2 +- .../list/MultipleSelectionListItem.kt | 2 +- .../components/list/RadioButtonListItem.kt | 2 +- .../list/SingleSelectionListItem.kt | 2 +- .../components/list/SwitchListItem.kt | 2 +- .../preferences/PreferenceCheckbox.kt | 2 +- .../preferences/PreferenceDropdown.kt | 2 +- .../components/preferences/PreferenceRow.kt | 2 +- .../components/preferences/PreferenceSlide.kt | 2 +- .../preferences/PreferenceSwitch.kt | 2 +- .../preferences/PreferenceTextField.kt | 2 +- .../designsystem/theme/components/ListItem.kt | 63 +++++++++---------- .../theme/components/ListSupportingText.kt | 8 +-- .../ui/components/AvatarActionBottomSheet.kt | 2 +- .../impl/details/MediaDetailsBottomSheet.kt | 12 ++-- .../textcomposer/TextComposerLinkDialog.kt | 2 +- .../impl/TroubleshootNotificationsView.kt | 14 ++--- .../impl/history/PushHistoryView.kt | 2 +- 56 files changed, 205 insertions(+), 206 deletions(-) diff --git a/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt b/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt index e91c77079f..1158b57673 100644 --- a/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt +++ b/features/analytics/api/src/main/kotlin/io/element/android/features/analytics/api/preferences/AnalyticsPreferencesView.kt @@ -39,7 +39,7 @@ fun AnalyticsPreferencesView( ) Column(modifier) { ListItem( - headlineContent = { + content = { Text(stringResource(id = R.string.screen_analytics_settings_share_data)) }, supportingContent = { diff --git a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomView.kt b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomView.kt index 1ee4bcd2b5..c929060e13 100644 --- a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomView.kt +++ b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/ConfigureRoomView.kt @@ -312,7 +312,7 @@ private fun RoomJoinRuleOptions( backgroundTint = Color.Transparent, ) }, - headlineContent = { + content = { val title = when (item) { JoinRuleItem.PublicVisibility.Public -> stringResource(R.string.screen_create_room_room_access_section_public_option_title) is JoinRuleItem.PrivateVisibility.Restricted -> stringResource(R.string.screen_create_room_room_access_section_restricted_option_title) diff --git a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/SelectParentSpaceOptions.kt b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/SelectParentSpaceOptions.kt index c96fbc4d6b..6389f920d5 100644 --- a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/SelectParentSpaceOptions.kt +++ b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/configureroom/SelectParentSpaceOptions.kt @@ -58,7 +58,7 @@ internal fun SelectParentSpaceOptions( modifier = modifier ) { ListItem( - headlineContent = { + content = { Text( text = selectedSpace?.displayName ?: stringResource(R.string.screen_create_room_space_selection_no_space_title), @@ -126,7 +126,7 @@ private fun SelectParentSpaceBottomSheet( LazyColumn(modifier = Modifier.fillMaxWidth()) { item { ListItem( - headlineContent = { + content = { Text( text = stringResource(R.string.screen_create_room_space_selection_no_space_option), maxLines = 1 @@ -141,7 +141,7 @@ private fun SelectParentSpaceBottomSheet( for (space in spaces) { item { ListItem( - headlineContent = { + content = { Text( text = space.displayName, maxLines = 1 diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/roomlist/RoomListContextMenu.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/roomlist/RoomListContextMenu.kt index 9d6a5173ae..bfa6962e8b 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/roomlist/RoomListContextMenu.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/roomlist/RoomListContextMenu.kt @@ -94,7 +94,7 @@ private fun RoomListModalBottomSheetContent( .verticalScroll(rememberScrollState()) ) { ListItem( - headlineContent = { + content = { Text( text = contextMenu.roomName ?: stringResource(id = CommonStrings.common_no_room_name), style = ElementTheme.typography.fontBodyLgMedium, @@ -104,7 +104,7 @@ private fun RoomListModalBottomSheetContent( ) if (contextMenu.hasNewContent) { ListItem( - headlineContent = { + content = { Text( text = stringResource(id = CommonStrings.action_mark_as_read), style = MaterialTheme.typography.bodyLarge, @@ -117,7 +117,7 @@ private fun RoomListModalBottomSheetContent( ) } else { ListItem( - headlineContent = { + content = { Text( text = stringResource(id = R.string.screen_roomlist_mark_as_unread), style = MaterialTheme.typography.bodyLarge, @@ -135,7 +135,7 @@ private fun RoomListModalBottomSheetContent( CommonStrings.common_favourite to CompoundIcons.Favourite() } ListItem( - headlineContent = { + content = { Text( text = stringResource(id = textResId), style = MaterialTheme.typography.bodyLarge, @@ -154,7 +154,7 @@ private fun RoomListModalBottomSheetContent( }, ) ListItem( - headlineContent = { + content = { Text( text = stringResource(id = CommonStrings.common_settings), style = MaterialTheme.typography.bodyLarge, @@ -169,7 +169,7 @@ private fun RoomListModalBottomSheetContent( ) if (canReportRoom) { ListItem( - headlineContent = { + content = { Text(text = stringResource(CommonStrings.action_report_room)) }, modifier = Modifier.clickable { onReportRoomClick() }, @@ -182,7 +182,7 @@ private fun RoomListModalBottomSheetContent( ) } ListItem( - headlineContent = { + content = { Text(text = stringResource(CommonStrings.action_leave_room)) }, modifier = Modifier.clickable { onLeaveRoomClick() }, diff --git a/features/invite/impl/src/main/kotlin/io/element/android/features/invite/impl/declineandblock/DeclineAndBlockView.kt b/features/invite/impl/src/main/kotlin/io/element/android/features/invite/impl/declineandblock/DeclineAndBlockView.kt index 1028a4c142..1d14df024a 100644 --- a/features/invite/impl/src/main/kotlin/io/element/android/features/invite/impl/declineandblock/DeclineAndBlockView.kt +++ b/features/invite/impl/src/main/kotlin/io/element/android/features/invite/impl/declineandblock/DeclineAndBlockView.kt @@ -81,7 +81,7 @@ fun DeclineAndBlockView( ) { ListItem( modifier = Modifier.padding(end = 8.dp), - headlineContent = { + content = { Text(text = stringResource(R.string.screen_decline_and_block_block_user_option_title)) }, supportingContent = { @@ -96,7 +96,7 @@ fun DeclineAndBlockView( Spacer(modifier = Modifier.height(24.dp)) ListItem( modifier = Modifier.padding(end = 8.dp), - headlineContent = { + content = { Text(text = stringResource(CommonStrings.action_report_room)) }, supportingContent = { diff --git a/features/licenses/impl/src/main/kotlin/io/element/android/features/licenses/impl/details/DependenciesDetailsView.kt b/features/licenses/impl/src/main/kotlin/io/element/android/features/licenses/impl/details/DependenciesDetailsView.kt index e1d445ea1f..14b195a0b5 100644 --- a/features/licenses/impl/src/main/kotlin/io/element/android/features/licenses/impl/details/DependenciesDetailsView.kt +++ b/features/licenses/impl/src/main/kotlin/io/element/android/features/licenses/impl/details/DependenciesDetailsView.kt @@ -62,7 +62,7 @@ fun DependenciesDetailsView( } } ListItem( - headlineContent = { + content = { ClickableLinkText( text = text, interactionSource = remember { MutableInteractionSource() }, diff --git a/features/licenses/impl/src/main/kotlin/io/element/android/features/licenses/impl/list/DependencyLicensesListView.kt b/features/licenses/impl/src/main/kotlin/io/element/android/features/licenses/impl/list/DependencyLicensesListView.kt index b732588217..943f57ab3b 100644 --- a/features/licenses/impl/src/main/kotlin/io/element/android/features/licenses/impl/list/DependencyLicensesListView.kt +++ b/features/licenses/impl/src/main/kotlin/io/element/android/features/licenses/impl/list/DependencyLicensesListView.kt @@ -100,7 +100,7 @@ fun DependencyLicensesListView( } is AsyncData.Success -> items(state.licenses.data) { license -> ListItem( - headlineContent = { Text(license.safeName) }, + content = { Text(license.safeName) }, supportingContent = { Text( buildString { diff --git a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/share/ShareLocationView.kt b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/share/ShareLocationView.kt index dc857b37a6..8b7106e939 100644 --- a/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/share/ShareLocationView.kt +++ b/features/location/impl/src/main/kotlin/io/element/android/features/location/impl/share/ShareLocationView.kt @@ -261,7 +261,7 @@ private fun ShareCurrentLocationItem( onClick: () -> Unit, ) { ListItem( - headlineContent = { + content = { Text(stringResource(CommonStrings.screen_share_my_location_action)) }, onClick = onClick, @@ -276,7 +276,7 @@ private fun SharePinLocationItem( onClick: () -> Unit, ) { ListItem( - headlineContent = { + content = { Text(stringResource(CommonStrings.screen_share_this_location_action)) }, onClick = onClick, @@ -291,7 +291,7 @@ private fun ShareLiveLocationItem( onClick: () -> Unit, ) { ListItem( - headlineContent = { + content = { Text(stringResource(CommonStrings.action_share_live_location)) }, onClick = onClick, diff --git a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsView.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsView.kt index e78a5ee002..d8655e29a3 100644 --- a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsView.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/settings/LockScreenSettingsView.kt @@ -38,7 +38,7 @@ fun LockScreenSettingsView( ) { PreferenceCategory(showTopDivider = false) { ListItem( - headlineContent = { + content = { Text(stringResource(id = R.string.screen_app_lock_settings_change_pin)) }, onClick = onChangePinClick, @@ -46,7 +46,7 @@ fun LockScreenSettingsView( PreferenceDivider() if (state.showRemovePinOption) { ListItem( - headlineContent = { + content = { Text(stringResource(id = R.string.screen_app_lock_settings_remove_pin)) }, style = ListItemStyle.Destructive, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt index b09c7e4ce7..669a696111 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt @@ -248,7 +248,7 @@ private fun ActionListViewContent( modifier = Modifier.clickable { onActionClick(action) }, - headlineContent = { + content = { Text(text = stringResource(id = action.titleRes)) }, leadingContent = ListItemContent.Icon(IconSource.Resource(action.icon)), @@ -461,7 +461,7 @@ private fun VerifiedUserSendFailureView( .padding(horizontal = 16.dp, vertical = 8.dp), leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.ErrorSolid())), trailingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.ChevronRight())), - headlineContent = { + content = { Text( text = sendFailure.headline(), style = ElementTheme.typography.fontBodySmMedium, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewView.kt index 4a14c11f4b..077d086720 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/attachments/preview/AttachmentsPreviewView.kt @@ -494,7 +494,7 @@ private fun VideoQualitySelectorDialog( val estimationMb = sizeFormatter.format(videoEstimation.sizeInBytes, true) val title = "${preset.title()} ($estimationMb)" ListItem( - headlineContent = { + content = { Text( text = title, style = ElementTheme.typography.fontBodyLgMedium, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/AttachmentsBottomSheet.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/AttachmentsBottomSheet.kt index d5fb0a100b..e7006b5aef 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/AttachmentsBottomSheet.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/AttachmentsBottomSheet.kt @@ -106,22 +106,22 @@ private fun AttachmentSourcePickerMenu( ListItem( modifier = Modifier.clickable { state.eventSink(MessageComposerEvent.PickAttachmentSource.PhotoFromCamera) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.TakePhoto())), - headlineContent = { Text(stringResource(R.string.screen_room_attachment_source_camera_photo)) }, + content = { Text(stringResource(R.string.screen_room_attachment_source_camera_photo)) }, ) ListItem( modifier = Modifier.clickable { state.eventSink(MessageComposerEvent.PickAttachmentSource.VideoFromCamera) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.VideoCall())), - headlineContent = { Text(stringResource(R.string.screen_room_attachment_source_camera_video)) }, + content = { Text(stringResource(R.string.screen_room_attachment_source_camera_video)) }, ) ListItem( modifier = Modifier.clickable { state.eventSink(MessageComposerEvent.PickAttachmentSource.FromGallery) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Image())), - headlineContent = { Text(stringResource(R.string.screen_room_attachment_source_gallery)) }, + content = { Text(stringResource(R.string.screen_room_attachment_source_gallery)) }, ) ListItem( modifier = Modifier.clickable { state.eventSink(MessageComposerEvent.PickAttachmentSource.FromFiles) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Attachment())), - headlineContent = { Text(stringResource(R.string.screen_room_attachment_source_files)) }, + content = { Text(stringResource(R.string.screen_room_attachment_source_files)) }, ) if (state.canShareLocation) { ListItem( @@ -130,7 +130,7 @@ private fun AttachmentSourcePickerMenu( onSendLocationClick() }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.LocationPin())), - headlineContent = { Text(stringResource(R.string.screen_room_attachment_source_location)) }, + content = { Text(stringResource(R.string.screen_room_attachment_source_location)) }, ) } ListItem( @@ -139,13 +139,13 @@ private fun AttachmentSourcePickerMenu( onCreatePollClick() }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Polls())), - headlineContent = { Text(stringResource(R.string.screen_room_attachment_source_poll)) }, + content = { Text(stringResource(R.string.screen_room_attachment_source_poll)) }, ) if (enableTextFormatting) { ListItem( modifier = Modifier.clickable { state.eventSink(MessageComposerEvent.ToggleTextFormatting(enabled = true)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.TextFormatting())), - headlineContent = { Text(stringResource(R.string.screen_room_attachment_text_formatting)) }, + content = { Text(stringResource(R.string.screen_room_attachment_text_formatting)) }, ) } } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/bottomsheet/ReadReceiptBottomSheet.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/bottomsheet/ReadReceiptBottomSheet.kt index 007e809972..407cd29026 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/bottomsheet/ReadReceiptBottomSheet.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/bottomsheet/ReadReceiptBottomSheet.kt @@ -86,7 +86,7 @@ private fun ReadReceiptBottomSheetContent( LazyColumn { item { ListItem( - headlineContent = { + content = { Text(text = stringResource(id = CommonStrings.common_seen_by)) } ) diff --git a/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/CreatePollView.kt b/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/CreatePollView.kt index 3abf3718af..6163fe19ad 100644 --- a/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/CreatePollView.kt +++ b/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/CreatePollView.kt @@ -107,7 +107,7 @@ fun CreatePollView( item { Column { ListItem( - headlineContent = { + content = { TextField( label = stringResource(id = R.string.screen_create_poll_question_desc), value = state.question, @@ -127,7 +127,7 @@ fun CreatePollView( itemsIndexed(state.answers) { index, answer -> val isLastItem = index == state.answers.size - 1 ListItem( - headlineContent = { + content = { TextField( value = answer.text, onValueChange = { @@ -155,7 +155,7 @@ fun CreatePollView( if (state.canAddAnswer) { item { ListItem( - headlineContent = { Text(text = stringResource(id = R.string.screen_create_poll_add_option_btn)) }, + content = { Text(text = stringResource(id = R.string.screen_create_poll_add_option_btn)) }, leadingContent = ListItemContent.Icon( iconSource = IconSource.Vector(CompoundIcons.Plus()), ), @@ -174,7 +174,7 @@ fun CreatePollView( Column { HorizontalDivider() ListItem( - headlineContent = { Text(text = stringResource(id = R.string.screen_create_poll_anonymous_headline)) }, + content = { Text(text = stringResource(id = R.string.screen_create_poll_anonymous_headline)) }, supportingContent = { Text(text = stringResource(id = R.string.screen_create_poll_anonymous_desc)) }, trailingContent = ListItemContent.Switch( checked = state.pollKind == PollKind.Undisclosed, @@ -189,7 +189,7 @@ fun CreatePollView( ) if (state.canDelete) { ListItem( - headlineContent = { Text(text = stringResource(id = CommonStrings.action_delete_poll)) }, + content = { Text(text = stringResource(id = CommonStrings.action_delete_poll)) }, style = ListItemStyle.Destructive, onClick = { state.eventSink(CreatePollEvent.Delete(confirmed = false)) }, ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt index b71db181e8..3a6671f692 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutView.kt @@ -34,14 +34,14 @@ fun AboutView( ) { state.elementLegals.forEach { elementLegal -> ListItem( - headlineContent = { + content = { Text(stringResource(id = elementLegal.titleRes)) }, onClick = { onElementLegalClick(elementLegal) } ) } ListItem( - headlineContent = { + content = { Text(stringResource(id = CommonStrings.common_open_source_licenses)) }, onClick = onOpenSourceLicensesClick, diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/advanced/AdvancedSettingsView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/advanced/AdvancedSettingsView.kt index c108c45d3b..438b20049a 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/advanced/AdvancedSettingsView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/advanced/AdvancedSettingsView.kt @@ -93,7 +93,7 @@ fun AdvancedSettingsView( } ) ListItem( - headlineContent = { + content = { Text(text = stringResource(id = CommonStrings.action_view_source)) }, supportingContent = { @@ -105,7 +105,7 @@ fun AdvancedSettingsView( onClick = { state.eventSink(AdvancedSettingsEvents.SetDeveloperModeEnabled(!state.isDeveloperModeEnabled)) } ) ListItem( - headlineContent = { + content = { Text(text = stringResource(id = R.string.screen_advanced_settings_share_presence)) }, supportingContent = { @@ -122,7 +122,7 @@ fun AdvancedSettingsView( null -> Unit is MediaOptimizationState.AllMedia -> { ListItem( - headlineContent = { + content = { Text(text = stringResource(id = R.string.screen_advanced_settings_media_compression_title)) }, supportingContent = { @@ -146,7 +146,7 @@ fun AdvancedSettingsView( } is MediaOptimizationState.Split -> { ListItem( - headlineContent = { + content = { Text(text = stringResource(id = R.string.screen_advanced_settings_optimise_image_upload_quality_title)) }, supportingContent = { @@ -171,7 +171,7 @@ fun AdvancedSettingsView( var displaySelectorDialog by remember { mutableStateOf(false) } ListItem( - headlineContent = { + content = { Text(text = stringResource(id = R.string.screen_advanced_settings_optimise_video_upload_quality_title)) }, supportingContent = { @@ -247,7 +247,7 @@ private fun VideoQualitySelectorDialog( VideoCompressionPreset.HIGH -> stringResource(CommonStrings.common_video_quality_high_description) } ListItem( - headlineContent = { + content = { Text( text = title, style = ElementTheme.typography.fontBodyLgMedium, @@ -301,7 +301,7 @@ private fun ModerationAndSafety( } ) ListItem( - headlineContent = { Text(text = stringResource(R.string.screen_advanced_settings_show_media_timeline_always_hide)) }, + content = { Text(text = stringResource(R.string.screen_advanced_settings_show_media_timeline_always_hide)) }, leadingContent = ListItemContent.RadioButton( selected = state.mediaPreviewConfigState.timelineMediaPreviewValue == MediaPreviewValue.Off, compact = true @@ -312,7 +312,7 @@ private fun ModerationAndSafety( enabled = !state.mediaPreviewConfigState.setTimelineMediaPreviewAction.isLoading() ) ListItem( - headlineContent = { Text(text = stringResource(R.string.screen_advanced_settings_show_media_timeline_private_rooms)) }, + content = { Text(text = stringResource(R.string.screen_advanced_settings_show_media_timeline_private_rooms)) }, leadingContent = ListItemContent.RadioButton( selected = state.mediaPreviewConfigState.timelineMediaPreviewValue == MediaPreviewValue.Private, compact = true @@ -323,7 +323,7 @@ private fun ModerationAndSafety( enabled = !state.mediaPreviewConfigState.setTimelineMediaPreviewAction.isLoading() ) ListItem( - headlineContent = { Text(text = stringResource(R.string.screen_advanced_settings_show_media_timeline_always_show)) }, + content = { Text(text = stringResource(R.string.screen_advanced_settings_show_media_timeline_always_show)) }, leadingContent = ListItemContent.RadioButton( selected = state.mediaPreviewConfigState.timelineMediaPreviewValue == MediaPreviewValue.On, compact = true diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsView.kt index 669bcdc8ff..8bd3d32190 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsView.kt @@ -85,7 +85,7 @@ fun DeveloperSettingsView( if (state.isEnterpriseBuild) { PreferenceCategory(title = "Theme") { ListItem( - headlineContent = { + content = { Text("Change brand color") }, onClick = { @@ -93,7 +93,7 @@ fun DeveloperSettingsView( } ) ListItem( - headlineContent = { + content = { Text("Reset brand color") }, onClick = { @@ -108,7 +108,7 @@ fun DeveloperSettingsView( val cache = state.cacheSize PreferenceCategory(title = "Cache") { ListItem( - headlineContent = { Text("Database sizes") }, + content = { Text("Database sizes") }, supportingContent = { if (state.databaseSizes.isLoading()) { Text("Computing...") @@ -127,7 +127,7 @@ fun DeveloperSettingsView( } ) ListItem( - headlineContent = { + content = { Text("Vacuum stores") }, onClick = { @@ -135,7 +135,7 @@ fun DeveloperSettingsView( } ) ListItem( - headlineContent = { + content = { Text("Clear cache") }, trailingContent = if (state.cacheSize.isLoading() || state.clearCacheAction.isLoading()) { @@ -194,7 +194,7 @@ private fun SessionCategory(deviceId: DeviceId) { private fun MarkAllRoomsAsReadCategory(state: DeveloperSettingsState) { PreferenceCategory(title = "Room list") { ListItem( - headlineContent = { + content = { Text("Mark all rooms as read") }, supportingContent = { @@ -220,7 +220,7 @@ private fun MarkAllRoomsAsReadCategory(state: DeveloperSettingsState) { private fun NotificationCategory(onPushHistoryClick: () -> Unit) { PreferenceCategory(title = stringResource(id = R.string.screen_notification_settings_title)) { ListItem( - headlineContent = { + content = { Text(stringResource(R.string.troubleshoot_notifications_entry_point_push_history_title)) }, onClick = onPushHistoryClick, diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/appsettings/AppDeveloperSettingsView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/appsettings/AppDeveloperSettingsView.kt index 61aa4e27ee..5e2314bebe 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/appsettings/AppDeveloperSettingsView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/appsettings/AppDeveloperSettingsView.kt @@ -84,7 +84,7 @@ fun AppDeveloperSettingsView( } PreferenceCategory(title = "Showkase") { ListItem( - headlineContent = { + content = { Text("Open Showkase browser") }, onClick = onOpenShowkase @@ -95,7 +95,7 @@ fun AppDeveloperSettingsView( ) PreferenceCategory(title = "Crash") { ListItem( - headlineContent = { + content = { Text("Crash the app 💥") }, onClick = { error("This crash is a test.") } diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsView.kt index 2009970448..9ede5138cf 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsView.kt @@ -130,7 +130,7 @@ private fun NotificationSettingsContentView( if (systemSettings.appNotificationsEnabled && !systemSettings.systemNotificationsEnabled) { ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.NotificationsOffSolid())), - headlineContent = { + content = { Text(stringResource(id = R.string.screen_notification_settings_system_notifications_turned_off)) }, supportingContent = { @@ -158,7 +158,7 @@ private fun NotificationSettingsContentView( PreferenceCategory { ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.VoiceCallSolid())), - headlineContent = { + content = { Text(stringResource(id = R.string.full_screen_intent_banner_title)) }, supportingContent = { @@ -172,7 +172,7 @@ private fun NotificationSettingsContentView( } PreferenceCategory(title = stringResource(id = R.string.screen_notification_settings_notification_section_title)) { ListItem( - headlineContent = { + content = { Text(stringResource(id = R.string.screen_notification_settings_group_chats)) }, supportingContent = { @@ -181,7 +181,7 @@ private fun NotificationSettingsContentView( onClick = onGroupChatsClick ) ListItem( - headlineContent = { + content = { Text(stringResource(id = R.string.screen_notification_settings_direct_chats)) }, supportingContent = { @@ -218,7 +218,7 @@ private fun NotificationSettingsContentView( } PreferenceCategory(title = stringResource(id = R.string.troubleshoot_notifications_entry_point_section)) { ListItem( - headlineContent = { + content = { Text(stringResource(id = R.string.troubleshoot_notifications_entry_point_title)) }, onClick = onTroubleshootNotificationsClick @@ -227,7 +227,7 @@ private fun NotificationSettingsContentView( if (state.showAdvancedSettings) { PreferenceCategory(title = stringResource(id = CommonStrings.common_advanced_settings)) { ListItem( - headlineContent = { + content = { Text(text = stringResource(id = R.string.screen_advanced_settings_push_provider_android)) }, trailingContent = when (state.currentPushDistributor) { @@ -296,7 +296,7 @@ private fun SoundsPreferenceCategory(state: NotificationSettingsState) { } } ListItem( - headlineContent = { Text(stringResource(id = R.string.screen_notification_settings_message_sound_label)) }, + content = { Text(stringResource(id = R.string.screen_notification_settings_message_sound_label)) }, supportingContent = { Text(state.messageSound.displayName) }, onClick = { state.eventSink(NotificationSettingsEvents.ShowMessageSoundDialog) }, ) @@ -323,7 +323,7 @@ private fun SoundsPreferenceCategory(state: NotificationSettingsState) { } } ListItem( - headlineContent = { Text(stringResource(id = R.string.screen_notification_settings_call_ringtone_label)) }, + content = { Text(stringResource(id = R.string.screen_notification_settings_call_ringtone_label)) }, supportingContent = { Text(state.callRingtone.displayName) }, onClick = { state.eventSink(NotificationSettingsEvents.ShowCallRingtoneDialog) }, ) @@ -418,7 +418,7 @@ private fun SoundCopyErrorRow( modifier = Modifier .background(ElementTheme.colors.bgSubtleSecondary) .semantics { liveRegion = LiveRegionMode.Polite }, - headlineContent = { + content = { Text( text = stringResource(R.string.screen_notification_settings_sound_set_sound_error_title), style = ElementTheme.typography.fontBodyMdRegular, diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/DefaultNotificationSettingOption.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/DefaultNotificationSettingOption.kt index f7fc251eeb..ac4ac3ad34 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/DefaultNotificationSettingOption.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/DefaultNotificationSettingOption.kt @@ -40,7 +40,7 @@ fun DefaultNotificationSettingOption( } ListItem( modifier = modifier, - headlineContent = { Text(title) }, + content = { Text(title) }, supportingContent = subtitle?.let { { Text(it) } }, trailingContent = ListItemContent.RadioButton(selected = isSelected), onClick = { onSelectOption(mode) }, diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/EditDefaultNotificationSettingView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/EditDefaultNotificationSettingView.kt index 3b46ae737e..24da141a48 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/EditDefaultNotificationSettingView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/notifications/edit/EditDefaultNotificationSettingView.kt @@ -88,7 +88,7 @@ fun EditDefaultNotificationSettingView( null -> "" } ListItem( - headlineContent = { + content = { val roomName = summary.name Text( text = roomName ?: stringResource(id = CommonStrings.common_no_room_name), diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt index 104ee7e551..5727712bc3 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt @@ -182,7 +182,7 @@ private fun ColumnScope.MultiAccountSection( } ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Plus())), - headlineContent = { + content = { Text(stringResource(CommonStrings.common_add_another_account)) }, onClick = onAddAccountClick, @@ -201,18 +201,18 @@ private fun ColumnScope.ManageAppSection( onSecureBackupClick: () -> Unit, ) { ListItem( - headlineContent = { Text(stringResource(id = R.string.screen_notification_settings_title)) }, + content = { Text(stringResource(id = R.string.screen_notification_settings_title)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Notifications())), onClick = onOpenNotificationSettings, ) ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.common_screen_lock)) }, + content = { Text(stringResource(id = CommonStrings.common_screen_lock)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())), onClick = onOpenLockScreenSettings, ) if (state.showSecureBackup) { ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.common_encryption)) }, + content = { Text(stringResource(id = CommonStrings.common_encryption)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Key())), trailingContent = ListItemContent.Badge.takeIf { state.showSecureBackupBadge }, onClick = onSecureBackupClick, @@ -230,7 +230,7 @@ private fun ColumnScope.ManageAccountSection( ) { state.accountManagementUrl?.let { url -> ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.action_manage_account_and_devices)) }, + content = { Text(stringResource(id = CommonStrings.action_manage_account_and_devices)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.UserProfile())), trailingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.PopOut())), onClick = { onManageAccountClick(url) }, @@ -238,14 +238,14 @@ private fun ColumnScope.ManageAccountSection( } if (state.showLinkNewDevice) { ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.common_link_new_device)) }, + content = { Text(stringResource(id = CommonStrings.common_link_new_device)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Devices())), onClick = onLinkNewDeviceClick, ) } if (state.showBlockedUsersItem) { ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.common_blocked_users)) }, + content = { Text(stringResource(id = CommonStrings.common_blocked_users)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Block())), onClick = onOpenBlockedUsers, trailingContent = ListItemContent.Text(state.nbOfBlockedUsers.toString()), @@ -269,46 +269,46 @@ private fun ColumnScope.GeneralSection( onDeactivateClick: () -> Unit, ) { ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.common_advanced_settings)) }, + content = { Text(stringResource(id = CommonStrings.common_advanced_settings)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Settings())), onClick = onOpenAdvancedSettings, ) if (state.showLabsItem) { ListItem( - headlineContent = { Text(stringResource(id = R.string.screen_labs_title)) }, + content = { Text(stringResource(id = R.string.screen_labs_title)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Labs())), onClick = onOpenLabs, ) } ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.common_about)) }, + content = { Text(stringResource(id = CommonStrings.common_about)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Info())), onClick = onOpenAbout, ) if (state.canReportBug) { ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.common_report_a_problem)) }, + content = { Text(stringResource(id = CommonStrings.common_report_a_problem)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.ChatProblem())), onClick = onOpenRageShake ) } if (state.showAnalyticsSettings) { ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.common_analytics)) }, + content = { Text(stringResource(id = CommonStrings.common_analytics)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Chart())), onClick = onOpenAnalytics, ) } HorizontalDivider() ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.action_signout)) }, + content = { Text(stringResource(id = CommonStrings.action_signout)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Close())), style = ListItemStyle.Destructive, onClick = onSignOutClick, ) if (state.canDeactivateAccount) { ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.action_delete_account)) }, + content = { Text(stringResource(id = CommonStrings.action_delete_account)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Delete())), style = ListItemStyle.Destructive, onClick = onDeactivateClick, @@ -340,7 +340,7 @@ private fun ColumnScope.Footer( @Composable private fun DeveloperPreferencesView(onOpenDeveloperSettings: () -> Unit) { ListItem( - headlineContent = { Text(stringResource(id = CommonStrings.common_developer_options)) }, + content = { Text(stringResource(id = CommonStrings.common_developer_options)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Code())), onClick = onOpenDeveloperSettings ) diff --git a/features/rageshake/api/src/main/kotlin/io/element/android/features/rageshake/api/preferences/RageshakePreferencesView.kt b/features/rageshake/api/src/main/kotlin/io/element/android/features/rageshake/api/preferences/RageshakePreferencesView.kt index 7ea35308e9..a227d0ffcf 100644 --- a/features/rageshake/api/src/main/kotlin/io/element/android/features/rageshake/api/preferences/RageshakePreferencesView.kt +++ b/features/rageshake/api/src/main/kotlin/io/element/android/features/rageshake/api/preferences/RageshakePreferencesView.kt @@ -56,7 +56,7 @@ fun RageshakePreferencesView( ) } else { ListItem( - headlineContent = { + content = { Text("Rageshaking is not supported by your device") }, ) diff --git a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt index 36b407a669..fede373627 100644 --- a/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt +++ b/features/rageshake/impl/src/main/kotlin/io/element/android/features/rageshake/impl/bugreport/BugReportView.kt @@ -101,7 +101,7 @@ fun BugReportView( Spacer(modifier = Modifier.height(16.dp)) PreferenceDivider() ListItem( - headlineContent = { + content = { Text(stringResource(id = R.string.screen_bug_report_view_logs)) }, enabled = isFormEnabled, diff --git a/features/reportroom/impl/src/main/kotlin/io/element/android/features/reportroom/impl/ReportRoomView.kt b/features/reportroom/impl/src/main/kotlin/io/element/android/features/reportroom/impl/ReportRoomView.kt index 4ab1a51336..a754825dcc 100644 --- a/features/reportroom/impl/src/main/kotlin/io/element/android/features/reportroom/impl/ReportRoomView.kt +++ b/features/reportroom/impl/src/main/kotlin/io/element/android/features/reportroom/impl/ReportRoomView.kt @@ -108,7 +108,7 @@ fun ReportRoomView( ListItem( modifier = Modifier.padding(end = 8.dp), - headlineContent = { + content = { Text(text = stringResource(CommonStrings.action_leave_room)) }, onClick = { diff --git a/features/rolesandpermissions/impl/src/main/kotlin/io/element/android/features/rolesandpermissions/impl/root/RolesAndPermissionsView.kt b/features/rolesandpermissions/impl/src/main/kotlin/io/element/android/features/rolesandpermissions/impl/root/RolesAndPermissionsView.kt index 07d2711cc6..3cf29c18cf 100644 --- a/features/rolesandpermissions/impl/src/main/kotlin/io/element/android/features/rolesandpermissions/impl/root/RolesAndPermissionsView.kt +++ b/features/rolesandpermissions/impl/src/main/kotlin/io/element/android/features/rolesandpermissions/impl/root/RolesAndPermissionsView.kt @@ -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, ) } diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt index 412006feae..96dc3e25ba 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt @@ -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 = { diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/RoomNotificationSettingsOption.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/RoomNotificationSettingsOption.kt index 8ff1be538f..cee23e6ba1 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/RoomNotificationSettingsOption.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/RoomNotificationSettingsOption.kt @@ -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) }, diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/UserDefinedRoomNotificationSettingsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/UserDefinedRoomNotificationSettingsView.kt index 3e4e9e773e..1721c9925c 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/UserDefinedRoomNotificationSettingsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/UserDefinedRoomNotificationSettingsView.kt @@ -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) diff --git a/features/roommembermoderation/impl/src/main/kotlin/io/element/android/features/roommembermoderation/impl/RoomMemberModerationView.kt b/features/roommembermoderation/impl/src/main/kotlin/io/element/android/features/roommembermoderation/impl/RoomMemberModerationView.kt index 22f7439b2a..a5e0ac274f 100644 --- a/features/roommembermoderation/impl/src/main/kotlin/io/element/android/features/roommembermoderation/impl/RoomMemberModerationView.kt +++ b/features/roommembermoderation/impl/src/main/kotlin/io/element/android/features/roommembermoderation/impl/RoomMemberModerationView.kt @@ -301,7 +301,7 @@ private fun RoomMemberActionsBottomSheet( when (val action = actionState.action) { is ModerationAction.DisplayProfile -> { ListItem( - headlineContent = { Text(stringResource(R.string.screen_bottom_sheet_manage_room_member_member_user_info)) }, + content = { Text(stringResource(R.string.screen_bottom_sheet_manage_room_member_member_user_info)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.UserProfile())), onClick = { coroutineScope.launch { @@ -314,7 +314,7 @@ private fun RoomMemberActionsBottomSheet( } is ModerationAction.KickUser -> { ListItem( - headlineContent = { Text(stringResource(R.string.screen_bottom_sheet_manage_room_member_remove)) }, + content = { Text(stringResource(R.string.screen_bottom_sheet_manage_room_member_remove)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Close())), style = ListItemStyle.Destructive, onClick = { @@ -328,7 +328,7 @@ private fun RoomMemberActionsBottomSheet( } is ModerationAction.BanUser -> { ListItem( - headlineContent = { Text(stringResource(R.string.screen_bottom_sheet_manage_room_member_ban)) }, + content = { Text(stringResource(R.string.screen_bottom_sheet_manage_room_member_ban)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Block())), style = ListItemStyle.Destructive, onClick = { @@ -342,7 +342,7 @@ private fun RoomMemberActionsBottomSheet( } is ModerationAction.UnbanUser -> { ListItem( - headlineContent = { Text(stringResource(R.string.screen_bottom_sheet_manage_room_member_unban)) }, + content = { Text(stringResource(R.string.screen_bottom_sheet_manage_room_member_unban)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Restart())), style = ListItemStyle.Destructive, onClick = { diff --git a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/root/SecureBackupRootView.kt b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/root/SecureBackupRootView.kt index 0aff81aafa..626a162152 100644 --- a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/root/SecureBackupRootView.kt +++ b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/root/SecureBackupRootView.kt @@ -55,7 +55,7 @@ fun SecureBackupRootView( snackbarHost = { SnackbarHost(snackbarHostState) }, ) { ListItem( - headlineContent = { + content = { Text( text = stringResource(id = R.string.screen_chat_backup_key_backup_title), ) @@ -76,7 +76,7 @@ fun SecureBackupRootView( // Disable / Enable key storage ListItem( - headlineContent = { + content = { Text( text = stringResource(id = R.string.screen_chat_backup_key_storage_toggle_title), ) @@ -137,7 +137,7 @@ fun SecureBackupRootView( RecoveryState.WAITING_FOR_SYNC -> Unit RecoveryState.DISABLED -> { ListItem( - headlineContent = { + content = { Text( text = stringResource(id = R.string.screen_chat_backup_recovery_action_setup), ) @@ -161,7 +161,7 @@ fun SecureBackupRootView( } RecoveryState.ENABLED -> { ListItem( - headlineContent = { + content = { Text( text = stringResource(id = R.string.screen_chat_backup_recovery_action_change), ) @@ -184,7 +184,7 @@ fun SecureBackupRootView( } RecoveryState.INCOMPLETE -> ListItem( - headlineContent = { + content = { Text( text = stringResource(id = R.string.screen_chat_backup_recovery_action_confirm), ) diff --git a/features/securityandprivacy/impl/src/main/kotlin/io/element/android/features/securityandprivacy/impl/manageauthorizedspaces/ManageAuthorizedSpacesView.kt b/features/securityandprivacy/impl/src/main/kotlin/io/element/android/features/securityandprivacy/impl/manageauthorizedspaces/ManageAuthorizedSpacesView.kt index 7208ee6115..514c38a3fd 100644 --- a/features/securityandprivacy/impl/src/main/kotlin/io/element/android/features/securityandprivacy/impl/manageauthorizedspaces/ManageAuthorizedSpacesView.kt +++ b/features/securityandprivacy/impl/src/main/kotlin/io/element/android/features/securityandprivacy/impl/manageauthorizedspaces/ManageAuthorizedSpacesView.kt @@ -140,7 +140,7 @@ private fun CheckableSpaceListItem( enabled: Boolean = true, ) { ListItem( - headlineContent = { + content = { Text(text = headlineText) }, supportingContent = supportingText?.let { diff --git a/features/securityandprivacy/impl/src/main/kotlin/io/element/android/features/securityandprivacy/impl/root/SecurityAndPrivacyView.kt b/features/securityandprivacy/impl/src/main/kotlin/io/element/android/features/securityandprivacy/impl/root/SecurityAndPrivacyView.kt index 45fce0ca01..43feb99611 100644 --- a/features/securityandprivacy/impl/src/main/kotlin/io/element/android/features/securityandprivacy/impl/root/SecurityAndPrivacyView.kt +++ b/features/securityandprivacy/impl/src/main/kotlin/io/element/android/features/securityandprivacy/impl/root/SecurityAndPrivacyView.kt @@ -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, diff --git a/features/space/impl/src/main/kotlin/io/element/android/features/space/impl/settings/SpaceSettingsView.kt b/features/space/impl/src/main/kotlin/io/element/android/features/space/impl/settings/SpaceSettingsView.kt index ace3a1f670..6237e443b0 100644 --- a/features/space/impl/src/main/kotlin/io/element/android/features/space/impl/settings/SpaceSettingsView.kt +++ b/features/space/impl/src/main/kotlin/io/element/android/features/space/impl/settings/SpaceSettingsView.kt @@ -169,7 +169,7 @@ private fun SecurityAndPrivacyItem( modifier: Modifier = Modifier, ) { ListItem( - headlineContent = { Text(stringResource(R.string.screen_space_settings_security_and_privacy)) }, + content = { Text(stringResource(R.string.screen_space_settings_security_and_privacy)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())), onClick = onClick, modifier = modifier, @@ -183,7 +183,7 @@ private fun MembersItem( modifier: Modifier = Modifier, ) { ListItem( - headlineContent = { Text(stringResource(CommonStrings.common_people)) }, + content = { Text(stringResource(CommonStrings.common_people)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.User())), trailingContent = ListItemContent.Text(memberCount.toString()), onClick = onClick, @@ -197,7 +197,7 @@ private fun RolesAndPermissionsItem( modifier: Modifier = Modifier, ) { ListItem( - headlineContent = { Text(stringResource(R.string.screen_space_settings_roles_and_permissions)) }, + content = { Text(stringResource(R.string.screen_space_settings_roles_and_permissions)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Admin())), onClick = onClick, modifier = modifier, @@ -210,7 +210,7 @@ private fun LeaveSpaceItem( modifier: Modifier = Modifier, ) { ListItem( - headlineContent = { + content = { Text(stringResource(CommonStrings.action_leave_space)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Leave())), diff --git a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileView.kt b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileView.kt index a09a091834..c5a661dbac 100644 --- a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileView.kt +++ b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileView.kt @@ -137,7 +137,7 @@ private fun VerifyUserSection( ) { if (state.verificationState == UserProfileVerificationState.UNVERIFIED) { ListItem( - headlineContent = { Text(stringResource(CommonStrings.common_verify_user)) }, + content = { Text(stringResource(CommonStrings.common_verify_user)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())), onClick = onVerifyClick, ) diff --git a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/blockuser/BlockUserSection.kt b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/blockuser/BlockUserSection.kt index 62efbf1f0f..30f8c28607 100644 --- a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/blockuser/BlockUserSection.kt +++ b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/blockuser/BlockUserSection.kt @@ -80,14 +80,14 @@ private fun PreferenceBlockUser( } if (isBlocked.orFalse()) { ListItem( - headlineContent = { Text(stringResource(R.string.screen_dm_details_unblock_user)) }, + content = { Text(stringResource(R.string.screen_dm_details_unblock_user)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Block())), onClick = { if (!isLoading) eventSink(UserProfileEvents.UnblockUser(needsConfirmation = true)) }, trailingContent = if (isLoading) ListItemContent.Custom(loadingCurrentValue) else null, ) } else { ListItem( - headlineContent = { Text(stringResource(R.string.screen_dm_details_block_user)) }, + content = { Text(stringResource(R.string.screen_dm_details_block_user)) }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Block())), style = ListItemStyle.Destructive, onClick = { if (!isLoading) eventSink(UserProfileEvents.BlockUser(needsConfirmation = true)) }, diff --git a/features/viewfolder/impl/src/main/kotlin/io/element/android/features/viewfolder/impl/folder/ViewFolderView.kt b/features/viewfolder/impl/src/main/kotlin/io/element/android/features/viewfolder/impl/folder/ViewFolderView.kt index 2a6b4031ef..86cd5302c8 100644 --- a/features/viewfolder/impl/src/main/kotlin/io/element/android/features/viewfolder/impl/folder/ViewFolderView.kt +++ b/features/viewfolder/impl/src/main/kotlin/io/element/android/features/viewfolder/impl/folder/ViewFolderView.kt @@ -100,7 +100,7 @@ private fun ItemRow( Item.Parent -> { ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(Icons.Outlined.SubdirectoryArrowLeft)), - headlineContent = { + content = { Text( text = "..", modifier = Modifier.padding(16.dp), @@ -113,7 +113,7 @@ private fun ItemRow( is Item.Folder -> { ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(Icons.Outlined.Folder)), - headlineContent = { + content = { Text( text = item.name, modifier = Modifier.padding(16.dp), @@ -126,7 +126,7 @@ private fun ItemRow( is Item.File -> { ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Document())), - headlineContent = { + content = { Text( text = item.name, modifier = Modifier.padding(16.dp), diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/AvatarListItem.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/AvatarListItem.kt index c6a85e9b85..c8f8b02b0f 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/AvatarListItem.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/AvatarListItem.kt @@ -45,7 +45,7 @@ fun AvatarListItem( ) { ListItem( modifier = modifier, - headlineContent = { Text(headline) }, + content = { Text(headline) }, supportingContent = supportingText?.let { @Composable { Text(it) } }, leadingContent = ListItemContent.Custom { _ -> Avatar( diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/CheckboxListItem.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/CheckboxListItem.kt index 4775b91720..701e1b7eaf 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/CheckboxListItem.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/CheckboxListItem.kt @@ -28,7 +28,7 @@ fun CheckboxListItem( ) { ListItem( modifier = modifier, - headlineContent = { Text(headline) }, + content = { Text(headline) }, supportingContent = supportingText?.let { @Composable { Text(it) } }, leadingContent = ListItemContent.Checkbox( checked = checked, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/MultipleSelectionListItem.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/MultipleSelectionListItem.kt index f314f17008..cdd0811aec 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/MultipleSelectionListItem.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/MultipleSelectionListItem.kt @@ -68,7 +68,7 @@ fun MultipleSelectionListItem( ListItem( modifier = modifier, - headlineContent = { Text(text = headline) }, + content = { Text(text = headline) }, supportingContent = decoratedSupportedText, leadingContent = leadingContent, trailingContent = trailingContent, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/RadioButtonListItem.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/RadioButtonListItem.kt index 70fb91e2e6..dc690294eb 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/RadioButtonListItem.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/RadioButtonListItem.kt @@ -28,7 +28,7 @@ fun RadioButtonListItem( ) { ListItem( modifier = modifier, - headlineContent = { Text(headline) }, + content = { Text(headline) }, supportingContent = supportingText?.let { @Composable { Text(it) } }, leadingContent = ListItemContent.RadioButton( selected = selected, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/SingleSelectionListItem.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/SingleSelectionListItem.kt index e07cda5e77..d9ce794938 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/SingleSelectionListItem.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/SingleSelectionListItem.kt @@ -67,7 +67,7 @@ fun SingleSelectionListItem( ListItem( modifier = modifier, - headlineContent = { Text(text = headline) }, + content = { Text(text = headline) }, supportingContent = decoratedSupportedText, leadingContent = leadingContent, trailingContent = trailingContent, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/SwitchListItem.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/SwitchListItem.kt index c5016bc5bc..f99b971b26 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/SwitchListItem.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/list/SwitchListItem.kt @@ -27,7 +27,7 @@ fun SwitchListItem( ) { ListItem( modifier = modifier, - headlineContent = { Text(headline) }, + content = { Text(headline) }, supportingContent = supportingText?.let { @Composable { Text(it) } }, leadingContent = leadingContent, trailingContent = ListItemContent.Switch( diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt index 6b4a8e1e0c..ff93bc9fa4 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceCheckbox.kt @@ -45,7 +45,7 @@ fun PreferenceCheckbox( iconResourceId = iconResourceId, showIconAreaIfNoIcon = showIconAreaIfNoIcon, ), - headlineContent = { + content = { Text( style = ElementTheme.typography.fontBodyLgRegular, text = title, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDropdown.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDropdown.kt index 5fcbcab475..1072dd41d5 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDropdown.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceDropdown.kt @@ -66,7 +66,7 @@ fun PreferenceDropdown( iconResourceId = iconResourceId, showIconAreaIfNoIcon = showIconAreaIfNoIcon, ), - headlineContent = { + content = { Text( style = ElementTheme.typography.fontBodyLgRegular, modifier = Modifier.fillMaxWidth(), diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceRow.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceRow.kt index efc36544b9..9762ca6c18 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceRow.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceRow.kt @@ -30,7 +30,7 @@ fun PreferenceRow( ) { ListItem( modifier = modifier, - headlineContent = { + content = { Row( modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSlide.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSlide.kt index 671eb5bf3f..5ff97ef37f 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSlide.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSlide.kt @@ -46,7 +46,7 @@ fun PreferenceSlide( iconResourceId = iconResourceId, showIconAreaIfNoIcon = showIconAreaIfNoIcon, ), - headlineContent = { + content = { Column { Text( style = ElementTheme.typography.fontBodyLgRegular, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt index 4545dbdf3e..bf4b76ba81 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceSwitch.kt @@ -44,7 +44,7 @@ fun PreferenceSwitch( iconResourceId = iconResourceId, showIconAreaIfNoIcon = showIconAreaIfNoIcon, ), - headlineContent = { + content = { Text( style = ElementTheme.typography.fontBodyLgRegular, text = title, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceTextField.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceTextField.kt index c67b4c857f..ad65ac4d8c 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceTextField.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/preferences/PreferenceTextField.kt @@ -42,7 +42,7 @@ fun PreferenceTextField( ListItem( modifier = modifier, - headlineContent = { Text(headline) }, + content = { Text(headline) }, supportingContent = valueToDisplay?.let { @Composable { Text(it) } }, trailingContent = trailingContent, style = style, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ListItem.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ListItem.kt index bbc97301dd..2e1c5146b4 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ListItem.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ListItem.kt @@ -35,20 +35,19 @@ import io.element.android.libraries.designsystem.preview.PreviewGroup /** * A List Item component to be used in lists and menus with simple layouts, matching the Material 3 guidelines. - * @param headlineContent The main content of the list item, usually a text. * @param modifier The modifier to be applied to the list item. - * @param supportingContent The content to be displayed below the headline content. - * @param leadingContent The content to be displayed before the headline content. - * @param trailingContent The content to be displayed after the headline content. + * @param supportingContent The content to be displayed below the content. + * @param leadingContent The content to be displayed before the content. + * @param trailingContent The content to be displayed after the content. * @param style The style to use for the list item. This may change the color and text styles of the contents. [ListItemStyle.Default] is used by default. - * @param enabled Whether the list item is enabled. When disabled, will change the color of the headline content and the leading content to use disabled tokens. + * @param enabled Whether the list item is enabled. When disabled, will change the color of the content and the leading content to use disabled tokens. * @param alwaysClickable Whether the list item should always be clickable, even when disabled. * @param onClick The callback to be called when the list item is clicked. + * @param content The main content of the list item, usually a text. */ @Suppress("LongParameterList") @Composable fun ListItem( - headlineContent: @Composable () -> Unit, modifier: Modifier = Modifier, supportingContent: @Composable (() -> Unit)? = null, leadingContent: ListItemContent? = null, @@ -57,19 +56,19 @@ fun ListItem( enabled: Boolean = true, alwaysClickable: Boolean = false, onClick: (() -> Unit)? = null, + content: @Composable () -> Unit, ) { val colors = ListItemDefaults.colors( containerColor = Color.Transparent, - headlineColor = style.headlineColor(), + headlineColor = style.contentColor(), leadingIconColor = style.leadingIconColor(), trailingIconColor = style.trailingIconColor(), supportingColor = style.supportingTextColor(), - disabledHeadlineColor = ListItemDefaultColors.headlineDisabled, + disabledHeadlineColor = ListItemDefaultColors.contentDisabled, disabledLeadingIconColor = ListItemDefaultColors.iconDisabled, disabledTrailingIconColor = ListItemDefaultColors.iconDisabled, ) ListItem( - headlineContent = headlineContent, modifier = modifier, supportingContent = supportingContent, leadingContent = leadingContent, @@ -78,25 +77,25 @@ fun ListItem( enabled = enabled, alwaysClickable = alwaysClickable, onClick = onClick, + content = content, ) } /** * A List Item component to be used in lists and menus with simple layouts, matching the Material 3 guidelines. - * @param headlineContent The main content of the list item, usually a text. * @param colors The colors to use for the list item. You can use [ListItemDefaults.colors] to create this. * @param modifier The modifier to be applied to the list item. - * @param supportingContent The content to be displayed below the headline content. - * @param leadingContent The content to be displayed before the headline content. - * @param trailingContent The content to be displayed after the headline content. - * @param enabled Whether the list item is enabled. When disabled, will change the color of the headline content and the leading content to use disabled tokens. + * @param supportingContent The content to be displayed below the content. + * @param leadingContent The content to be displayed before the content. + * @param trailingContent The content to be displayed after the content. + * @param enabled Whether the list item is enabled. When disabled, will change the color of the content and the leading content to use disabled tokens. * @param alwaysClickable Whether the list item should always be clickable, even when disabled. * @param onClick The callback to be called when the list item is clicked. + * @param content The main content of the list item, usually a text. */ @Suppress("LongParameterList") @Composable fun ListItem( - headlineContent: @Composable () -> Unit, colors: ListItemColors, modifier: Modifier = Modifier, supportingContent: @Composable (() -> Unit)? = null, @@ -105,19 +104,20 @@ fun ListItem( enabled: Boolean = true, alwaysClickable: Boolean = false, onClick: (() -> Unit)? = null, + content: @Composable () -> Unit, ) { // We cannot just pass the disabled colors, they must be set manually: https://issuetracker.google.com/issues/280480132 - val headlineColor = if (enabled) colors.contentColor else colors.disabledContentColor + val contentColor = if (enabled) colors.contentColor else colors.disabledContentColor val supportingColor = if (enabled) colors.supportingContentColor else colors.disabledContentColor.copy(alpha = 0.80f) val leadingContentColor = if (enabled) colors.leadingContentColor else colors.disabledLeadingContentColor val trailingContentColor = if (enabled) colors.trailingContentColor else colors.disabledTrailingContentColor - val decoratedHeadlineContent: @Composable () -> Unit = { + val decoratedContent: @Composable () -> Unit = { CompositionLocalProvider( LocalTextStyle provides ElementTheme.typography.fontBodyLgRegular, - LocalContentColor provides headlineColor, + LocalContentColor provides contentColor, ) { - headlineContent() + content() } } val decoratedSupportingContent: (@Composable () -> Unit)? = supportingContent?.let { content -> @@ -151,7 +151,6 @@ fun ListItem( } androidx.compose.material3.ListItem( - headlineContent = decoratedHeadlineContent, modifier = if (onClick != null) { Modifier .clickable(enabled = enabled || alwaysClickable, onClick = onClick) @@ -169,8 +168,8 @@ fun ListItem( leadingContent = decoratedLeadingContent, trailingContent = decoratedTrailingContent, colors = colors, - tonalElevation = 0.dp, - shadowElevation = 0.dp, + elevation = ListItemDefaults.elevation(elevation = 0.dp), + content = decoratedContent, ) } @@ -223,8 +222,8 @@ sealed interface ListItemStyle { data object Destructive : ListItemStyle @Composable - fun headlineColor() = when (this) { - Default, Primary -> ListItemDefaultColors.headline + fun contentColor() = when (this) { + Default, Primary -> ListItemDefaultColors.content Destructive -> ElementTheme.colors.textCriticalPrimary } @@ -251,8 +250,8 @@ sealed interface ListItemStyle { } object ListItemDefaultColors { - val headline: Color @Composable get() = ElementTheme.colors.textPrimary - val headlineDisabled: Color @Composable get() = ElementTheme.colors.textDisabled + val content: Color @Composable get() = ElementTheme.colors.textPrimary + val contentDisabled: Color @Composable get() = ElementTheme.colors.textDisabled val supportingText: Color @Composable get() = ElementTheme.materialColors.onSurfaceVariant val leadingIcon: Color @Composable get() = ElementTheme.colors.iconSecondary val trailingIcon: Color @Composable get() = ElementTheme.colors.iconPrimary @@ -260,11 +259,11 @@ object ListItemDefaultColors { val colors: ListItemColors @Composable get() = ListItemDefaults.colors( - headlineColor = headline, + headlineColor = content, supportingColor = supportingText, leadingIconColor = leadingIcon, trailingIconColor = trailingIcon, - disabledHeadlineColor = headlineDisabled, + disabledHeadlineColor = contentDisabled, disabledLeadingIconColor = iconDisabled, disabledTrailingIconColor = iconDisabled, ) @@ -523,7 +522,7 @@ private object PreviewItems { ) { EnabledDisabledElementThemedPreview { ListItem( - headlineContent = headline(), + content = content(), supportingContent = text(), leadingContent = leadingContent, trailingContent = trailingContent, @@ -543,7 +542,7 @@ private object PreviewItems { ) { EnabledDisabledElementThemedPreview { ListItem( - headlineContent = headline(), + content = content(), supportingContent = textSingleLine(), leadingContent = leadingContent, trailingContent = trailingContent, @@ -563,7 +562,7 @@ private object PreviewItems { ) { EnabledDisabledElementThemedPreview { ListItem( - headlineContent = headline(), + content = content(), leadingContent = leadingContent, trailingContent = trailingContent, enabled = it, @@ -574,7 +573,7 @@ private object PreviewItems { } @Composable - fun headline() = @Composable { + fun content() = @Composable { Text("List item") } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ListSupportingText.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ListSupportingText.kt index 4be53ddb39..b4f374cf4a 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ListSupportingText.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/ListSupportingText.kt @@ -134,7 +134,7 @@ internal fun ListSupportingTextNoPaddingPreview() { internal fun ListSupportingTextDefaultPaddingPreview() { ElementThemedPreview { Column { - ListItem(headlineContent = { Text("A title") }) + ListItem(content = { Text("A title") }) ListSupportingText( text = "Supporting line text lorem ipsum dolor sit amet, consectetur. Read more", contentPadding = ListSupportingTextDefaults.Padding.Default, @@ -149,7 +149,7 @@ internal fun ListSupportingTextSmallPaddingPreview() { ElementThemedPreview { Column { ListItem( - headlineContent = { Text("A title") }, + content = { Text("A title") }, leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.ShareAndroid())) ) ListSupportingText( @@ -165,7 +165,7 @@ internal fun ListSupportingTextSmallPaddingPreview() { internal fun ListSupportingTextLargePaddingPreview() { ElementThemedPreview { Column { - ListItem(headlineContent = { Text("A title") }, leadingContent = ListItemContent.Switch(checked = true)) + ListItem(content = { Text("A title") }, leadingContent = ListItemContent.Switch(checked = true)) ListSupportingText( text = "Supporting line text lorem ipsum dolor sit amet, consectetur. Read more", contentPadding = ListSupportingTextDefaults.Padding.LargeLeadingContent, @@ -179,7 +179,7 @@ internal fun ListSupportingTextLargePaddingPreview() { internal fun ListSupportingTextCustomPaddingPreview() { ElementThemedPreview { Column { - ListItem(headlineContent = { Text("A title") }) + ListItem(content = { Text("A title") }) ListSupportingText( text = "Supporting line text lorem ipsum dolor sit amet, consectetur. Read more", contentPadding = ListSupportingTextDefaults.Padding.Custom(24.dp), diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt index 5a9e56829c..e3f6478b76 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt @@ -96,7 +96,7 @@ private fun AvatarActionBottomSheetContent( ) { action -> ListItem( modifier = Modifier.clickable { onActionClick(action) }, - headlineContent = { + content = { Text( text = stringResource(action.titleResId), style = ElementTheme.typography.fontBodyLgRegular, diff --git a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDetailsBottomSheet.kt b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDetailsBottomSheet.kt index c9e11b65bc..35d056dc39 100644 --- a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDetailsBottomSheet.kt +++ b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDetailsBottomSheet.kt @@ -113,14 +113,14 @@ fun MediaDetailsBottomSheet( } ListItem( leadingContent = icon, - headlineContent = { Text(wording) }, + content = { Text(wording) }, onClick = { onOpenWith(state.eventId) } ) ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.VisibilityOn())), - headlineContent = { Text(stringResource(CommonStrings.action_view_in_timeline)) }, + content = { Text(stringResource(CommonStrings.action_view_in_timeline)) }, onClick = { onViewInTimeline(state.eventId) } @@ -128,14 +128,14 @@ fun MediaDetailsBottomSheet( if (state.fromGallery) { ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.ShareAndroid())), - headlineContent = { Text(stringResource(CommonStrings.action_share)) }, + content = { Text(stringResource(CommonStrings.action_share)) }, onClick = { onShare(state.eventId) } ) ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Download())), - headlineContent = { Text(stringResource(CommonStrings.action_download)) }, + content = { Text(stringResource(CommonStrings.action_download)) }, onClick = { onDownload(state.eventId) } @@ -143,7 +143,7 @@ fun MediaDetailsBottomSheet( } ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Forward())), - headlineContent = { Text(stringResource(CommonStrings.action_forward)) }, + content = { Text(stringResource(CommonStrings.action_forward)) }, onClick = { onForward(state.eventId) } @@ -152,7 +152,7 @@ fun MediaDetailsBottomSheet( HorizontalDivider() ListItem( leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Delete())), - headlineContent = { Text(stringResource(CommonStrings.action_delete_file)) }, + content = { Text(stringResource(CommonStrings.action_delete_file)) }, style = ListItemStyle.Destructive, onClick = { onDelete(state.eventId) diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposerLinkDialog.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposerLinkDialog.kt index 3ee191d724..9932dbaea1 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposerLinkDialog.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/TextComposerLinkDialog.kt @@ -179,7 +179,7 @@ private fun EditLinkDialog( } item { ListItem( - headlineContent = { + content = { Text( text = stringResource(R.string.rich_text_editor_remove_link), color = ElementTheme.colors.textCriticalPrimary diff --git a/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt index fa5e7078d2..4e0f89155d 100644 --- a/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/TroubleshootNotificationsView.kt @@ -68,7 +68,7 @@ private fun ColumnScope.TroubleshootTestView( val status = testState.status if ((status as? Status.Idle)?.visible == false) return ListItem( - headlineContent = { Text(text = testState.name) }, + content = { Text(text = testState.name) }, supportingContent = { Text(text = testState.description) }, trailingContent = when (status) { is Status.Idle -> null @@ -108,7 +108,7 @@ private fun ColumnScope.TroubleshootTestView( ) if (status is Status.Failure && status.hasQuickFix) { ListItem( - headlineContent = { }, + content = { }, trailingContent = ListItemContent.Custom { Button( text = status.quickFixButtonString ?: stringResource(id = R.string.troubleshoot_notifications_screen_quick_fix_action), @@ -137,7 +137,7 @@ private fun ColumnScope.TroubleshootNotificationsContent(state: TroubleshootNoti } when (state.testSuiteState.mainState) { AsyncAction.Uninitialized -> { - ListItem(headlineContent = { + ListItem(content = { Text( text = stringResource(id = R.string.troubleshoot_notifications_screen_notice) ) @@ -146,20 +146,20 @@ private fun ColumnScope.TroubleshootNotificationsContent(state: TroubleshootNoti } AsyncAction.Loading -> Unit is AsyncAction.Failure -> { - ListItem(headlineContent = { + ListItem(content = { Text(text = stringResource(id = R.string.troubleshoot_notifications_screen_failure)) }) RunTestButton(state = state) } is AsyncAction.Confirming -> { - ListItem(headlineContent = { + ListItem(content = { Text( text = stringResource(id = R.string.troubleshoot_notifications_screen_waiting) ) }) } is AsyncAction.Success -> { - ListItem(headlineContent = { + ListItem(content = { Text( text = stringResource(id = R.string.troubleshoot_notifications_screen_success) ) @@ -171,7 +171,7 @@ private fun ColumnScope.TroubleshootNotificationsContent(state: TroubleshootNoti @Composable private fun RunTestButton(state: TroubleshootNotificationsState) { ListItem( - headlineContent = { + content = { Button( text = stringResource( id = if (state.testSuiteState.mainState is AsyncAction.Failure) { diff --git a/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/history/PushHistoryView.kt b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/history/PushHistoryView.kt index 7dfb8419dd..21e9c64139 100644 --- a/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/history/PushHistoryView.kt +++ b/libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/history/PushHistoryView.kt @@ -156,7 +156,7 @@ private fun PushHistoryContent( modifier = modifier.fillMaxWidth() ) { ListItem( - headlineContent = { Text("Total number of received push") }, + content = { Text("Total number of received push") }, trailingContent = ListItemContent.Text(state.pushCounter.toString()), ) LazyColumn(