Add thumbnail roundness selector in SettingsScreen

This commit is contained in:
vfsfitvnm
2022-06-05 15:29:36 +02:00
parent 5e18d7e22a
commit 85a5b60e29
8 changed files with 61 additions and 16 deletions

View File

@@ -0,0 +1,28 @@
package it.vfsfitvnm.vimusic.enums
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.unit.dp
import it.vfsfitvnm.vimusic.utils.LocalPreferences
enum class ThumbnailRoundness {
None,
Light,
Medium,
Heavy;
companion object {
val shape: Shape
@Composable
@ReadOnlyComposable
get() = when (LocalPreferences.current.thumbnailRoundness) {
None -> RectangleShape
Light -> RoundedCornerShape(2.dp)
Medium -> RoundedCornerShape(4.dp)
Heavy -> RoundedCornerShape(8.dp)
}
}
}