use of android.preference.Preference in project xabber-android by redsolution.
the class BaseSettingsFragment method setPreferences.
/**
* Set values to the UI elements.
*
* @param source
*/
protected void setPreferences(Map<String, Object> source) {
PreferenceScreen preferenceScreen = getPreferenceScreen();
for (int index = 0; index < preferenceScreen.getPreferenceCount(); index++) {
Preference preference = preferenceScreen.getPreference(index);
Object value = source.get(preference.getKey());
setPreference(preference, value);
}
}
use of android.preference.Preference in project robolectric by robolectric.
the class ShadowPreferenceActivityTestWithFragment method preferenceAddedWithCorrectDetails.
@Test
public void preferenceAddedWithCorrectDetails() {
Preference preference = fragment.findPreference("edit_text");
assertThat(preference).isNotNull();
assertThat(preference.getTitle()).isEqualTo("EditText Test");
assertThat(preference.getSummary()).isEqualTo("");
}
use of android.preference.Preference in project Conversations by siacs.
the class SettingsFragment method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);
// Remove from standard preferences if the flag ONLY_INTERNAL_STORAGE is not true
if (!Config.ONLY_INTERNAL_STORAGE) {
PreferenceCategory mCategory = (PreferenceCategory) findPreference("security_options");
Preference mPref1 = findPreference("clean_cache");
Preference mPref2 = findPreference("clean_private_storage");
mCategory.removePreference(mPref1);
mCategory.removePreference(mPref2);
}
}
use of android.preference.Preference in project androidannotations by androidannotations.
the class PreferenceEventsHandledActivityTest method testConventionPreferenceClickHandled.
@Test
public void testConventionPreferenceClickHandled() {
assertThat(activity.conventionPrefClicked).isFalse();
Preference preference = activity.findPreference(activity.getString(R.string.conventionKey));
preference.getOnPreferenceClickListener().onPreferenceClick(preference);
assertThat(activity.conventionPrefClicked).isTrue();
}
use of android.preference.Preference in project androidannotations by androidannotations.
the class PreferenceEventsHandledActivityTest method testPreferenceChangeParsedParameterPassed.
@Test
public void testPreferenceChangeParsedParameterPassed() {
Preference preference = activity.findPreference(activity.getString(R.string.editTextPrefKey));
preference.getOnPreferenceChangeListener().onPreferenceChange(preference, "2");
assertThat(activity.editTextPreference).isSameAs(preference);
assertThat(activity.preferenceChangedParsedValue).isEqualTo(2);
}
Aggregations