use of android.preference.Preference in project simplefacebook by androidquery.
the class SettingsActivity method initView.
private void initView() {
Preference p = findPreference("logout");
p.setOnPreferenceClickListener(this);
p = findPreference("share");
p.setOnPreferenceClickListener(this);
p.setTitle(p.getTitle() + " @Facebook");
p = findPreference("share_others");
p.setOnPreferenceClickListener(this);
p = findPreference("review");
p.setOnPreferenceClickListener(this);
p = findPreference("report");
p.setOnPreferenceClickListener(this);
p = findPreference("version");
String version = getVersion();
p.setSummary(version);
p = findPreference("feedback");
p.setOnPreferenceClickListener(this);
}
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();
}
Aggregations