diff --git a/app/build.gradle b/app/build.gradle index 1a0a6fb..c280794 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,8 +23,8 @@ android { minSdkVersion 21 targetSdkVersion 35 compileSdk 35 - versionCode 44 - versionName "0.1.4" + versionCode 43 + versionName "0.1.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/de/jrpie/android/launcher/ui/HomeActivity.kt b/app/src/main/java/de/jrpie/android/launcher/ui/HomeActivity.kt index 2ab5d9f..53a0876 100644 --- a/app/src/main/java/de/jrpie/android/launcher/ui/HomeActivity.kt +++ b/app/src/main/java/de/jrpie/android/launcher/ui/HomeActivity.kt @@ -37,7 +37,7 @@ import java.util.Locale class HomeActivity : UIObject, AppCompatActivity() { private lateinit var binding: HomeBinding - private var touchGestureDetector: TouchGestureDetector? = null + private lateinit var touchGestureDetector: TouchGestureDetector private var sharedPreferencesListener = SharedPreferences.OnSharedPreferenceChangeListener { _, prefKey -> @@ -56,12 +56,29 @@ class HomeActivity : UIObject, AppCompatActivity() { super.onCreate(savedInstanceState) super.onCreate() + touchGestureDetector = TouchGestureDetector( + this, 0, 0, + LauncherPreferences.enabled_gestures().edgeSwipeEdgeWidth() / 100f + ) + touchGestureDetector.updateScreenSize(windowManager) // Initialise layout binding = HomeBinding.inflate(layoutInflater) setContentView(binding.root) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + binding.root.setOnApplyWindowInsetsListener { _, windowInsets -> + @Suppress("deprecation") // required to support API 29 + val insets = windowInsets.systemGestureInsets + touchGestureDetector.setSystemGestureInsets(insets) + + windowInsets + } + } + + + // Handle back key / gesture on Android 13+, cf. onKeyDown() if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { onBackInvokedDispatcher.registerOnBackInvokedCallback( @@ -77,7 +94,7 @@ class HomeActivity : UIObject, AppCompatActivity() { override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) - touchGestureDetector?.updateScreenSize(windowManager) + touchGestureDetector.updateScreenSize(windowManager) } override fun onStart() { @@ -171,28 +188,8 @@ class HomeActivity : UIObject, AppCompatActivity() { override fun onResume() { super.onResume() - /* This should be initialized in onCreate() - However on some devices there seems to be a bug where the touchGestureDetector - is not working properly after resuming the app. - Reinitializing the touchGestureDetector every time the app is resumed might help to fix that. - (see issue #138) - */ - touchGestureDetector = TouchGestureDetector( - this, 0, 0, + touchGestureDetector.edgeWidth = LauncherPreferences.enabled_gestures().edgeSwipeEdgeWidth() / 100f - ).also { - it.updateScreenSize(windowManager) - } - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - binding.root.setOnApplyWindowInsetsListener { _, windowInsets -> - @Suppress("deprecation") // required to support API 29 - val insets = windowInsets.systemGestureInsets - touchGestureDetector?.setSystemGestureInsets(insets) - - windowInsets - } - } initClock() updateSettingsFallbackButtonVisibility() @@ -233,7 +230,7 @@ class HomeActivity : UIObject, AppCompatActivity() { } override fun onTouchEvent(event: MotionEvent): Boolean { - touchGestureDetector?.onTouchEvent(event) + touchGestureDetector.onTouchEvent(event) return true } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 21f25f5..a8bc9b3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -251,12 +251,12 @@ Music: Next Music: Previous Music: Play / Pause - Expand Notifications Panel + Expand notifications panel Recent Apps - Do Nothing + Do nothing Lock Screen Toggle Torch - Launch Other Home Screen + Launch other Home Screen Add Shortcut diff --git a/fastlane/metadata/android/en-US/changelogs/44.txt b/fastlane/metadata/android/en-US/changelogs/44.txt deleted file mode 100644 index 6c6c4f7..0000000 --- a/fastlane/metadata/android/en-US/changelogs/44.txt +++ /dev/null @@ -1,11 +0,0 @@ -* New action: Launch other launchers -* New action: Show recent apps (workaround for an Android bug) -* Fixed "Set µLauncher as home screen" button -* Size of "choose app" button was limited - -* Added Arabic translation (thank you, letterhaven!) -* Started Lithuanian translation (thank you, IdeallyGrey!) -* Improved Chinese translation (thank you, monkeyotg!) -* Improved Portuguese translation (thank you, "Vossa Excelencia"!) -* Improved Spanish translation (thank you, T!) -