use of android.support.v7.preference.TwoStatePreference in project apps-android-wikipedia by wikimedia.
the class DeveloperSettingsPreferenceLoader method setUseRestBasePreference.
private void setUseRestBasePreference(boolean manualMode) {
RbSwitch.INSTANCE.update();
TwoStatePreference useRestBasePref = getUseRestBasePreference();
useRestBasePref.setEnabled(manualMode);
useRestBasePref.setChecked(RbSwitch.INSTANCE.isRestBaseEnabled());
}
use of android.support.v7.preference.TwoStatePreference in project apps-android-wikipedia by wikimedia.
the class DeveloperSettingsPreferenceLoader method setUpMediaWikiSettings.
private void setUpMediaWikiSettings() {
Preference uriPreference = findPreference(context.getString(R.string.preference_key_mediawiki_base_uri));
uriPreference.setOnPreferenceChangeListener(setMediaWikiBaseUriChangeListener);
TwoStatePreference multiLangPreference = (TwoStatePreference) findPreference(context.getString(R.string.preference_key_mediawiki_base_uri_supports_lang_code));
multiLangPreference.setOnPreferenceChangeListener(setMediaWikiMultiLangSupportChangeListener);
}
use of android.support.v7.preference.TwoStatePreference in project apps-android-wikipedia by wikimedia.
the class DeveloperSettingsPreferenceLoader method setUpRestBaseCheckboxes.
private void setUpRestBaseCheckboxes() {
TwoStatePreference manualPreference = (TwoStatePreference) findPreference(getManualKey());
manualPreference.setOnPreferenceChangeListener(setRestBaseManuallyChangeListener);
setUseRestBasePreference(manualPreference.isChecked());
}
use of android.support.v7.preference.TwoStatePreference in project android_packages_apps_Settings by SudaMod.
the class AssistFlashScreenPreferenceController method updatePreference.
private void updatePreference() {
if (mPreference == null || !(mPreference instanceof TwoStatePreference)) {
return;
}
if (isAvailable()) {
if (mScreen.findPreference(getPreferenceKey()) == null) {
// add it if it's not on scree
mScreen.addPreference(mPreference);
}
} else {
mScreen.removePreference(mPreference);
}
ComponentName assistant = getCurrentAssist();
boolean isContextChecked = AssistContextPreferenceController.isChecked(mContext);
mPreference.setEnabled(isContextChecked && isPreInstalledAssistant(assistant));
((TwoStatePreference) mPreference).setChecked(willShowFlash(assistant));
}
use of android.support.v7.preference.TwoStatePreference in project android_packages_apps_Settings by SudaMod.
the class GesturePreferenceControllerTest method updateState_preferenceSetUncheckedWhenSettingIsOff.
@Test
public void updateState_preferenceSetUncheckedWhenSettingIsOff() {
// Mock a TwoStatePreference
final TwoStatePreference preference = mock(TwoStatePreference.class);
// Set the setting to be disabled.
mController.mIsPrefEnabled = false;
// Run through updateState
mController.updateState(preference);
// Verify pref is unchecked (as setting is disabled).
verify(preference).setChecked(false);
}
Aggregations