mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Split settings: app settings / account settings
This commit is contained in:
committed by
Benoit Marty
parent
bec3780c9c
commit
9b2577f1dd
+7
-7
@@ -35,8 +35,8 @@ import io.element.android.libraries.ui.strings.CommonStrings
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@Composable
|
||||
fun RoomPreviewAliasAtom(
|
||||
alias: String,
|
||||
fun CopiableTextAtom(
|
||||
text: String,
|
||||
modifier: Modifier = Modifier,
|
||||
copiable: Boolean = true
|
||||
) {
|
||||
@@ -46,7 +46,7 @@ fun RoomPreviewAliasAtom(
|
||||
modifier = modifier
|
||||
.clickable(enabled = copiable) {
|
||||
coroutineScope.launch {
|
||||
val clipData = ClipData.newPlainText(alias, alias)
|
||||
val clipData = ClipData.newPlainText(text, text)
|
||||
clipboard.setClipEntry(clipData.toClipEntry())
|
||||
}
|
||||
},
|
||||
@@ -55,7 +55,7 @@ fun RoomPreviewAliasAtom(
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier.weight(weight = 1f, fill = false),
|
||||
text = alias,
|
||||
text = text,
|
||||
style = ElementTheme.typography.fontBodyLgRegular,
|
||||
textAlign = TextAlign.Center,
|
||||
maxLines = 1,
|
||||
@@ -75,9 +75,9 @@ fun RoomPreviewAliasAtom(
|
||||
|
||||
@PreviewsDayNight
|
||||
@Composable
|
||||
internal fun RoomPreviewAliasAtomPreview() = ElementPreview {
|
||||
RoomPreviewAliasAtom(
|
||||
alias = "#room-alias:matrix.org",
|
||||
internal fun CopiableTextAtomPreview() = ElementPreview {
|
||||
CopiableTextAtom(
|
||||
text = "#room-alias:matrix.org",
|
||||
copiable = true
|
||||
)
|
||||
}
|
||||
+5
-2
@@ -55,6 +55,7 @@ fun <T : DropdownOption> PreferenceDropdown(
|
||||
supportingText: String? = null,
|
||||
enabled: Boolean = true,
|
||||
icon: ImageVector? = null,
|
||||
dropDownIcon: ImageVector = CompoundIcons.ChevronDown(),
|
||||
@DrawableRes iconResourceId: Int? = null,
|
||||
showIconAreaIfNoIcon: Boolean = false,
|
||||
) {
|
||||
@@ -84,13 +85,14 @@ fun <T : DropdownOption> PreferenceDropdown(
|
||||
trailingContent = ListItemContent.Custom(
|
||||
content = { enabled ->
|
||||
DropdownTrailingContent(
|
||||
dropDownIcon = dropDownIcon,
|
||||
selectedOption = selectedOption,
|
||||
options = options,
|
||||
onSelectOption = onSelectOption,
|
||||
expanded = isDropdownExpanded,
|
||||
onExpandedChange = { isDropdownExpanded = it },
|
||||
enabled = enabled,
|
||||
modifier = Modifier.fillMaxSize(0.3f)
|
||||
modifier = Modifier.fillMaxSize(0.3f),
|
||||
)
|
||||
}
|
||||
),
|
||||
@@ -119,6 +121,7 @@ private fun <T : DropdownOption> DropdownTrailingContent(
|
||||
onSelectOption: (T) -> Unit,
|
||||
enabled: Boolean,
|
||||
modifier: Modifier = Modifier,
|
||||
dropDownIcon: ImageVector = CompoundIcons.ChevronDown(),
|
||||
) {
|
||||
Row(
|
||||
modifier = modifier,
|
||||
@@ -135,7 +138,7 @@ private fun <T : DropdownOption> DropdownTrailingContent(
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
Icon(
|
||||
imageVector = CompoundIcons.ChevronDown(),
|
||||
imageVector = dropDownIcon,
|
||||
contentDescription = null,
|
||||
tint = enabled.toIconSecondaryEnabledColor(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user