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