Merge pull request #7175 from element-hq/renovate/androidx.compose.material3-material3-1.x

Update dependency androidx.compose.material3:material3 to v1.5.0-alpha23
This commit is contained in:
Benoit Marty
2026-08-07 10:45:22 +02:00
committed by GitHub
629 changed files with 1359 additions and 1360 deletions
@@ -39,7 +39,7 @@ fun AnalyticsPreferencesView(
)
Column(modifier) {
ListItem(
headlineContent = {
content = {
Text(stringResource(id = R.string.screen_analytics_settings_share_data))
},
supportingContent = {
@@ -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)
@@ -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
@@ -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() },
@@ -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 = {
@@ -62,7 +62,7 @@ fun DependenciesDetailsView(
}
}
ListItem(
headlineContent = {
content = {
ClickableLinkText(
text = text,
interactionSource = remember { MutableInteractionSource() },
@@ -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 {
@@ -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,
@@ -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,
@@ -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,
@@ -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,
@@ -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)) },
)
}
}
@@ -86,7 +86,7 @@ private fun ReadReceiptBottomSheetContent(
LazyColumn {
item {
ListItem(
headlineContent = {
content = {
Text(text = stringResource(id = CommonStrings.common_seen_by))
}
)
@@ -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)) },
)
@@ -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,
@@ -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
@@ -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()) {
@@ -178,7 +178,7 @@ private fun SessionCategory(deviceId: DeviceId) {
val toastMessage = stringResource(CommonStrings.common_copied_to_clipboard)
val context = LocalContext.current
ListItem(
headlineContent = { Text("DeviceId") },
content = { Text("DeviceId") },
supportingContent = { Text(text = deviceId.value) },
onClick = {
context.copyToClipboard(
@@ -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,
@@ -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.") }
@@ -117,7 +117,7 @@ private fun GitCategory(
val toastMessage = stringResource(CommonStrings.common_copied_to_clipboard)
val context = LocalContext.current
ListItem(
headlineContent = { Text("Git branch") },
content = { Text("Git branch") },
supportingContent = { Text(text = gitBranch) },
onClick = {
context.copyToClipboard(
@@ -127,7 +127,7 @@ private fun GitCategory(
}
)
ListItem(
headlineContent = { Text("Git SHA") },
content = { Text("Git SHA") },
supportingContent = { Text(text = gitSha) },
onClick = {
context.copyToClipboard(
@@ -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,
@@ -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) },
@@ -88,7 +88,7 @@ fun EditDefaultNotificationSettingView(
null -> ""
}
ListItem(
headlineContent = {
content = {
val roomName = summary.name
Text(
text = roomName ?: stringResource(id = CommonStrings.common_no_room_name),
@@ -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
)
@@ -130,7 +130,7 @@ private fun EmptyStatusRow(
modifier: Modifier = Modifier,
) {
ListItem(
headlineContent = {
content = {
Text(
text = stringResource(R.string.screen_settings_user_status_placeholder),
modifier = Modifier.padding(vertical = 16.dp),
@@ -153,7 +153,7 @@ private fun CurrentStatusRow(
is DisplayedStatus.InCall -> "🎧" to stringResource(CommonStrings.common_on_a_call)
}
ListItem(
headlineContent = { Text(text = text, modifier = Modifier.padding(vertical = 16.dp)) },
content = { Text(text = text, modifier = Modifier.padding(vertical = 16.dp)) },
leadingContent = ListItemContent.Custom { EmojiText(emoji) },
trailingContent = ListItemContent.Custom({
IconButton(
@@ -209,7 +209,7 @@ private fun UserStatusPickerBottomSheet(
val predefinedUserStatus = UserStatus(emoji = predefined.emoji, text = label)
val isSelected = currentRawStatus == predefinedUserStatus
ListItem(
headlineContent = { Text(text = label) },
content = { Text(text = label) },
leadingContent = ListItemContent.Custom { EmojiText(predefined.emoji) },
trailingContent = if (isSelected) {
ListItemContent.Icon(IconSource.Vector(CompoundIcons.Check()), tintColor = ElementTheme.colors.iconAccentPrimary)
@@ -224,7 +224,7 @@ private fun UserStatusPickerBottomSheet(
)
}
ListItem(
headlineContent = {
content = {
Text(text = stringResource(R.string.screen_settings_user_status_custom))
},
leadingContent = ListItemContent.Custom { EmojiText("✏️") },
@@ -261,7 +261,7 @@ private fun CustomStatusInputRow(
val focusRequester = remember { FocusRequester() }
LaunchedEffect(Unit) { focusRequester.requestFocus() }
ListItem(
headlineContent = {
content = {
TextField(
modifier = Modifier.focusRequester(focusRequester),
state = textFieldState,
@@ -56,7 +56,7 @@ fun RageshakePreferencesView(
)
} else {
ListItem(
headlineContent = {
content = {
Text("Rageshaking is not supported by your device")
},
)
@@ -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,
@@ -108,7 +108,7 @@ fun ReportRoomView(
ListItem(
modifier = Modifier.padding(end = 8.dp),
headlineContent = {
content = {
Text(text = stringResource(CommonStrings.action_leave_room))
},
onClick = {
@@ -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,
)
}
@@ -202,7 +202,7 @@ fun RoomDetailsView(
PreferenceCategory {
if (state.hasNewContent) {
ListItem(
headlineContent = {
content = {
Text(
text = stringResource(id = R.string.screen_roomlist_mark_as_read),
style = MaterialTheme.typography.bodyLarge,
@@ -225,7 +225,7 @@ fun RoomDetailsView(
)
} else {
ListItem(
headlineContent = {
content = {
Text(
text = stringResource(id = R.string.screen_roomlist_mark_as_unread),
)
@@ -268,7 +268,7 @@ fun RoomDetailsView(
}
if (state.displayRolesAndPermissionsSettings) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_roles_and_permissions)) },
content = { Text(stringResource(R.string.screen_room_details_roles_and_permissions)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Admin())),
onClick = openAdminSettings,
)
@@ -317,7 +317,7 @@ fun RoomDetailsView(
) {
ListItem(
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())),
headlineContent = {
content = {
Text(stringResource(id = R.string.screen_room_details_encryption_enabled_title))
},
supportingContent = {
@@ -345,7 +345,7 @@ fun RoomDetailsView(
@Composable
private fun KnockRequestsItem(knockRequestsCount: Int?, onKnockRequestsClick: () -> Unit) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_requests_to_join_title)) },
content = { Text(stringResource(R.string.screen_room_details_requests_to_join_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.AskToJoin())),
trailingContent = if (knockRequestsCount == null || knockRequestsCount == 0) {
null
@@ -656,7 +656,7 @@ private fun TopicSection(
if (roomTopic is RoomTopicState.CanAddTopic) {
ListItem(
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Plus())),
headlineContent = {
content = {
Text(stringResource(id = R.string.screen_room_details_add_topic_title))
},
onClick = {
@@ -687,7 +687,7 @@ private fun NotificationItem(
stringResource(R.string.screen_room_details_notification_mode_custom)
}
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_room_details_notification_title)) },
content = { Text(text = stringResource(R.string.screen_room_details_notification_title)) },
supportingContent = { Text(text = subtitle) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Notifications())),
onClick = openRoomNotificationSettings,
@@ -700,7 +700,7 @@ private fun SecurityAndPrivacyItem(
modifier: Modifier = Modifier,
) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_security_and_privacy_title)) },
content = { Text(stringResource(R.string.screen_room_details_security_and_privacy_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())),
onClick = onClick,
modifier = modifier,
@@ -732,7 +732,7 @@ private fun ProfileItem(
) {
ListItem(
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.UserProfile())),
headlineContent = { Text(stringResource(id = R.string.screen_room_details_profile_row_title)) },
content = { Text(stringResource(id = R.string.screen_room_details_profile_row_title)) },
trailingContent = when (verificationState) {
UserProfileVerificationState.VERIFIED -> ListItemContent.Icon(
iconSource = IconSource.Vector(CompoundIcons.Verified()),
@@ -755,7 +755,7 @@ private fun MembersItem(
openRoomMemberList: () -> Unit,
) {
ListItem(
headlineContent = { Text(stringResource(CommonStrings.common_people)) },
content = { Text(stringResource(CommonStrings.common_people)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.User())),
trailingContent = if (hasVerificationViolations) {
ListItemContent.Icon(
@@ -774,7 +774,7 @@ private fun InviteItem(
onClick: () -> Unit,
) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_invite_title)) },
content = { Text(stringResource(R.string.screen_room_details_invite_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.UserAdd())),
onClick = onClick,
)
@@ -787,7 +787,7 @@ private fun PinnedMessagesItem(
) {
val analyticsService = LocalAnalyticsService.current
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_pinned_events_row_title)) },
content = { Text(stringResource(R.string.screen_room_details_pinned_events_row_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Pin())),
trailingContent =
if (pinnedMessagesCount == null) {
@@ -809,7 +809,7 @@ private fun PollsItem(
openPollHistory: () -> Unit,
) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_polls_history_title)) },
content = { Text(stringResource(R.string.screen_polls_history_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Polls())),
onClick = openPollHistory,
)
@@ -820,7 +820,7 @@ private fun MediaGalleryItem(
onClick: () -> Unit,
) {
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_details_media_gallery_title)) },
content = { Text(stringResource(R.string.screen_room_details_media_gallery_title)) },
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Image())),
onClick = onClick,
)
@@ -840,7 +840,7 @@ private fun OtherActionsSection(
}
if (canReportRoom) {
ListItem(
headlineContent = {
content = {
Text(stringResource(CommonStrings.action_report_room))
},
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.ChatProblem())),
@@ -849,7 +849,7 @@ private fun OtherActionsSection(
)
}
ListItem(
headlineContent = {
content = {
Text(stringResource(CommonStrings.action_leave_room))
},
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Leave())),
@@ -868,7 +868,7 @@ private fun DebugInfoSection(
PreferenceCategory {
val toastMessage = stringResource(CommonStrings.common_copied_to_clipboard)
ListItem(
headlineContent = {
content = {
Text("Internal room ID")
},
supportingContent = {
@@ -888,7 +888,7 @@ private fun DebugInfoSection(
},
)
ListItem(
headlineContent = {
content = {
Text("Room version")
},
supportingContent = {
@@ -40,7 +40,7 @@ fun RoomNotificationSettingsOption(
ListItem(
modifier = modifier,
enabled = enabled,
headlineContent = { Text(title) },
content = { Text(title) },
supportingContent = subtitle?.let { { Text(it) } },
trailingContent = ListItemContent.RadioButton(selected = isSelected),
onClick = { onSelectOption(roomNotificationSettingsItem) },
@@ -66,7 +66,7 @@ fun UserDefinedRoomNotificationSettingsView(
}
ListItem(
headlineContent = { Text(stringResource(R.string.screen_room_notification_settings_edit_remove_setting)) },
content = { Text(stringResource(R.string.screen_room_notification_settings_edit_remove_setting)) },
style = ListItemStyle.Destructive,
onClick = {
state.eventSink(RoomNotificationSettingsEvent.DeleteCustomNotification)
@@ -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 = {
@@ -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),
)
@@ -140,7 +140,7 @@ private fun CheckableSpaceListItem(
enabled: Boolean = true,
) {
ListItem(
headlineContent = {
content = {
Text(text = headlineText)
},
supportingContent = supportingText?.let {
@@ -235,7 +235,7 @@ private fun RoomAccessSection(
modifier = modifier,
) {
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_anyone_option_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_anyone_option_title)) },
supportingContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_anyone_option_description)) },
trailingContent = ListItemContent.RadioButton(selected = edited == SecurityAndPrivacyRoomAccess.Anyone),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Public())),
@@ -243,7 +243,7 @@ private fun RoomAccessSection(
)
if (state.showSpaceMemberOption) {
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_space_members_option_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_space_members_option_title)) },
supportingContent = {
Text(text = state.spaceMemberDescription())
},
@@ -255,7 +255,7 @@ private fun RoomAccessSection(
}
if (state.showAskToJoinOption) {
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_ask_to_join_option_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_ask_to_join_option_title)) },
supportingContent = { Text(text = stringResource(R.string.screen_security_and_privacy_ask_to_join_option_description)) },
trailingContent = ListItemContent.RadioButton(selected = edited == SecurityAndPrivacyRoomAccess.AskToJoin),
onClick = { onSelectOption(SecurityAndPrivacyRoomAccess.AskToJoin) },
@@ -265,7 +265,7 @@ private fun RoomAccessSection(
}
if (state.showAskToJoinWithSpaceMemberOption) {
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_ask_to_join_option_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_ask_to_join_option_title)) },
supportingContent = { Text(text = state.askToJoinWithSpaceMembersDescription()) },
trailingContent = ListItemContent.RadioButton(selected = edited is SecurityAndPrivacyRoomAccess.AskToJoinWithSpaceMember),
onClick = ::onAskToJoinWithSpaceMembersClick,
@@ -274,7 +274,7 @@ private fun RoomAccessSection(
)
}
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_invite_only_option_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_invite_only_option_title)) },
supportingContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_access_invite_only_option_description)) },
trailingContent = ListItemContent.RadioButton(selected = edited == SecurityAndPrivacyRoomAccess.InviteOnly),
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Lock())),
@@ -330,7 +330,7 @@ private fun RoomAddressSection(
modifier = modifier,
) {
ListItem(
headlineContent = {
content = {
Text(text = roomAddress ?: stringResource(R.string.screen_security_and_privacy_add_room_address_action))
},
trailingContent = if (roomAddress.isNullOrEmpty()) ListItemContent.Icon(IconSource.Vector(CompoundIcons.Plus())) else null,
@@ -340,7 +340,7 @@ private fun RoomAddressSection(
)
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_room_directory_visibility_toggle_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_room_directory_visibility_toggle_title)) },
supportingContent = {
Text(text = stringResource(R.string.screen_security_and_privacy_room_directory_visibility_toggle_description, homeserverName))
},
@@ -387,7 +387,7 @@ private fun EncryptionSection(
modifier = modifier,
) {
ListItem(
headlineContent = { Text(text = stringResource(R.string.screen_security_and_privacy_encryption_toggle_title)) },
content = { Text(text = stringResource(R.string.screen_security_and_privacy_encryption_toggle_title)) },
supportingContent = { Text(text = stringResource(R.string.screen_security_and_privacy_encryption_section_footer)) },
trailingContent = ListItemContent.Switch(
checked = isRoomEncrypted,
@@ -459,7 +459,7 @@ private fun HistoryVisibilityItem(
SecurityAndPrivacyHistoryVisibility.WorldReadable -> stringResource(R.string.screen_security_and_privacy_room_history_anyone_option_title)
}
ListItem(
headlineContent = { Text(text = headlineText) },
content = { Text(text = headlineText) },
trailingContent = ListItemContent.RadioButton(selected = isSelected, enabled = isEnabled),
onClick = { onSelectOption(option) },
enabled = isEnabled,
@@ -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())),
@@ -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,
)
@@ -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)) },
@@ -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),
+1 -1
View File
@@ -126,7 +126,7 @@ androidx_preference = "androidx.preference:preference:1.2.1"
androidx_webkit = "androidx.webkit:webkit:1.16.0"
androidx_compose_bom = { module = "androidx.compose:compose-bom", version.ref = "compose_bom" }
androidx_compose_material3 = { module = "androidx.compose.material3:material3", version = '1.5.0-alpha22' }
androidx_compose_material3 = { module = "androidx.compose.material3:material3", version = '1.5.0-alpha23' }
androidx_compose_material3_windowsizeclass = { module = "androidx.compose.material3:material3-window-size-class" }
androidx_compose_material3_adaptive = "androidx.compose.material3:material3-adaptive-android:1.0.0-alpha06"
androidx_compose_ui = { module = "androidx.compose.ui:ui" }
@@ -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(
@@ -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,
@@ -68,7 +68,7 @@ fun MultipleSelectionListItem(
ListItem(
modifier = modifier,
headlineContent = { Text(text = headline) },
content = { Text(text = headline) },
supportingContent = decoratedSupportedText,
leadingContent = leadingContent,
trailingContent = trailingContent,
@@ -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,
@@ -67,7 +67,7 @@ fun SingleSelectionListItem(
ListItem(
modifier = modifier,
headlineContent = { Text(text = headline) },
content = { Text(text = headline) },
supportingContent = decoratedSupportedText,
leadingContent = leadingContent,
trailingContent = trailingContent,
@@ -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(
@@ -45,7 +45,7 @@ fun PreferenceCheckbox(
iconResourceId = iconResourceId,
showIconAreaIfNoIcon = showIconAreaIfNoIcon,
),
headlineContent = {
content = {
Text(
style = ElementTheme.typography.fontBodyLgRegular,
text = title,
@@ -66,7 +66,7 @@ fun <T : DropdownOption> PreferenceDropdown(
iconResourceId = iconResourceId,
showIconAreaIfNoIcon = showIconAreaIfNoIcon,
),
headlineContent = {
content = {
Text(
style = ElementTheme.typography.fontBodyLgRegular,
modifier = Modifier.fillMaxWidth(),
@@ -30,7 +30,7 @@ fun PreferenceRow(
) {
ListItem(
modifier = modifier,
headlineContent = {
content = {
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
@@ -46,7 +46,7 @@ fun PreferenceSlide(
iconResourceId = iconResourceId,
showIconAreaIfNoIcon = showIconAreaIfNoIcon,
),
headlineContent = {
content = {
Column {
Text(
style = ElementTheme.typography.fontBodyLgRegular,
@@ -44,7 +44,7 @@ fun PreferenceSwitch(
iconResourceId = iconResourceId,
showIconAreaIfNoIcon = showIconAreaIfNoIcon,
),
headlineContent = {
content = {
Text(
style = ElementTheme.typography.fontBodyLgRegular,
text = title,
@@ -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,
@@ -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,53 +104,53 @@ 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 ->
val decoratedSupportingContent: (@Composable () -> Unit)? = supportingContent?.let { safeContent ->
{
CompositionLocalProvider(
LocalTextStyle provides ElementTheme.typography.fontBodyMdRegular,
LocalContentColor provides supportingColor,
) {
content()
safeContent()
}
}
}
val decoratedLeadingContent: (@Composable () -> Unit)? = leadingContent?.let { content ->
val decoratedLeadingContent: (@Composable () -> Unit)? = leadingContent?.let { safeContent ->
{
CompositionLocalProvider(
LocalContentColor provides leadingContentColor,
) {
content.View(isItemEnabled = enabled)
safeContent.View(isItemEnabled = enabled)
}
}
}
val decoratedTrailingContent: (@Composable () -> Unit)? = trailingContent?.let { content ->
val decoratedTrailingContent: (@Composable () -> Unit)? = trailingContent?.let { safeContent ->
{
CompositionLocalProvider(
LocalTextStyle provides ElementTheme.typography.fontBodyMdRegular,
LocalContentColor provides trailingContentColor,
) {
content.View(isItemEnabled = enabled)
safeContent.View(isItemEnabled = enabled)
}
}
}
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")
}
@@ -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),
@@ -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,
@@ -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)
@@ -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
@@ -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) {
@@ -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(

Some files were not shown because too many files have changed in this diff Show More