Add icon in SettingsEntryGroupText
This commit is contained in:
parent
be8b91b3b0
commit
81e2f2d9a9
4 changed files with 54 additions and 1 deletions
|
@ -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",
|
||||
)
|
||||
|
||||
|
|
9
app/src/main/res/drawable/image.xml
Normal file
9
app/src/main/res/drawable/image.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M416,64L96,64a64.07,64.07 0,0 0,-64 64L32,384a64.07,64.07 0,0 0,64 64L416,448a64.07,64.07 0,0 0,64 -64L480,128A64.07,64.07 0,0 0,416 64ZM336,128a48,48 0,1 1,-48 48A48.05,48.05 0,0 1,336 128ZM96,416a32,32 0,0 1,-32 -32L64,316.37l94.84,-84.3a48.06,48.06 0,0 1,65.8 1.9l64.95,64.81L172.37,416ZM448,384a32,32 0,0 1,-32 32L217.63,416L339.05,294.58a47.72,47.72 0,0 1,61.64 -0.16L448,333.84Z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/musical_notes.xml
Normal file
9
app/src/main/res/drawable/musical_notes.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M421.84,37.37a25.86,25.86 0,0 0,-22.6 -4.46L199.92,86.49A32.3,32.3 0,0 0,176 118v226c0,6.74 -4.36,12.56 -11.11,14.83l-0.12,0.05 -52,18C92.88,383.53 80,402 80,423.91a55.54,55.54 0,0 0,23.23 45.63A54.78,54.78 0,0 0,135.34 480a55.82,55.82 0,0 0,17.75 -2.93l0.38,-0.13L175.31,469A47.84,47.84 0,0 0,208 423.91v-212c0,-7.29 4.77,-13.21 12.16,-15.07l0.21,-0.06L395,150.14a4,4 0,0 1,5 3.86V295.93c0,6.75 -4.25,12.38 -11.11,14.68l-0.25,0.09 -50.89,18.11A49.09,49.09 0,0 0,304 375.92a55.67,55.67 0,0 0,23.23 45.8,54.63 54.63,0 0,0 49.88,7.35l0.36,-0.12L399.31,421A47.83,47.83 0,0 0,432 375.92V58A25.74,25.74 0,0 0,421.84 37.37Z"/>
|
||||
</vector>
|
Loading…
Reference in a new issue