diff --git a/app/build.gradle b/app/build.gradle index 2f95343..169a4e4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ android { minSdkVersion 21 targetSdkVersion 29 versionCode 59 - versionName "1.7.3" + versionName "1.7.4" vectorDrawables.useSupportLibrary = true manifestPlaceholders = [appName: "@string/app_name"] diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 63f3c90..0bc8a0d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -24,6 +24,7 @@ @@ -79,6 +80,5 @@ - \ No newline at end of file diff --git a/app/src/main/java/com/pluscubed/velociraptor/settings/SettingsActivity.kt b/app/src/main/java/com/pluscubed/velociraptor/settings/SettingsActivity.kt index bd25773..3dd79e0 100644 --- a/app/src/main/java/com/pluscubed/velociraptor/settings/SettingsActivity.kt +++ b/app/src/main/java/com/pluscubed/velociraptor/settings/SettingsActivity.kt @@ -1,6 +1,7 @@ package com.pluscubed.velociraptor.settings import android.content.Intent +import android.content.res.Configuration import android.os.Build import android.os.Bundle import android.provider.Settings @@ -39,6 +40,7 @@ class SettingsActivity : AppCompatActivity() { private val generalFragment = GeneralFragment() private val advancedFragment = AdvancedFragment() private var active: Fragment = permissionsFragment + private var bottomNavigationSelectedItemId = R.id.action_permissions override fun onCreate(savedInstanceState: Bundle?) { @@ -100,6 +102,12 @@ class SettingsActivity : AppCompatActivity() { PrefUtils.setFirstRun(this, false) PrefUtils.setVersionCode(this, BuildConfig.VERSION_CODE) + // Zustand der BottomNavigationView wiederherstellen + if (savedInstanceState != null) { + bottomNavigationSelectedItemId = savedInstanceState.getInt("selectedItemId", R.id.action_advanced) + } + bottomNavigationView.selectedItemId = bottomNavigationSelectedItemId + } fun showSupportDialog() { @@ -110,11 +118,20 @@ class SettingsActivity : AppCompatActivity() { super.onPause() startLimitService(false) } - override fun onCreateOptionsMenu(menu: Menu): Boolean { menuInflater.inflate(R.menu.menu_settings, menu) return true } + override fun onSaveInstanceState(outState: Bundle) { + // Zustand der BottomNavigationView speichern + outState.putInt("selectedItemId", bottomNavigationView.selectedItemId) + + super.onSaveInstanceState(outState) + } + override fun onConfigurationChanged(newConfig: Configuration) { + super.onConfigurationChanged(newConfig) + + } override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) {