summaryrefslogtreecommitdiffstats
path: root/src/android/app
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-05-29 02:05:55 +0200
committerbunnei <bunneidev@gmail.com>2023-06-03 09:06:04 +0200
commitd49eb7faad11c700d982a4e8023404da13a2a93f (patch)
tree3d8546e9bf1e48b875f8528089abc1a57f5ce9ee /src/android/app
parentCI: use the verify pipeline to do releases (diff)
downloadyuzu-d49eb7faad11c700d982a4e8023404da13a2a93f.tar
yuzu-d49eb7faad11c700d982a4e8023404da13a2a93f.tar.gz
yuzu-d49eb7faad11c700d982a4e8023404da13a2a93f.tar.bz2
yuzu-d49eb7faad11c700d982a4e8023404da13a2a93f.tar.lz
yuzu-d49eb7faad11c700d982a4e8023404da13a2a93f.tar.xz
yuzu-d49eb7faad11c700d982a4e8023404da13a2a93f.tar.zst
yuzu-d49eb7faad11c700d982a4e8023404da13a2a93f.zip
Diffstat (limited to 'src/android/app')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt36
-rw-r--r--src/android/app/src/main/res/layout/fragment_emulation.xml5
-rw-r--r--src/android/app/src/main/res/menu/menu_overlay_options.xml5
-rw-r--r--src/android/app/src/main/res/values/strings.xml1
4 files changed, 37 insertions, 10 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 1d1c1333d..a31414a0e 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
@@ -111,19 +111,23 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
}
true
}
+
R.id.menu_settings -> {
SettingsActivity.launch(requireContext(), SettingsFile.FILE_NAME_CONFIG, "")
true
}
+
R.id.menu_overlay_controls -> {
showOverlayOptions()
true
}
+
R.id.menu_exit -> {
requireActivity().finish()
emulationState.stop()
true
}
+
else -> true
}
}
@@ -224,6 +228,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
popup.menuInflater.inflate(R.menu.menu_overlay_options, popup.menu)
popup.menu.apply {
+ findItem(R.id.menu_toggle_fps).isChecked = EmulationMenuSettings.showFps
findItem(R.id.menu_rel_stick_center).isChecked = EmulationMenuSettings.joystickRelCenter
findItem(R.id.menu_dpad_slide).isChecked = EmulationMenuSettings.dpadSlide
findItem(R.id.menu_show_overlay).isChecked = EmulationMenuSettings.showOverlay
@@ -232,12 +237,20 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
popup.setOnMenuItemClickListener {
when (it.itemId) {
+ R.id.menu_toggle_fps -> {
+ it.isChecked = !it.isChecked
+ EmulationMenuSettings.showFps = it.isChecked
+ updateShowFpsOverlay()
+ true
+ }
+
R.id.menu_edit_overlay -> {
binding.drawerLayout.close()
binding.surfaceInputOverlay.requestFocus()
startConfiguringControls()
true
}
+
R.id.menu_toggle_controls -> {
val preferences =
PreferenceManager.getDefaultSharedPreferences(YuzuApplication.appContext)
@@ -276,32 +289,38 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
}
true
}
+
R.id.menu_show_overlay -> {
it.isChecked = !it.isChecked
EmulationMenuSettings.showOverlay = it.isChecked
refreshInputOverlay()
true
}
+
R.id.menu_rel_stick_center -> {
it.isChecked = !it.isChecked
EmulationMenuSettings.joystickRelCenter = it.isChecked
true
}
+
R.id.menu_dpad_slide -> {
it.isChecked = !it.isChecked
EmulationMenuSettings.dpadSlide = it.isChecked
true
}
+
R.id.menu_haptics -> {
it.isChecked = !it.isChecked
EmulationMenuSettings.hapticFeedback = it.isChecked
true
}
+
R.id.menu_reset_overlay -> {
binding.drawerLayout.close()
resetInputOverlay()
true
}
+
else -> true
}
}
@@ -333,12 +352,14 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
right = cutInsets.right
}
- // Don't use padding if the navigation bar isn't in the way
- if (InsetsHelper.getBottomPaddingRequired(requireActivity()) > 0) {
- v.setPadding(left, cutInsets.top, right, 0)
- } else {
- v.setPadding(left, cutInsets.top, right, 0)
- }
+ v.setPadding(left, cutInsets.top, right, 0)
+
+ binding.showFpsText.setPadding(
+ cutInsets.left,
+ cutInsets.top,
+ cutInsets.right,
+ cutInsets.bottom
+ )
windowInsets
}
}
@@ -431,6 +452,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
NativeLibrary.surfaceDestroyed()
state = State.PAUSED
}
+
State.PAUSED -> Log.warning("[EmulationFragment] Surface cleared while emulation paused.")
else -> Log.warning("[EmulationFragment] Surface cleared while emulation stopped.")
}
@@ -448,11 +470,13 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
}, "NativeEmulation")
mEmulationThread.start()
}
+
State.PAUSED -> {
Log.debug("[EmulationFragment] Resuming emulation.")
NativeLibrary.surfaceChanged(surface)
NativeLibrary.unPauseEmulation()
}
+
else -> Log.debug("[EmulationFragment] Bug, run called while already running.")
}
state = State.RUNNING
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 68eedffe1..648b5aaed 100644
--- a/src/android/app/src/main/res/layout/fragment_emulation.xml
+++ b/src/android/app/src/main/res/layout/fragment_emulation.xml
@@ -32,11 +32,8 @@
android:id="@+id/show_fps_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="18dp"
- android:layout_marginTop="2dp"
android:clickable="false"
- android:linksClickable="false"
- android:longClickable="false"
+ android:focusable="false"
android:shadowColor="@android:color/black"
android:textColor="@android:color/white"
android:textSize="12sp" />
diff --git a/src/android/app/src/main/res/menu/menu_overlay_options.xml b/src/android/app/src/main/res/menu/menu_overlay_options.xml
index 9acc29405..09e8b7970 100644
--- a/src/android/app/src/main/res/menu/menu_overlay_options.xml
+++ b/src/android/app/src/main/res/menu/menu_overlay_options.xml
@@ -2,6 +2,11 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
+ android:id="@+id/menu_toggle_fps"
+ android:title="@string/emulation_fps_counter"
+ android:checkable="true" />
+
+ <item
android:id="@+id/menu_edit_overlay"
android:title="@string/emulation_touch_overlay_edit" />
diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml
index 87e07b581..09b95848f 100644
--- a/src/android/app/src/main/res/values/strings.xml
+++ b/src/android/app/src/main/res/values/strings.xml
@@ -183,6 +183,7 @@
<!-- Emulation Menu -->
<string name="emulation_exit">Exit Emulation</string>
<string name="emulation_done">Done</string>
+ <string name="emulation_fps_counter">FPS Counter</string>
<string name="emulation_toggle_controls">Toggle Controls</string>
<string name="emulation_rel_stick_center">Relative Stick Center</string>
<string name="emulation_dpad_slide">DPad Slide</string>