From 9de19ff7a136f274397be7756bf0f69a34eb342f Mon Sep 17 00:00:00 2001 From: PabloMK7 Date: Tue, 16 Jul 2024 12:50:12 +0200 Subject: [PATCH] Revert "android: implement device rotation options (#182)" (#194) This reverts commit 93025c95f2ce4baed37a7b587236f12ef667c540. --- .../citra_emu/activities/EmulationActivity.kt | 14 +++----------- .../features/settings/model/IntSetting.kt | 5 +---- .../settings/ui/SettingsFragmentPresenter.kt | 14 -------------- src/android/app/src/main/res/values/arrays.xml | 15 --------------- src/android/app/src/main/res/values/strings.xml | 10 ---------- 5 files changed, 4 insertions(+), 54 deletions(-) diff --git a/src/android/app/src/main/java/org/citra/citra_emu/activities/EmulationActivity.kt b/src/android/app/src/main/java/org/citra/citra_emu/activities/EmulationActivity.kt index 0f3a5fb81..c22547f81 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/activities/EmulationActivity.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/activities/EmulationActivity.kt @@ -35,8 +35,6 @@ import org.citra.citra_emu.display.ScreenAdjustmentUtil import org.citra.citra_emu.features.hotkeys.HotkeyUtility import org.citra.citra_emu.features.settings.model.SettingsViewModel import org.citra.citra_emu.features.settings.model.view.InputBindingSetting -import org.citra.citra_emu.features.settings.model.IntSetting -import org.citra.citra_emu.features.settings.model.Settings import org.citra.citra_emu.fragments.MessageDialogFragment import org.citra.citra_emu.utils.ControllerMappingHelper import org.citra.citra_emu.utils.FileBrowserHelper @@ -62,10 +60,7 @@ class EmulationActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { ThemeUtil.setTheme(this) - isActivityRecreated = savedInstanceState != null - if (!isActivityRecreated) { - settingsViewModel.settings.loadSettings() - } + settingsViewModel.settings.loadSettings() super.onCreate(savedInstanceState) @@ -79,6 +74,8 @@ class EmulationActivity : AppCompatActivity() { val navController = navHostFragment.navController navController.setGraph(R.navigation.emulation_navigation, intent.extras) + isActivityRecreated = savedInstanceState != null + // Set these options now so that the SurfaceView the game renders into is the right size. enableFullscreenImmersive() @@ -178,11 +175,6 @@ class EmulationActivity : AppCompatActivity() { controller.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE } - - - val orientation = settingsViewModel.settings.getSection(Settings.SECTION_RENDERER) - ?.getSetting(IntSetting.DEVICE_ORIENTATION.key) as IntSetting - this.requestedOrientation = orientation.int } // Gets button presses diff --git a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/IntSetting.kt b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/IntSetting.kt index 7e921cc3c..378c0eb05 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/IntSetting.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/model/IntSetting.kt @@ -4,8 +4,6 @@ package org.citra.citra_emu.features.settings.model -import android.content.pm.ActivityInfo - enum class IntSetting( override val key: String, override val section: String, @@ -43,8 +41,7 @@ enum class IntSetting( DEBUG_RENDERER("renderer_debug", Settings.SECTION_DEBUG, 0), TEXTURE_FILTER("texture_filter", Settings.SECTION_RENDERER, 0), USE_FRAME_LIMIT("use_frame_limit", Settings.SECTION_RENDERER, 1), - DELAY_RENDER_THREAD_US("delay_game_render_thread_us", Settings.SECTION_RENDERER, 0), - DEVICE_ORIENTATION("default_device_orientation", Settings.SECTION_RENDERER, ActivityInfo.SCREEN_ORIENTATION_USER); + DELAY_RENDER_THREAD_US("delay_game_render_thread_us", Settings.SECTION_RENDERER, 0); override var int: Int = defaultValue diff --git a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/ui/SettingsFragmentPresenter.kt b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/ui/SettingsFragmentPresenter.kt index 7d43031ae..f949950bc 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/ui/SettingsFragmentPresenter.kt @@ -173,20 +173,6 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView) private fun addGeneralSettings(sl: ArrayList) { settingsActivity.setToolbarTitle(settingsActivity.getString(R.string.preferences_general)) sl.apply { - add(HeaderSetting(R.string.graphics_ui)) - add( - SingleChoiceSetting( - IntSetting.DEVICE_ORIENTATION, - R.string.device_orientation_title, - R.string.device_orientation_description, - R.array.deviceOrientationEntries, - R.array.deviceOrientationValues, - IntSetting.DEVICE_ORIENTATION.key, - IntSetting.DEVICE_ORIENTATION.defaultValue, - ) - ) - - add(HeaderSetting(R.string.emulator_speed)) add( SwitchSetting( IntSetting.USE_FRAME_LIMIT, diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index 5f71b7cb5..cd542bae8 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml @@ -191,21 +191,6 @@ 2 - - @string/device_orientation_system - @string/device_orientation_landscape - @string/device_orientation_portrait - @string/device_orientation_auto - - - - - 2 - 6 - 7 - 4 - - @string/system_region_jpn @string/system_region_usa diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index e1f9f75a3..a01418870 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -204,8 +204,6 @@ Flip - UI - Speed Renderer Graphics API Enable SPIR-V shader generation @@ -467,14 +465,6 @@ Black Backgrounds When using the dark theme, apply black backgrounds. - - Screen Orientation - How should your games be displayed? - Follow System Setting - Landscape - Portrait - Automatic - Device Clock Simulated Clock