File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
app/src/main/java/com/craftworks/music Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ class SettingsManager @Inject constructor(
171171 }
172172
173173 val refreshAnimationFlow: Flow <Boolean > = context.dataStore.data.map { preferences ->
174- preferences[USE_REFRESH_ANIMATION ] ? : true
174+ preferences[USE_REFRESH_ANIMATION ] ? : ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . TIRAMISU )
175175 }
176176
177177 suspend fun setUseRefreshAnimation (useRefreshAnimation : Boolean ) {
Original file line number Diff line number Diff line change @@ -29,8 +29,6 @@ import kotlin.math.min
2929 * Adapted from AOSP SystemUI:
3030 * https://android.googlesource.com/platform/frameworks/base/+/refs/heads/main/packages/SystemUI/animation/src/com/android/systemui/surfaceeffects/ripple/RippleShader.kt
3131*/
32-
33- @RequiresApi(Build .VERSION_CODES .TIRAMISU )
3432@Composable
3533fun RippleEffect (
3634 modifier : Modifier = Modifier ,
@@ -42,7 +40,10 @@ fun RippleEffect(
4240 sparkleStrength : Float = 0.3f,
4341 onFinished : () -> Unit = {}
4442) {
45- val useRippleEffect by SettingsManager (LocalContext .current).refreshAnimationFlow.collectAsStateWithLifecycle(true )
43+ if (Build .VERSION .SDK_INT <= Build .VERSION_CODES .TIRAMISU )
44+ return
45+
46+ val useRippleEffect by SettingsManager (LocalContext .current).refreshAnimationFlow.collectAsStateWithLifecycle(false )
4647 if (! useRippleEffect)
4748 return
4849
Original file line number Diff line number Diff line change @@ -386,7 +386,8 @@ fun S_AppearanceScreen(navHostController: NavHostController = rememberNavControl
386386 coroutineScope.launch {
387387 SettingsManager (context).setUseRefreshAnimation(! refreshRipple.value)
388388 }
389- }
389+ },
390+ enabled = Build .VERSION .SDK_INT >= Build .VERSION_CODES .TIRAMISU
390391 )
391392
392393 // Lyrics Animation Speed
You can’t perform that action at this time.
0 commit comments