Add icon in SettingsEntryGroupText
This commit is contained in:
@@ -230,7 +230,7 @@ fun SettingsScreen() {
|
||||
}
|
||||
|
||||
@Composable
|
||||
inline fun <reified T: Enum<T>>EnumValueSelectorEntry(
|
||||
inline fun <reified T : Enum<T>> EnumValueSelectorEntry(
|
||||
title: String,
|
||||
selectedValue: T,
|
||||
crossinline onValueSelected: (T) -> Unit,
|
||||
@@ -389,3 +389,34 @@ fun SettingsEntryGroupText(
|
||||
.padding(horizontal = 32.dp)
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun SettingsEntryGroupText(
|
||||
@DrawableRes icon: Int,
|
||||
title: String,
|
||||
modifier: Modifier = Modifier,
|
||||
iconColor: Color = LocalColorPalette.current.textSecondary
|
||||
) {
|
||||
val typography = LocalTypography.current
|
||||
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = modifier
|
||||
.padding(top = 24.dp)
|
||||
.padding(horizontal = 8.dp)
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(icon),
|
||||
contentDescription = null,
|
||||
colorFilter = ColorFilter.tint(iconColor),
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 16.dp)
|
||||
.size(16.dp)
|
||||
)
|
||||
|
||||
BasicText(
|
||||
text = title.uppercase(),
|
||||
style = typography.xs.semiBold,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +107,8 @@ fun OtherSettingsScreen() {
|
||||
}
|
||||
|
||||
SettingsEntryGroupText(
|
||||
icon = R.drawable.image,
|
||||
iconColor = colorPalette.green,
|
||||
title = "IMAGE CACHE",
|
||||
)
|
||||
|
||||
@@ -176,6 +178,8 @@ fun OtherSettingsScreen() {
|
||||
}
|
||||
|
||||
SettingsEntryGroupText(
|
||||
icon = R.drawable.musical_notes,
|
||||
iconColor = colorPalette.cyan,
|
||||
title = "SONG CACHE",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user