Disable filter suggestions by default and a preference to enable them
This commit is contained in:
parent
2dee7b190c
commit
32fd8ea975
@ -33,6 +33,9 @@
|
|||||||
<string name="phone_input_title">Use Phone Dialer Input</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="phone_input_summary">Enter filter text using buttons 1-9, where 1 matches 1, a, b or c, etc</string>
|
||||||
|
|
||||||
|
<string name="filter_suggestions_title">Use Suggestions in Filter Text</string>
|
||||||
|
<string name="filter_suggestions_summary">Use text suggestions when editing the filter text</string>
|
||||||
|
|
||||||
<string name="scrobble_title">Use ScrobbleDroid API</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>
|
<string name="scrobble_summary">Send song info to Last.FM scrobblers such as ScrobbleDroid and Simple Last.FM Scrobbler</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -33,6 +33,11 @@
|
|||||||
android:title="@string/phone_input_title"
|
android:title="@string/phone_input_title"
|
||||||
android:summary="@string/phone_input_summary"
|
android:summary="@string/phone_input_summary"
|
||||||
android:defaultValue="false" />
|
android:defaultValue="false" />
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="filter_suggestions"
|
||||||
|
android:title="@string/filter_suggestions_title"
|
||||||
|
android:summary="@string/filter_suggestions_summary"
|
||||||
|
android:defaultValue="false" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/pref_misc">
|
<PreferenceCategory android:title="@string/pref_misc">
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
|
@ -55,10 +55,14 @@ public class SongSelector extends Activity implements AdapterView.OnItemClickLis
|
|||||||
mTextView = (TextView)findViewById(R.id.filter_text);
|
mTextView = (TextView)findViewById(R.id.filter_text);
|
||||||
mTextView.addTextChangedListener(this);
|
mTextView.addTextChangedListener(this);
|
||||||
|
|
||||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
boolean phoneInput = settings.getBoolean("phone_input", false);
|
int inputType;
|
||||||
int inputType = phoneInput ? InputType.TYPE_CLASS_PHONE
|
if (settings.getBoolean("phone_input", false))
|
||||||
: InputType.TYPE_CLASS_TEXT;
|
inputType = InputType.TYPE_CLASS_PHONE;
|
||||||
|
else if (!settings.getBoolean("filter_suggestions", false))
|
||||||
|
inputType = InputType.TYPE_TEXT_VARIATION_FILTER;
|
||||||
|
else
|
||||||
|
inputType = InputType.TYPE_CLASS_TEXT;
|
||||||
mTextView.setInputType(inputType);
|
mTextView.setInputType(inputType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user