diff --git a/android/app/src/main/java/io/narl/protonstream/ui/LibraryScreen.kt b/android/app/src/main/java/io/narl/protonstream/ui/LibraryScreen.kt index c8f6185..76e764c 100644 --- a/android/app/src/main/java/io/narl/protonstream/ui/LibraryScreen.kt +++ b/android/app/src/main/java/io/narl/protonstream/ui/LibraryScreen.kt @@ -17,7 +17,7 @@ import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.graphics.lerp import androidx.compose.ui.graphics.luminance import androidx.compose.ui.layout.layout -import androidx.compose.ui.platform.LocalConfiguration +import androidx.compose.ui.platform.LocalWindowInfo import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.semantics.selected import androidx.compose.ui.unit.Dp @@ -861,7 +861,8 @@ private fun FeaturedBanner( } // Most of a phone's first screen, but never so much of a tablet's that // nothing under it shows. - val height = (LocalConfiguration.current.screenHeightDp * 0.62f).dp.coerceIn(360.dp, 620.dp) + val screenHeight = with(LocalDensity.current) { LocalWindowInfo.current.containerSize.height.toDp() } + val height = (screenHeight * 0.62f).coerceIn(360.dp, 620.dp) Box(modifier.fillMaxWidth().height(height)) { HorizontalPager(pager, Modifier.fillMaxSize(), key = { titles[it].key }) { page -> val title = titles[page] diff --git a/android/app/src/main/java/io/narl/protonstream/ui/RemoteArtwork.kt b/android/app/src/main/java/io/narl/protonstream/ui/RemoteArtwork.kt index 83310a7..cb17ba4 100644 --- a/android/app/src/main/java/io/narl/protonstream/ui/RemoteArtwork.kt +++ b/android/app/src/main/java/io/narl/protonstream/ui/RemoteArtwork.kt @@ -43,6 +43,7 @@ import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.compose.ui.text.font.FontWeight +import androidx.core.graphics.scale import io.narl.protonstream.native.NativeRuntime import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -181,7 +182,7 @@ private suspend fun moodOf(key: String, bitmap: Bitmap): Color? { moods.get(key)?.let { return Color(it) } val argb = withContext(Dispatchers.Default) { runCatching { - val small = Bitmap.createScaledBitmap(bitmap, MOOD_EDGE, MOOD_EDGE, true) + val small = bitmap.scale(MOOD_EDGE, MOOD_EDGE) val pixels = IntArray(MOOD_EDGE * MOOD_EDGE) small.getPixels(pixels, 0, MOOD_EDGE, 0, 0, MOOD_EDGE, MOOD_EDGE) sharedPictureMood(pixels.map(Int::toUInt))?.toInt() diff --git a/android/app/src/test/screenshots/library-phone-large-font.png b/android/app/src/test/screenshots/library-phone-large-font.png index 1c72730..6a6a43b 100644 Binary files a/android/app/src/test/screenshots/library-phone-large-font.png and b/android/app/src/test/screenshots/library-phone-large-font.png differ diff --git a/android/app/src/test/screenshots/library-phone-light.png b/android/app/src/test/screenshots/library-phone-light.png index d2f2448..dd8683c 100644 Binary files a/android/app/src/test/screenshots/library-phone-light.png and b/android/app/src/test/screenshots/library-phone-light.png differ diff --git a/android/app/src/test/screenshots/library-phone-offer.png b/android/app/src/test/screenshots/library-phone-offer.png index 3d2f1ac..90ddcbc 100644 Binary files a/android/app/src/test/screenshots/library-phone-offer.png and b/android/app/src/test/screenshots/library-phone-offer.png differ diff --git a/android/app/src/test/screenshots/library-phone.png b/android/app/src/test/screenshots/library-phone.png index b439be4..19a4be9 100644 Binary files a/android/app/src/test/screenshots/library-phone.png and b/android/app/src/test/screenshots/library-phone.png differ