summaryrefslogtreecommitdiff
path: root/Source/Android/src/org
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2013-10-10 11:57:18 -0400
committerLioncash <mathew1800@gmail.com>2013-10-10 11:57:18 -0400
commit511de71736d499946a4280292f7cbee2052b1819 (patch)
tree8460cc7897fe43f107d9c24b75c2c50c00d63113 /Source/Android/src/org
parent8b6ff7a358f0e6dcd1ee597c5a5ae9b98389a564 (diff)
[Android] Actually show the currently selected CPU core and video backend within the settings screen.
Diffstat (limited to 'Source/Android/src/org')
-rw-r--r--Source/Android/src/org/dolphinemu/dolphinemu/settings/custom/UpdatingListPreference.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/settings/custom/UpdatingListPreference.java b/Source/Android/src/org/dolphinemu/dolphinemu/settings/custom/UpdatingListPreference.java
new file mode 100644
index 0000000000..7b6fa734ca
--- /dev/null
+++ b/Source/Android/src/org/dolphinemu/dolphinemu/settings/custom/UpdatingListPreference.java
@@ -0,0 +1,33 @@
+package org.dolphinemu.dolphinemu.settings.custom;
+
+import android.content.Context;
+import android.preference.ListPreference;
+import android.util.AttributeSet;
+
+/**
+ * A {@link ListPreference} that updates its summary upon it's selection being changed.
+ */
+public final class UpdatingListPreference extends ListPreference
+{
+ /**
+ * Constructor
+ *
+ * @param context the current {@link Context}.
+ */
+ public UpdatingListPreference(Context context, AttributeSet attribs)
+ {
+ super(context, attribs);
+ }
+
+ @Override
+ public void onDialogClosed(boolean positiveResult)
+ {
+ super.onDialogClosed(positiveResult);
+
+ // If an entry was selected
+ if (positiveResult)
+ {
+ setSummary(getEntry());
+ }
+ }
+}