summaryrefslogtreecommitdiff
path: root/src/android/app
diff options
context:
space:
mode:
authorGravatar german772023-03-25 13:04:36 -0600
committerGravatar bunnei2023-06-03 00:05:47 -0700
commita862c33fc420ce4945dc91b8e6abba342961e03f (patch)
treeb1a35fdb2aac3f1f7d82ac3bafe43d354f519dc8 /src/android/app
parentandroid: Prevent showing games on an invalid view (diff)
downloadyuzu-a862c33fc420ce4945dc91b8e6abba342961e03f.tar.gz
yuzu-a862c33fc420ce4945dc91b8e6abba342961e03f.tar.xz
yuzu-a862c33fc420ce4945dc91b8e6abba342961e03f.zip
android: Fix fps counter not showing up
Diffstat (limited to 'src/android/app')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt5
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt2
-rw-r--r--src/android/app/src/main/res/layout/fragment_emulation.xml16
-rw-r--r--src/android/app/src/main/res/values/strings.xml1
4 files changed, 13 insertions, 11 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
index 18517bdf8..3f6f39dff 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt
@@ -33,6 +33,7 @@ import org.yuzu.yuzu_emu.model.Game
33import org.yuzu.yuzu_emu.utils.DirectoryInitialization 33import org.yuzu.yuzu_emu.utils.DirectoryInitialization
34import org.yuzu.yuzu_emu.utils.DirectoryInitialization.DirectoryInitializationState 34import org.yuzu.yuzu_emu.utils.DirectoryInitialization.DirectoryInitializationState
35import org.yuzu.yuzu_emu.utils.DirectoryStateReceiver 35import org.yuzu.yuzu_emu.utils.DirectoryStateReceiver
36import org.yuzu.yuzu_emu.utils.EmulationMenuSettings
36import org.yuzu.yuzu_emu.utils.InsetsHelper 37import org.yuzu.yuzu_emu.utils.InsetsHelper
37import org.yuzu.yuzu_emu.utils.Log 38import org.yuzu.yuzu_emu.utils.Log
38import org.yuzu.yuzu_emu.utils.SerializableHelper.parcelable 39import org.yuzu.yuzu_emu.utils.SerializableHelper.parcelable
@@ -221,8 +222,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
221 } 222 }
222 223
223 private fun updateShowFpsOverlay() { 224 private fun updateShowFpsOverlay() {
224 // TODO: Create a setting so that this actually works... 225 if (EmulationMenuSettings.showFps) {
225 if (true) {
226 val SYSTEM_FPS = 0 226 val SYSTEM_FPS = 0
227 val FPS = 1 227 val FPS = 1
228 val FRAMETIME = 2 228 val FRAMETIME = 2
@@ -238,6 +238,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
238 } 238 }
239 } 239 }
240 perfStatsUpdateHandler.post(perfStatsUpdater!!) 240 perfStatsUpdateHandler.post(perfStatsUpdater!!)
241 binding.showFpsText.text = resources.getString(R.string.emulation_game_loading)
241 binding.showFpsText.visibility = View.VISIBLE 242 binding.showFpsText.visibility = View.VISIBLE
242 } else { 243 } else {
243 if (perfStatsUpdater != null) { 244 if (perfStatsUpdater != null) {
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt
index 46690bee2..937f13fea 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/EmulationMenuSettings.kt
@@ -46,7 +46,7 @@ object EmulationMenuSettings {
46 .apply() 46 .apply()
47 } 47 }
48 var showFps: Boolean 48 var showFps: Boolean
49 get() = preferences.getBoolean(Settings.PREF_MENU_SETTINGS_SHOW_FPS, false) 49 get() = preferences.getBoolean(Settings.PREF_MENU_SETTINGS_SHOW_FPS, true)
50 set(value) { 50 set(value) {
51 preferences.edit() 51 preferences.edit()
52 .putBoolean(Settings.PREF_MENU_SETTINGS_SHOW_FPS, value) 52 .putBoolean(Settings.PREF_MENU_SETTINGS_SHOW_FPS, value)
diff --git a/src/android/app/src/main/res/layout/fragment_emulation.xml b/src/android/app/src/main/res/layout/fragment_emulation.xml
index b99c2e9c3..68eedffe1 100644
--- a/src/android/app/src/main/res/layout/fragment_emulation.xml
+++ b/src/android/app/src/main/res/layout/fragment_emulation.xml
@@ -20,6 +20,14 @@
20 android:focusable="false" 20 android:focusable="false"
21 android:focusableInTouchMode="false" /> 21 android:focusableInTouchMode="false" />
22 22
23 <!-- This is the onscreen input overlay -->
24 <org.yuzu.yuzu_emu.overlay.InputOverlay
25 android:id="@+id/surface_input_overlay"
26 android:layout_width="match_parent"
27 android:layout_height="match_parent"
28 android:focusable="true"
29 android:focusableInTouchMode="true" />
30
23 <TextView 31 <TextView
24 android:id="@+id/show_fps_text" 32 android:id="@+id/show_fps_text"
25 android:layout_width="wrap_content" 33 android:layout_width="wrap_content"
@@ -33,14 +41,6 @@
33 android:textColor="@android:color/white" 41 android:textColor="@android:color/white"
34 android:textSize="12sp" /> 42 android:textSize="12sp" />
35 43
36 <!-- This is the onscreen input overlay -->
37 <org.yuzu.yuzu_emu.overlay.InputOverlay
38 android:id="@+id/surface_input_overlay"
39 android:layout_width="match_parent"
40 android:layout_height="match_parent"
41 android:focusable="true"
42 android:focusableInTouchMode="true" />
43
44 <Button 44 <Button
45 style="@style/Widget.Material3.Button.ElevatedButton" 45 style="@style/Widget.Material3.Button.ElevatedButton"
46 android:id="@+id/done_control_config" 46 android:id="@+id/done_control_config"
diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml
index c471425f2..0014b2146 100644
--- a/src/android/app/src/main/res/values/strings.xml
+++ b/src/android/app/src/main/res/values/strings.xml
@@ -91,6 +91,7 @@
91 <string name="emulation_pause">Pause Emulation</string> 91 <string name="emulation_pause">Pause Emulation</string>
92 <string name="emulation_unpause">Unpause Emulation</string> 92 <string name="emulation_unpause">Unpause Emulation</string>
93 <string name="emulation_input_overlay">Input Overlay</string> 93 <string name="emulation_input_overlay">Input Overlay</string>
94 <string name="emulation_game_loading">Game loading…</string>
94 95
95 <string name="load_settings">Loading Settings…</string> 96 <string name="load_settings">Loading Settings…</string>
96 97