From 3426fd98e3f29f07d58b7bfc24b3100fe96df176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Fri, 28 Jul 2023 16:00:54 +0200 Subject: [PATCH] Upgrade targetSdkVersion to 34 This API version update doesn't seem to affect this launcher that much. Only differences were signatures of these 2 methods (onFling and onDraw), but no other changes really affect this app from these lists: - https://developer.android.com/about/versions/14/behavior-changes-all - https://developer.android.com/about/versions/14/behavior-changes-14 Font scaling can go up to 200% now and it doesn't break functionality either. --- app/build.gradle | 4 ++-- .../simplemobiletools/launcher/activities/MainActivity.kt | 2 +- .../com/simplemobiletools/launcher/views/HomeScreenGrid.kt | 6 +----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1f219a1..29177a0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,12 +10,12 @@ if (keystorePropertiesFile.exists()) { } android { - compileSdkVersion 33 + compileSdkVersion 34 defaultConfig { applicationId "com.simplemobiletools.launcher" minSdkVersion 26 - targetSdkVersion 33 + targetSdkVersion 34 versionCode 8 versionName "5.0.6" setProperty("archivesBaseName", "launcher") diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt index ba0289f..484409c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/activities/MainActivity.kt @@ -667,7 +667,7 @@ class MainActivity : SimpleActivity(), FlingListener { return super.onSingleTapUp(event) } - override fun onFling(event1: MotionEvent, event2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { + override fun onFling(event1: MotionEvent?, event2: MotionEvent, velocityX: Float, velocityY: Float): Boolean { // ignore fling events just after releasing an icon from dragging if (System.currentTimeMillis() - mLastUpEvent < 500L) { return true diff --git a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt index dfda1d3..4f2c7f8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt +++ b/app/src/main/kotlin/com/simplemobiletools/launcher/views/HomeScreenGrid.kt @@ -673,11 +673,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel private fun getFakeHeight() = height - sideMargins.top - sideMargins.bottom @SuppressLint("DrawAllocation") - override fun onDraw(canvas: Canvas?) { - if (canvas == null) { - return - } - + override fun onDraw(canvas: Canvas) { super.onDraw(canvas) if (cellXCoords.isEmpty()) { fillCellSizes()