From c4014f2bf10df5e75f947f200fe1caa5572ae9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Fri, 5 Jan 2024 17:16:13 +0100 Subject: [PATCH] fix: re-enable orientation change, without reloading webview --- mobile/src/main/AndroidManifest.xml | 3 +-- .../java/net/activitywatch/android/MainActivity.kt | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml index c983de3..a696502 100644 --- a/mobile/src/main/AndroidManifest.xml +++ b/mobile/src/main/AndroidManifest.xml @@ -30,8 +30,7 @@ diff --git a/mobile/src/main/java/net/activitywatch/android/MainActivity.kt b/mobile/src/main/java/net/activitywatch/android/MainActivity.kt index 0c439e0..ab1bc10 100644 --- a/mobile/src/main/java/net/activitywatch/android/MainActivity.kt +++ b/mobile/src/main/java/net/activitywatch/android/MainActivity.kt @@ -23,6 +23,16 @@ const val baseURL = "http://127.0.0.1:5600" class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelectedListener, WebUIFragment.OnFragmentInteractionListener { + override fun onConfigurationChanged(newConfig: Configuration) { + super.onConfigurationChanged(newConfig) + // Checks the orientation of the screen + if (newConfig.orientation === Configuration.ORIENTATION_LANDSCAPE) { + Log.i(TAG, "Screen orientation changed to landscape") + } else if (newConfig.orientation === Configuration.ORIENTATION_PORTRAIT){ + Log.i(TAG, "Screen orientation changed to portrait") + } + } + private lateinit var binding: ActivityMainBinding val version: String