Improve settings item color
This commit is contained in:
parent
890ee337a4
commit
0db39247e3
|
@ -39,15 +39,14 @@ fun SelectableSettingGroupItem(
|
|||
Surface(
|
||||
modifier = modifier.clickable { onClick() },
|
||||
color = Color.Unspecified,
|
||||
contentColor = if (selected) MaterialTheme.colorScheme.surface else MaterialTheme.colorScheme.onSurface
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 16.dp)
|
||||
.background(
|
||||
if (selected) MaterialTheme.colorScheme.onSurface else Color.Unspecified,
|
||||
RoundedCornerShape(24.dp)
|
||||
color = if (selected) MaterialTheme.colorScheme.onSurface else MaterialTheme.colorScheme.surface,
|
||||
shape = RoundedCornerShape(24.dp)
|
||||
)
|
||||
.padding(8.dp, 16.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
|
@ -55,9 +54,9 @@ fun SelectableSettingGroupItem(
|
|||
icon?.let {
|
||||
Icon(
|
||||
imageVector = it,
|
||||
contentDescription = null,
|
||||
contentDescription = title,
|
||||
modifier = Modifier.padding(start = 8.dp, end = 16.dp),
|
||||
tint = if (selected) MaterialTheme.colorScheme.surface.copy(alpha = 0.8f) else MaterialTheme.colorScheme.onSurface.copy(alpha = 0.8f),
|
||||
tint = if (selected) MaterialTheme.colorScheme.surfaceVariant else MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
Column(modifier = Modifier.weight(1f)) {
|
||||
|
@ -65,6 +64,7 @@ fun SelectableSettingGroupItem(
|
|||
text = title,
|
||||
maxLines = if (desc == null) 2 else 1,
|
||||
style = MaterialTheme.typography.titleLarge.copy(fontSize = 20.sp),
|
||||
color = if (selected) MaterialTheme.colorScheme.surface else MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
desc?.let {
|
||||
Text(
|
||||
|
|
|
@ -72,6 +72,7 @@ fun SettingsPage(
|
|||
}
|
||||
item {
|
||||
SelectableSettingGroupItem(
|
||||
selected = true,
|
||||
title = stringResource(R.string.color_and_style),
|
||||
desc = stringResource(R.string.color_and_style_desc),
|
||||
icon = Icons.Outlined.Palette,
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<string name="get_new_updates">获取新的更新</string>
|
||||
<string name="get_new_updates_desc">版本 0.6.1 现已发布</string>
|
||||
<string name="accounts">账户</string>
|
||||
<string name="accounts_desc">本地、Fresh</string>
|
||||
<string name="accounts_desc">本地、FreshRSS</string>
|
||||
<string name="color_and_style">颜色和样式</string>
|
||||
<string name="color_and_style_desc">主题、色彩系统、字体大小</string>
|
||||
<string name="interaction">交互</string>
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<string name="get_new_updates">Get New updates</string>
|
||||
<string name="get_new_updates_desc">Version 0.6.1 has been released</string>
|
||||
<string name="accounts">Accounts</string>
|
||||
<string name="accounts_desc">Local, Fresh</string>
|
||||
<string name="accounts_desc">Local, FreshRSS</string>
|
||||
<string name="color_and_style">Color & style</string>
|
||||
<string name="color_and_style_desc">Theme, color system, font size</string>
|
||||
<string name="interaction">Interaction</string>
|
||||
|
|
Loading…
Reference in New Issue
Block a user