File tree Expand file tree Collapse file tree 5 files changed +37
-12
lines changed
androidMain/kotlin/dev/dimension/flare/common
appleMain/kotlin/dev/dimension/flare/common
commonMain/kotlin/dev/dimension/flare
jvmMain/kotlin/dev/dimension/flare/common Expand file tree Collapse file tree 5 files changed +37
-12
lines changed Original file line number Diff line number Diff line change 1+ package dev.dimension.flare.common
2+
3+ import android.os.Build
4+
5+ internal actual object SystemUtils {
6+ actual val isBlurSupported: Boolean
7+ get() = Build .VERSION .SDK_INT >= Build .VERSION_CODES .S
8+ }
Original file line number Diff line number Diff line change 1+ package dev.dimension.flare.common
2+
3+ internal actual object SystemUtils {
4+ actual val isBlurSupported: Boolean
5+ get() = true
6+ }
Original file line number Diff line number Diff line change 1+ package dev.dimension.flare.common
2+
3+ internal expect object SystemUtils {
4+ val isBlurSupported: Boolean
5+ }
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import compose.icons.fontawesomeicons.Solid
3333import compose.icons.fontawesomeicons.solid.CirclePlay
3434import compose.icons.fontawesomeicons.solid.EyeSlash
3535import dev.dimension.flare.common.AppDeepLink
36+ import dev.dimension.flare.common.SystemUtils
3637import dev.dimension.flare.compose.ui.Res
3738import dev.dimension.flare.compose.ui.status_sensitive_media
3839import dev.dimension.flare.ui.component.AdaptiveGrid
@@ -160,16 +161,16 @@ internal fun StatusMediaComponent(
160161 Modifier
161162 .clip(PlatformTheme .shapes.medium)
162163 .let {
163- if (hideSensitive) {
164- it.blur(32 .dp)
165- } else {
166- it
167- }
168- // if (hideSensitive && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
164+ // if (hideSensitive) {
169165// it.blur(32.dp)
170166// } else {
171167// it
172168// }
169+ if (hideSensitive && SystemUtils .isBlurSupported) {
170+ it.blur(32 .dp)
171+ } else {
172+ it
173+ }
173174 },
174175 expandedSize = appearanceSettings.expandMediaSize,
175176 )
@@ -179,12 +180,11 @@ internal fun StatusMediaComponent(
179180 Modifier
180181 .matchParentSize()
181182 .let {
182- it
183- // if (hideSensitive && Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
184- // it.background(PlatformTheme.colorScheme.surfaceContainer)
185- // } else {
186- // it
187- // }
183+ if (hideSensitive && ! SystemUtils .isBlurSupported) {
184+ it.background(PlatformTheme .colorScheme.outline)
185+ } else {
186+ it
187+ }
188188 }.let {
189189 if (hideSensitive) {
190190 it.clickable {
Original file line number Diff line number Diff line change 1+ package dev.dimension.flare.common
2+
3+ internal actual object SystemUtils {
4+ actual val isBlurSupported: Boolean
5+ get() = true
6+ }
You can’t perform that action at this time.
0 commit comments