use of android.preference.Preference in project androidannotations by androidannotations.
the class PreferenceAnnotationsFragmentTest method testPreferenceChangeHandled.
@Test
public void testPreferenceChangeHandled() {
assertThat(fragment.preferenceWithKeyChanged).isFalse();
Preference preference = fragment.findPreference(fragment.getString(R.string.listPreferenceKey));
preference.getOnPreferenceChangeListener().onPreferenceChange(preference, new Object());
assertThat(fragment.preferenceWithKeyChanged).isTrue();
}
use of android.preference.Preference in project androidannotations by androidannotations.
the class PreferenceEventsHandledActivityTest method testPreferenceChangeCastedParameterPassed.
@Test
public void testPreferenceChangeCastedParameterPassed() {
Preference preference = activity.findPreference(activity.getString(R.string.checkBoxWithCastPrefKey));
preference.getOnPreferenceChangeListener().onPreferenceChange(preference, true);
assertThat(activity.preference).isSameAs(preference);
}
use of android.preference.Preference in project androidannotations by androidannotations.
the class PreferenceEventsHandledActivityTest method testConventionPreferenceChangeHandled.
@Test
public void testConventionPreferenceChangeHandled() {
assertThat(activity.conventionPrefChanged).isFalse();
Preference preference = activity.findPreference(activity.getString(R.string.conventionKey));
preference.getOnPreferenceChangeListener().onPreferenceChange(preference, new Object());
assertThat(activity.conventionPrefChanged).isTrue();
}
use of android.preference.Preference in project androidannotations by androidannotations.
the class PreferenceEventsHandledActivityTest method testPreferenceClickHandled.
@Test
public void testPreferenceClickHandled() {
assertThat(activity.preferenceWithKeyClicked).isFalse();
Preference preference = activity.findPreference(activity.getString(R.string.listPreferenceKey));
preference.getOnPreferenceClickListener().onPreferenceClick(preference);
assertThat(activity.preferenceWithKeyClicked).isTrue();
}
use of android.preference.Preference in project androidannotations by androidannotations.
the class PreferenceEventsHandledActivityTest method testPreferenceClickCastedParameterPassed.
@Test
public void testPreferenceClickCastedParameterPassed() {
Preference preference = activity.findPreference(activity.getString(R.string.checkBoxWithCastPrefKey));
preference.getOnPreferenceClickListener().onPreferenceClick(preference);
assertThat(activity.preference).isSameAs(preference);
}
Aggregations