|
|
@ -18,18 +18,22 @@ public class LabsPreferences extends TodorooPreferenceActivity {
|
|
|
|
|
|
|
|
|
|
|
|
public static final int PERFORMANCE_SETTING_CHANGED = 3;
|
|
|
|
public static final int PERFORMANCE_SETTING_CHANGED = 3;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
private final OnPreferenceChangeListener settingChangedListener = new OnPreferenceChangeListener() {
|
|
|
|
public void updatePreferences(Preference preference, Object value) {
|
|
|
|
|
|
|
|
final Resources r = getResources();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (r.getString(R.string.p_swipe_lists_performance_key).equals(preference.getKey())) {
|
|
|
|
|
|
|
|
preference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean onPreferenceChange(Preference p, Object newValue) {
|
|
|
|
public boolean onPreferenceChange(Preference p, Object newValue) {
|
|
|
|
setResult(PERFORMANCE_SETTING_CHANGED);
|
|
|
|
setResult(PERFORMANCE_SETTING_CHANGED);
|
|
|
|
|
|
|
|
updatePreferences(p, newValue);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void updatePreferences(Preference preference, Object value) {
|
|
|
|
|
|
|
|
final Resources r = getResources();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String key = preference.getKey();
|
|
|
|
|
|
|
|
if (r.getString(R.string.p_swipe_lists_performance_key).equals(key)) {
|
|
|
|
|
|
|
|
preference.setOnPreferenceChangeListener(settingChangedListener);
|
|
|
|
|
|
|
|
|
|
|
|
int index = 0;
|
|
|
|
int index = 0;
|
|
|
|
if(value instanceof String && !TextUtils.isEmpty((String)value))
|
|
|
|
if(value instanceof String && !TextUtils.isEmpty((String)value))
|
|
|
@ -40,6 +44,25 @@ public class LabsPreferences extends TodorooPreferenceActivity {
|
|
|
|
String name = r.getStringArray(R.array.EPr_swipe_lists_performance_mode)[index];
|
|
|
|
String name = r.getStringArray(R.array.EPr_swipe_lists_performance_mode)[index];
|
|
|
|
String desc = r.getStringArray(R.array.EPr_swipe_lists_performance_desc)[index];
|
|
|
|
String desc = r.getStringArray(R.array.EPr_swipe_lists_performance_desc)[index];
|
|
|
|
preference.setSummary(r.getString(R.string.EPr_swipe_lists_display, name, desc));
|
|
|
|
preference.setSummary(r.getString(R.string.EPr_swipe_lists_display, name, desc));
|
|
|
|
|
|
|
|
} else if (r.getString(R.string.p_show_friends_view).equals(key)) {
|
|
|
|
|
|
|
|
preference.setOnPreferenceChangeListener(settingChangedListener);
|
|
|
|
|
|
|
|
if (value != null && (Boolean) value) {
|
|
|
|
|
|
|
|
preference.setSummary(R.string.EPr_show_friends_view_desc_enabled);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
preference.setSummary(R.string.EPr_show_friends_view_desc_disabled);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (r.getString(R.string.p_field_missed_calls).equals(key)) {
|
|
|
|
|
|
|
|
if (value != null && (Boolean) value) {
|
|
|
|
|
|
|
|
preference.setSummary(R.string.MCA_missed_calls_pref_desc_enabled);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
preference.setSummary(R.string.MCA_missed_calls_pref_desc_disabled);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (r.getString(R.string.p_use_contact_picker).equals(key)) {
|
|
|
|
|
|
|
|
if (value != null && (Boolean) value) {
|
|
|
|
|
|
|
|
preference.setSummary(R.string.EPr_use_contact_picker_desc_enabled);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
preference.setSummary(R.string.EPr_use_contact_picker_desc_disabled);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|