mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 08:19:33 +00:00
show filesdir in settings
This commit is contained in:
1 file changed
+27
-14
@@ -122,6 +122,7 @@ fun SettingsScreen(onBackPressedDispatcher: OnBackPressedDispatcher?) {
|
||||
)
|
||||
OptionsButton(
|
||||
title = context.getString(R.string.preferences_copy_external_button),
|
||||
description = context.getExternalFilesDir(null)?.path,
|
||||
onClick = { onOpenFolder(context) }
|
||||
)
|
||||
}
|
||||
@@ -175,10 +176,13 @@ fun OptionsGroup(title: String, content: @Composable () -> Unit) {
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun OptionsButton(title: String, onClick: () -> Unit) {
|
||||
fun OptionsButton(title: String, description: String? = null, onClick: () -> Unit) {
|
||||
OptionsCard(
|
||||
title = {
|
||||
Text(title)
|
||||
OptionsTitle(
|
||||
title = title,
|
||||
description = description
|
||||
)
|
||||
},
|
||||
modifier = Modifier
|
||||
.clickable(onClick = onClick, role = Role.Button)
|
||||
@@ -193,19 +197,11 @@ fun SettingsCard(title: String, description: String? = null, @StringRes preferen
|
||||
|
||||
OptionsCard(
|
||||
title = {
|
||||
Column(
|
||||
OptionsTitle(
|
||||
Modifier.fillMaxWidth(0.75f),
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||
) {
|
||||
Text(title)
|
||||
if (!description.isNullOrEmpty()) {
|
||||
Text(
|
||||
description,
|
||||
style = Typography.labelMedium,
|
||||
color = MaterialTheme.colorScheme.onSecondaryContainer
|
||||
)
|
||||
}
|
||||
}
|
||||
title = title,
|
||||
description = description
|
||||
)
|
||||
},
|
||||
modifier = Modifier.toggleable(
|
||||
value = settingEnabled.value,
|
||||
@@ -217,6 +213,23 @@ fun SettingsCard(title: String, description: String? = null, @StringRes preferen
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun OptionsTitle(modifier: Modifier = Modifier, title: String, description: String? = null) {
|
||||
Column(
|
||||
modifier,
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||
) {
|
||||
Text(title)
|
||||
if (!description.isNullOrEmpty()) {
|
||||
Text(
|
||||
description,
|
||||
style = Typography.labelMedium,
|
||||
color = MaterialTheme.colorScheme.onSecondaryContainer
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun OptionsCard(modifier: Modifier = Modifier, title: @Composable () -> Unit, content: @Composable () -> Unit) {
|
||||
Row(
|
||||
|
||||
Reference in new issue
Block a user