Restore the option to use a phone dialpad
This commit is contained in:
parent
ce1df6f732
commit
2dee7b190c
@ -3,7 +3,6 @@
|
||||
<string name="app_name">Vanilla Music</string>
|
||||
|
||||
<string name="enqueued">Enqueued %s</string>
|
||||
<string name="filter">Filter:</string>
|
||||
<string name="no_songs">No songs found on your device.</string>
|
||||
<string name="settings">Preferences</string>
|
||||
<string name="add_to_queue">Add to Queue</string>
|
||||
@ -15,6 +14,7 @@
|
||||
|
||||
<string name="pref_output">Audio Output</string>
|
||||
<string name="pref_notifications">Notifications</string>
|
||||
<string name="pref_song_selector">Song Selector</string>
|
||||
<string name="pref_misc">Miscellaneous Features</string>
|
||||
|
||||
<string name="headset_only_title">External Output Only</string>
|
||||
@ -30,6 +30,9 @@
|
||||
<string name="notify_while_paused_title">Persistent Notification</string>
|
||||
<string name="notify_while_paused_summary">Always display the notification</string>
|
||||
|
||||
<string name="phone_input_title">Use Phone Dialer Input</string>
|
||||
<string name="phone_input_summary">Enter filter text using buttons 1-9, where 1 matches 1, a, b or c, etc</string>
|
||||
|
||||
<string name="scrobble_title">Use ScrobbleDroid API</string>
|
||||
<string name="scrobble_summary">Send song info to Last.FM scrobblers such as ScrobbleDroid and Simple Last.FM Scrobbler</string>
|
||||
</resources>
|
||||
|
@ -27,6 +27,13 @@
|
||||
android:defaultValue="true"
|
||||
android:summary="@string/notify_while_paused_summary" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/pref_song_selector">
|
||||
<CheckBoxPreference
|
||||
android:key="phone_input"
|
||||
android:title="@string/phone_input_title"
|
||||
android:summary="@string/phone_input_summary"
|
||||
android:defaultValue="false" />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/pref_misc">
|
||||
<CheckBoxPreference
|
||||
android:key="scrobble"
|
||||
|
@ -115,7 +115,7 @@ public class SongAdapter extends BaseAdapter implements Filterable {
|
||||
return mFilter;
|
||||
}
|
||||
|
||||
private static final String[] mRanges = { "[01 ]", "[2abc]", "[3def]", "[4ghi]", "[5jkl]", "[6mno]", "[7pqrs]", "[8tuv]", "[9wxyz]"};
|
||||
private static final String[] mRanges = { "[2abc]", "[3def]", "[4ghi]", "[5jkl]", "[6mno]", "[7pqrs]", "[8tuv]", "[9wxyz]"};
|
||||
private class ArrayFilter extends Filter {
|
||||
@Override
|
||||
protected FilterResults performFiltering(CharSequence filter)
|
||||
@ -138,8 +138,8 @@ public class SongAdapter extends BaseAdapter implements Filterable {
|
||||
String patternString = "";
|
||||
for (int i = 0, end = filter.length(); i != end; ++i) {
|
||||
char c = filter.charAt(i);
|
||||
int value = c - '1';
|
||||
if (value >= 0 && value < 9)
|
||||
int value = c - '2';
|
||||
if (value >= 0 && value < 8)
|
||||
patternString += mRanges[value];
|
||||
else
|
||||
patternString += c;
|
||||
|
@ -22,8 +22,11 @@ import org.kreed.vanilla.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
@ -51,6 +54,12 @@ public class SongSelector extends Activity implements AdapterView.OnItemClickLis
|
||||
|
||||
mTextView = (TextView)findViewById(R.id.filter_text);
|
||||
mTextView.addTextChangedListener(this);
|
||||
|
||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
boolean phoneInput = settings.getBoolean("phone_input", false);
|
||||
int inputType = phoneInput ? InputType.TYPE_CLASS_PHONE
|
||||
: InputType.TYPE_CLASS_TEXT;
|
||||
mTextView.setInputType(inputType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user