Merge branch 'develop' into feature/fga/user_status_last_pieces

This commit is contained in:
ganfra
2026-08-07 11:35:19 +02:00
629 changed files with 1360 additions and 1361 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),
@@ -204,7 +204,7 @@ private fun ColumnScope.MultiAccountSection(
}
ListItem(
leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Plus())),
headlineContent = {
content = {
Text(stringResource(CommonStrings.common_add_another_account))
},
onClick = onAddAccountClick,
@@ -223,18 +223,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,
@@ -252,7 +252,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) },
@@ -260,14 +260,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()),
@@ -291,46 +291,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,
@@ -362,7 +362,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),