summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-05-31 08:23:23 +0200
committerbunnei <bunneidev@gmail.com>2023-06-03 09:06:05 +0200
commitfdd200d33f1dd4789257ed2ddb207a9b067133bb (patch)
tree475979ceb2df0d2933982ced74044cd603ee55a4 /src/android
parentandroid: Fix link text color for base theme dialog (diff)
downloadyuzu-fdd200d33f1dd4789257ed2ddb207a9b067133bb.tar
yuzu-fdd200d33f1dd4789257ed2ddb207a9b067133bb.tar.gz
yuzu-fdd200d33f1dd4789257ed2ddb207a9b067133bb.tar.bz2
yuzu-fdd200d33f1dd4789257ed2ddb207a9b067133bb.tar.lz
yuzu-fdd200d33f1dd4789257ed2ddb207a9b067133bb.tar.xz
yuzu-fdd200d33f1dd4789257ed2ddb207a9b067133bb.tar.zst
yuzu-fdd200d33f1dd4789257ed2ddb207a9b067133bb.zip
Diffstat (limited to 'src/android')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/RunnableSetting.kt1
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt3
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/RunnableViewHolder.kt5
3 files changed, 7 insertions, 2 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/RunnableSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/RunnableSetting.kt
index dc89b5774..caaab50d8 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/RunnableSetting.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/view/RunnableSetting.kt
@@ -6,6 +6,7 @@ package org.yuzu.yuzu_emu.features.settings.model.view
class RunnableSetting(
titleId: Int,
descriptionId: Int,
+ val isRuntimeRunnable: Boolean,
val runnable: () -> Unit
) : SettingsItem(null, titleId, descriptionId) {
override val type = TYPE_RUNNABLE
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt
index d9abc358a..7d55c5b2f 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt
@@ -115,7 +115,8 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
add(
RunnableSetting(
R.string.reset_to_default,
- 0
+ 0,
+ false
) {
ResetSettingsDialogFragment().show(
settingsActivity.supportFragmentManager,
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/RunnableViewHolder.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/RunnableViewHolder.kt
index 0c0bb93fc..5dad5945f 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/RunnableViewHolder.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/viewholder/RunnableViewHolder.kt
@@ -4,6 +4,7 @@
package org.yuzu.yuzu_emu.features.settings.ui.viewholder
import android.view.View
+import org.yuzu.yuzu_emu.NativeLibrary
import org.yuzu.yuzu_emu.databinding.ListItemSettingBinding
import org.yuzu.yuzu_emu.features.settings.model.view.RunnableSetting
import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem
@@ -25,7 +26,9 @@ class RunnableViewHolder(val binding: ListItemSettingBinding, adapter: SettingsA
}
override fun onClick(clicked: View) {
- setting.runnable.invoke()
+ if (!setting.isRuntimeRunnable && !NativeLibrary.isRunning()) {
+ setting.runnable.invoke()
+ }
}
override fun onLongClick(clicked: View): Boolean {