forked from geode-sdk/android-launcher
invert settings coloring
This commit is contained in:
3 files changed
+21
-19
No files matched your search
@@ -74,6 +74,7 @@ fun DeveloperSettingsScreen(onBackPressedDispatcher: OnBackPressedDispatcher?) {
|
||||
|
||||
Scaffold(
|
||||
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
|
||||
containerColor = MaterialTheme.colorScheme.surfaceContainerLow,
|
||||
topBar = {
|
||||
Column {
|
||||
TopAppBar(
|
||||
@@ -93,6 +94,7 @@ fun DeveloperSettingsScreen(onBackPressedDispatcher: OnBackPressedDispatcher?) {
|
||||
)
|
||||
},
|
||||
scrollBehavior = scrollBehavior,
|
||||
colors = TopAppBarDefaults.topAppBarColors(MaterialTheme.colorScheme.surfaceContainerLow),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -107,16 +109,12 @@ fun DeveloperSettingsScreen(onBackPressedDispatcher: OnBackPressedDispatcher?) {
|
||||
|
||||
val developerMode by PreferenceUtils.useBooleanPreference(PreferenceUtils.Key.DEVELOPER_MODE)
|
||||
|
||||
SettingsCard(
|
||||
title = stringResource(R.string.preference_developer_mode),
|
||||
preferenceKey = PreferenceUtils.Key.DEVELOPER_MODE,
|
||||
)
|
||||
|
||||
InlineText(
|
||||
stringResource(R.string.preference_developer_mode_about)
|
||||
)
|
||||
|
||||
HorizontalDivider()
|
||||
OptionsGroup {
|
||||
SettingsCard(
|
||||
title = stringResource(R.string.preference_developer_mode),
|
||||
preferenceKey = PreferenceUtils.Key.DEVELOPER_MODE,
|
||||
)
|
||||
}
|
||||
|
||||
if (developerMode) {
|
||||
OptionsGroup(title = stringResource(R.string.preference_category_gameplay)) {
|
||||
|
||||
@@ -261,7 +261,7 @@ fun SettingsScreen(
|
||||
|
||||
// fix theme transition by giving it the exact same animation as the top bar
|
||||
val containerColor by animateColorAsState(
|
||||
targetValue = MaterialTheme.colorScheme.background,
|
||||
targetValue = MaterialTheme.colorScheme.surfaceContainerLow,
|
||||
animationSpec = spring(stiffness = Spring.StiffnessMediumLow),
|
||||
label = "background color"
|
||||
)
|
||||
@@ -291,6 +291,7 @@ fun SettingsScreen(
|
||||
)
|
||||
},
|
||||
scrollBehavior = scrollBehavior,
|
||||
colors = TopAppBarDefaults.topAppBarColors(MaterialTheme.colorScheme.surfaceContainerLow),
|
||||
)
|
||||
},
|
||||
content = { innerPadding ->
|
||||
|
||||
@@ -85,13 +85,15 @@ fun getSetting(context: Context, preferenceKey: PreferenceUtils.Key): Boolean {
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun OptionsGroup(title: String, content: @Composable () -> Unit) {
|
||||
fun OptionsGroup(title: String? = null, content: @Composable () -> Unit) {
|
||||
Column {
|
||||
Text(
|
||||
title,
|
||||
style = Typography.titleMedium,
|
||||
modifier = Modifier.padding(horizontal = 18.dp, vertical = 8.dp),
|
||||
)
|
||||
if (title != null) {
|
||||
Text(
|
||||
title,
|
||||
style = Typography.titleMedium,
|
||||
modifier = Modifier.padding(horizontal = 24.dp, vertical = 8.dp),
|
||||
)
|
||||
}
|
||||
|
||||
Column(modifier = Modifier
|
||||
.padding(horizontal = 12.dp)
|
||||
@@ -939,11 +941,12 @@ fun OptionsTitle(modifier: Modifier = Modifier, title: String, description: Stri
|
||||
@Composable
|
||||
fun OptionsCard(modifier: Modifier = Modifier, wrapContent: Boolean = false, title: @Composable () -> Unit, content: @Composable () -> Unit) {
|
||||
Row(
|
||||
modifier
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 1.dp)
|
||||
.clip(RoundedCornerShape(4.dp))
|
||||
.background(MaterialTheme.colorScheme.surfaceContainerLow)
|
||||
.then(modifier)
|
||||
.background(MaterialTheme.colorScheme.background)
|
||||
.defaultMinSize(minHeight = 64.dp)
|
||||
.padding(horizontal = 16.dp),
|
||||
Arrangement.SpaceBetween,
|
||||
|
||||
Reference in new issue
Block a user