mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Android: Remove unnecessary context variable in SliderPreference
This commit is contained in:
@ -5,7 +5,6 @@ import android.content.Context;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.DialogPreference;
|
import android.preference.DialogPreference;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
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 static final String androidns = "http://schemas.android.com/apk/res/android";
|
||||||
|
|
||||||
private Context m_context;
|
|
||||||
|
|
||||||
// SeekBar
|
// SeekBar
|
||||||
private int m_max, m_value;
|
private int m_max, m_value;
|
||||||
private SeekBar m_seekbar;
|
private SeekBar m_seekbar;
|
||||||
@ -30,8 +27,7 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek
|
|||||||
|
|
||||||
public SliderPreference(Context context, AttributeSet attrs)
|
public SliderPreference(Context context, AttributeSet attrs)
|
||||||
{
|
{
|
||||||
super(context,attrs);
|
super(context, attrs);
|
||||||
m_context = context;
|
|
||||||
|
|
||||||
// Seekbar values
|
// Seekbar values
|
||||||
m_value = attrs.getAttributeIntValue(androidns, "defaultValue", 0);
|
m_value = attrs.getAttributeIntValue(androidns, "defaultValue", 0);
|
||||||
@ -41,7 +37,7 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek
|
|||||||
@Override
|
@Override
|
||||||
protected View onCreateDialogView()
|
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);
|
LinearLayout layout = (LinearLayout)inflater.inflate(R.layout.slider_layout, null, false);
|
||||||
|
|
||||||
m_seekbar = (SeekBar)layout.getChildAt(0);
|
m_seekbar = (SeekBar)layout.getChildAt(0);
|
||||||
@ -77,8 +73,8 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showDialog(Bundle state) {
|
public void showDialog(Bundle state)
|
||||||
|
{
|
||||||
super.showDialog(state);
|
super.showDialog(state);
|
||||||
|
|
||||||
Button positiveButton = ((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE);
|
Button positiveButton = ((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE);
|
||||||
@ -86,7 +82,8 @@ public class SliderPreference extends DialogPreference implements SeekBar.OnSeek
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v)
|
||||||
|
{
|
||||||
if (shouldPersist())
|
if (shouldPersist())
|
||||||
{
|
{
|
||||||
persistString(Integer.toString(m_seekbar.getProgress()));
|
persistString(Integer.toString(m_seekbar.getProgress()));
|
||||||
|
Reference in New Issue
Block a user