use of cx.ring.model.ConfigKey in project ring-client-android by savoirfairelinux.
the class AdvancedAccountFragment method initView.
@Override
public void initView(AccountConfig config, ArrayList<CharSequence> networkInterfaces) {
for (ConfigKey confKey : config.getKeys()) {
Preference pref = findPreference(confKey.key());
if (pref != null) {
pref.setOnPreferenceChangeListener(this);
if (confKey == ConfigKey.LOCAL_INTERFACE) {
String val = config.get(confKey);
CharSequence[] display = networkInterfaces.toArray(new CharSequence[networkInterfaces.size()]);
ListPreference listPref = (ListPreference) pref;
listPref.setEntries(display);
listPref.setEntryValues(display);
listPref.setSummary(val);
listPref.setValue(val);
} else if (!confKey.isTwoState()) {
String val = config.get(confKey);
pref.setSummary(val);
if (pref instanceof EditTextPreference) {
((EditTextPreference) pref).setText(val);
}
} else {
((TwoStatePreference) pref).setChecked(config.getBool(confKey));
}
}
}
}
Aggregations