From 08045398d4de7466261ce216f7db7224bd1bcbf5 Mon Sep 17 00:00:00 2001 From: bhaskar966 Date: Tue, 31 Dec 2024 00:01:11 +0530 Subject: [PATCH 1/2] Fix clearBitmap function -- we can't create a bitmap which is nullable now if the bitmap is present it will it will clear it otherwise it will return the actual bitmap. --- .../main/kotlin/dev/jahir/kuper/data/models/Component.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/main/kotlin/dev/jahir/kuper/data/models/Component.kt b/library/src/main/kotlin/dev/jahir/kuper/data/models/Component.kt index 8b353d88..fb8296ee 100644 --- a/library/src/main/kotlin/dev/jahir/kuper/data/models/Component.kt +++ b/library/src/main/kotlin/dev/jahir/kuper/data/models/Component.kt @@ -101,7 +101,7 @@ data class Component( var maxX = -1 var maxY = -1 - val newBitmap = Bitmap.createBitmap(width, height, bitmap.config) + val newBitmap = bitmap.config?.let { Bitmap.createBitmap(width, height, it) } var pixel: Int for (y in 0 until height) { @@ -120,8 +120,8 @@ data class Component( } } - newBitmap.setPixels(pixels, 0, width, 0, 0, width, height) - return Bitmap.createBitmap(newBitmap, minX, minY, maxX - minX + 1, maxY - minY + 1) + newBitmap?.setPixels(pixels, 0, width, 0, 0, width, height) + return newBitmap?.let { Bitmap.createBitmap(it, minX, minY, maxX - minX + 1, maxY - minY + 1) } ?: bitmap } } } From 20dfb90d25f0511cfd4a6fe3803e636774aaf2a0 Mon Sep 17 00:00:00 2001 From: bhaskar966 Date: Tue, 31 Dec 2024 00:06:28 +0530 Subject: [PATCH 2/2] Add support for SDK 35 aka Android 15. -- Due to my limited knowledge about Views or XML layouts, I'm not able to fix the overlapping content with status bar in Android 15. Rather I have, opted out from the enforcement. For now it is fine but Google will soon make it deprecated, so we need to adapt the layout for Android 15 before it deprecate. It is because Android 15 by-default enables edge to edge view. --- app/src/main/res/values-v35/themes.xml | 23 +++++++++++++++++++++++ buildSrc/src/main/java/Versions.kt | 6 +++--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/values-v35/themes.xml diff --git a/app/src/main/res/values-v35/themes.xml b/app/src/main/res/values-v35/themes.xml new file mode 100644 index 00000000..d3c6e7c5 --- /dev/null +++ b/app/src/main/res/values-v35/themes.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/buildSrc/src/main/java/Versions.kt b/buildSrc/src/main/java/Versions.kt index ee475068..b2309cf9 100644 --- a/buildSrc/src/main/java/Versions.kt +++ b/buildSrc/src/main/java/Versions.kt @@ -2,7 +2,7 @@ object Versions { // Plugins - const val gradle = "8.5.0" + const val gradle = "8.6.0" const val kotlin = "2.0.0" const val sonatype = "2.0.0" const val ksp = "$kotlin-1.0.22" @@ -12,8 +12,8 @@ object Versions { // App const val minSdk = 21 - const val targetSdk = 34 - const val buildTools = "34.0.0" + const val targetSdk = 35 + const val buildTools = "35.0.0" // Frames const val frames = "3.6.2"