diff --git a/app/src/main/kotlin/com/dot/gallery/core/presentation/components/LoadingAlbum.kt b/app/src/main/kotlin/com/dot/gallery/core/presentation/components/LoadingAlbum.kt index 0df319096..8d68407be 100644 --- a/app/src/main/kotlin/com/dot/gallery/core/presentation/components/LoadingAlbum.kt +++ b/app/src/main/kotlin/com/dot/gallery/core/presentation/components/LoadingAlbum.kt @@ -5,6 +5,7 @@ package com.dot.gallery.core.presentation.components +import android.os.Build import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -36,12 +37,13 @@ fun LoadingAlbum( val gridSize by rememberAlbumGridSize() val grid = remember(gridSize) { albumCellsList.size - gridSize } val shape = remember { RoundedCornerShape(16.dp) } + val canShimmer = remember { Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU } Column( modifier = modifier .fillMaxSize() .padding(horizontal = 16.dp) .padding(top = 48.dp) - .then(if (shouldShimmer) Modifier.shimmer() else Modifier), + .then(if (shouldShimmer && canShimmer) Modifier.shimmer() else Modifier), verticalArrangement = Arrangement.spacedBy(8.dp), ) { repeat(2) { diff --git a/app/src/main/kotlin/com/dot/gallery/core/presentation/components/LoadingMedia.kt b/app/src/main/kotlin/com/dot/gallery/core/presentation/components/LoadingMedia.kt index 2cdffe9b9..1079479d1 100644 --- a/app/src/main/kotlin/com/dot/gallery/core/presentation/components/LoadingMedia.kt +++ b/app/src/main/kotlin/com/dot/gallery/core/presentation/components/LoadingMedia.kt @@ -5,6 +5,7 @@ package com.dot.gallery.core.presentation.components +import android.os.Build import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -39,10 +40,11 @@ fun LoadingMedia( ) { val gridSize by rememberGridSize() val grid = remember(gridSize) { cellsList.size - gridSize } + val canShimmer = remember { Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU } Column( modifier = modifier .fillMaxSize() - .then(if (shouldShimmer) Modifier.shimmer() else Modifier), + .then(if (shouldShimmer && canShimmer) Modifier.shimmer() else Modifier), verticalArrangement = Arrangement.spacedBy(1.dp), ) { if (topContent != null) {