Convert default action preference to use integer strings

Might as well break some more preferences while we're at it
This commit is contained in:
Christopher Eby 2010-04-02 11:00:09 -05:00
parent b275d5a1b9
commit 6c58ca2d82
2 changed files with 5 additions and 13 deletions

View File

@ -41,12 +41,12 @@
android:summary="@string/filter_suggestions_summary"
android:defaultValue="false" />
<ListPreference
android:key="default_action"
android:key="default_action_int"
android:title="@string/default_action_title"
android:summary="@string/default_action_summary"
android:entries="@array/default_action_entries"
android:entryValues="@array/default_action_entries"
android:defaultValue="Play" />
android:entryValues="@array/entry_values"
android:defaultValue="0" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/pref_misc">
<CheckBoxPreference

View File

@ -101,7 +101,7 @@ public class SongSelector extends Dialog implements AdapterView.OnItemClickListe
mLimiterViews = (ViewGroup)findViewById(R.id.limiter_layout);
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
int inputType;
if (settings.getBoolean("phone_input", false))
inputType = InputType.TYPE_CLASS_PHONE;
@ -111,15 +111,7 @@ public class SongSelector extends Dialog implements AdapterView.OnItemClickListe
inputType = InputType.TYPE_CLASS_TEXT;
mTextFilter.setInputType(inputType);
String action = settings.getString("default_action", "Play");
if (action.equals("Last Used Action")) {
mDefaultIsLastAction = true;
mDefaultAction = PlaybackService.ACTION_PLAY;
} else if (action.equals("Enqueue")) {
mDefaultAction = PlaybackService.ACTION_ENQUEUE;
} else {
mDefaultAction = PlaybackService.ACTION_PLAY;
}
mDefaultAction = Integer.parseInt(settings.getString("default_action_int", "0"));
new Handler().post(new Runnable() {
public void run()