using enc pref
This commit is contained in:
parent
d66ce336ca
commit
10b26be3a8
2 changed files with 1 additions and 20 deletions
|
|
@ -138,25 +138,6 @@ public class SettingsActivity extends AppCompatSettingsThemeActivity implements
|
|||
|
||||
void initPrefs(PreferenceManager pm, PreferenceScreen screen) {
|
||||
final Context context = screen.getContext();
|
||||
ListPreference enc = (ListPreference) pm.findPreference(AudioApplication.PREFERENCE_ENCODING);
|
||||
String v = enc.getValue();
|
||||
CharSequence[] ee = Factory.getEncodingTexts(context);
|
||||
CharSequence[] vv = Factory.getEncodingValues(context);
|
||||
if (ee.length > 1) {
|
||||
enc.setEntries(ee);
|
||||
enc.setEntryValues(vv);
|
||||
|
||||
int i = enc.findIndexOfValue(v);
|
||||
if (i == -1) {
|
||||
enc.setValueIndex(0);
|
||||
} else {
|
||||
enc.setValueIndex(i);
|
||||
}
|
||||
|
||||
bindPreferenceSummaryToValue(enc);
|
||||
} else {
|
||||
screen.removePreference(enc);
|
||||
}
|
||||
|
||||
bindPreferenceSummaryToValue(pm.findPreference(AudioApplication.PREFERENCE_RATE));
|
||||
bindPreferenceSummaryToValue(pm.findPreference(AudioApplication.PREFERENCE_THEME));
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
android:summary="44100"
|
||||
android:title="@string/pref_rate_title" />
|
||||
|
||||
<ListPreference
|
||||
<com.github.axet.audiolibrary.widgets.EncodingsPreferenceCompat
|
||||
android:defaultValue="ogg"
|
||||
android:entries="@array/encodings_text"
|
||||
android:entryValues="@array/encodings_values"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue