From fa0c3aa62d308797311e0380789fd1998bbcbb4a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 28 Dec 2014 20:17:24 -0500 Subject: [PATCH 1/4] Android: Remove unnecessary context variable in SliderPreference --- .../dolphinemu/utils/SliderPreference.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/utils/SliderPreference.java b/Source/Android/src/org/dolphinemu/dolphinemu/utils/SliderPreference.java index b5b394ed83..a4b67a89a8 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/utils/SliderPreference.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/utils/SliderPreference.java @@ -5,7 +5,6 @@ import android.content.Context; import android.os.Bundle; import android.preference.DialogPreference; import android.util.AttributeSet; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; @@ -19,8 +18,6 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek { private static final String androidns = "http://schemas.android.com/apk/res/android"; - private Context m_context; - // SeekBar private int m_max, m_value; private SeekBar m_seekbar; @@ -30,8 +27,7 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek public SliderPreference(Context context, AttributeSet attrs) { - super(context,attrs); - m_context = context; + super(context, attrs); // Seekbar values m_value = attrs.getAttributeIntValue(androidns, "defaultValue", 0); @@ -41,7 +37,7 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek @Override protected View onCreateDialogView() { - LayoutInflater inflater = LayoutInflater.from(m_context); + LayoutInflater inflater = LayoutInflater.from(getContext()); LinearLayout layout = (LinearLayout)inflater.inflate(R.layout.slider_layout, null, false); m_seekbar = (SeekBar)layout.getChildAt(0); @@ -77,8 +73,8 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek } @Override - public void showDialog(Bundle state) { - + public void showDialog(Bundle state) + { super.showDialog(state); Button positiveButton = ((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE); @@ -86,7 +82,8 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek } @Override - public void onClick(View v) { + public void onClick(View v) + { if (shouldPersist()) { persistString(Integer.toString(m_seekbar.getProgress())); From 4221999c6eb4b969f40b1a6e85b334cc7ec750d3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 28 Dec 2014 20:19:29 -0500 Subject: [PATCH 2/4] Android: Fix a warning regarding a string in the slider layout --- Source/Android/res/layout/slider_layout.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Android/res/layout/slider_layout.xml b/Source/Android/res/layout/slider_layout.xml index 1448bf44ad..4341d9da16 100644 --- a/Source/Android/res/layout/slider_layout.xml +++ b/Source/Android/res/layout/slider_layout.xml @@ -1,5 +1,6 @@ From 038b9686980a6e9373afc71998be5484e39d2218 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 28 Dec 2014 20:33:24 -0500 Subject: [PATCH 3/4] Android: Use findViewById instead of getChildAt More futureproof if anything else is added to the layout. --- Source/Android/res/layout/slider_layout.xml | 4 ++-- .../src/org/dolphinemu/dolphinemu/utils/SliderPreference.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Android/res/layout/slider_layout.xml b/Source/Android/res/layout/slider_layout.xml index 4341d9da16..a667ff6489 100644 --- a/Source/Android/res/layout/slider_layout.xml +++ b/Source/Android/res/layout/slider_layout.xml @@ -10,14 +10,14 @@ \ No newline at end of file diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/utils/SliderPreference.java b/Source/Android/src/org/dolphinemu/dolphinemu/utils/SliderPreference.java index a4b67a89a8..eab6f74ff0 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/utils/SliderPreference.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/utils/SliderPreference.java @@ -40,8 +40,8 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek LayoutInflater inflater = LayoutInflater.from(getContext()); LinearLayout layout = (LinearLayout)inflater.inflate(R.layout.slider_layout, null, false); - m_seekbar = (SeekBar)layout.getChildAt(0); - m_textview = (TextView)layout.getChildAt(1); + m_seekbar = (SeekBar)layout.findViewById(R.id.sliderSeekBar); + m_textview = (TextView)layout.findViewById(R.id.sliderTextView); if (shouldPersist()) m_value = Integer.valueOf(getPersistedString(Integer.toString(m_value))); From ad254f1b168af78f5a96b93b250bad4ce885758c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 28 Dec 2014 20:34:54 -0500 Subject: [PATCH 4/4] Android: Fix a typo (Depthn -> Depth) --- Source/Android/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Android/res/values/strings.xml b/Source/Android/res/values/strings.xml index 80e1b3f909..d4b5921c5e 100644 --- a/Source/Android/res/values/strings.xml +++ b/Source/Android/res/values/strings.xml @@ -178,7 +178,7 @@ Stereoscopy allows you to get a better feeling of depth if you have the necessary hardware.\nHeavily decreases emulation speed and sometimes causes issues Stereoscopy Mode Select the stereoscopic 3D mode. - Depthn + Depth Control the distance between the virtual cameras.\nA higher value creates a stronger feeling of depth while a lower value is more comfortable. Convergence Control the distance of the convergence plane, this is the distance at which objects will appear to be in front of the screen.\nA higher value creates stronger out-of-screen effects while a lower value is more comfortable.