소스 검색

Reduce switch knob shadow when not checked

vfsfitvnm 3 년 전
부모
커밋
6ccbf7759c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/components/themed/Switch.kt

+ 2 - 1
app/src/main/kotlin/it/vfsfitvnm/vimusic/ui/components/themed/Switch.kt

@@ -19,6 +19,7 @@ import androidx.compose.ui.unit.dp
 import it.vfsfitvnm.vimusic.ui.styling.LocalColorPalette
 import it.vfsfitvnm.vimusic.ui.styling.LocalColorPalette
 import it.vfsfitvnm.vimusic.utils.drawCircle
 import it.vfsfitvnm.vimusic.utils.drawCircle
 
 
+
 @Composable
 @Composable
 fun Switch(
 fun Switch(
     isChecked: Boolean,
     isChecked: Boolean,
@@ -41,7 +42,7 @@ fun Switch(
                     radius = 8.dp.toPx(),
                     radius = 8.dp.toPx(),
                     center = size.center.copy(x = offset.toPx()),
                     center = size.center.copy(x = offset.toPx()),
                     shadow = Shadow(
                     shadow = Shadow(
-                        color = Color.Black.copy(alpha = 0.4f),
+                        color = Color.Black.copy(alpha = if (isChecked) 0.4f else 0.1f),
                         blurRadius = 8.dp.toPx(),
                         blurRadius = 8.dp.toPx(),
                         offset = Offset(x = -1.dp.toPx(), y = 1.dp.toPx())
                         offset = Offset(x = -1.dp.toPx(), y = 1.dp.toPx())
                     )
                     )