Search in sources :

Example 1 with RadioButtonPreferenceWithExtraWidget

use of com.android.settings.widget.RadioButtonPreferenceWithExtraWidget in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SystemNavigationGestureSettings method bindPreferenceExtra.

@Override
public void bindPreferenceExtra(RadioButtonPreference pref, String key, CandidateInfo info, String defaultKey, String systemDefaultKey) {
    if (!(info instanceof CandidateInfoExtra) || !(pref instanceof RadioButtonPreferenceWithExtraWidget)) {
        return;
    }
    pref.setSummary(((CandidateInfoExtra) info).loadSummary());
    RadioButtonPreferenceWithExtraWidget p = (RadioButtonPreferenceWithExtraWidget) pref;
    if (info.getKey() == KEY_SYSTEM_NAV_GESTURAL) {
        p.setExtraWidgetVisibility(EXTRA_WIDGET_VISIBILITY_SETTING);
        p.setExtraWidgetOnClickListener((v) -> GestureNavigationBackSensitivityDialog.show(this, getBackSensitivity(getContext(), mOverlayManager), getBackHeight(getContext()), getBackBlockIme(getContext()), getHomeHandleSize(getContext()), getShowNav(getContext()), getImeSpace(getContext()), getHomeHandleHeight(getContext())));
    } else {
        p.setExtraWidgetVisibility(EXTRA_WIDGET_VISIBILITY_GONE);
    }
}
Also used : CandidateInfoExtra(com.android.settings.utils.CandidateInfoExtra) RadioButtonPreferenceWithExtraWidget(com.android.settings.widget.RadioButtonPreferenceWithExtraWidget)

Example 2 with RadioButtonPreferenceWithExtraWidget

use of com.android.settings.widget.RadioButtonPreferenceWithExtraWidget in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SystemNavigationGestureSettings method updateCandidates.

@Override
public void updateCandidates() {
    final String defaultKey = getDefaultKey();
    final String systemDefaultKey = getSystemDefaultKey();
    final PreferenceScreen screen = getPreferenceScreen();
    screen.removeAll();
    screen.addPreference(mVideoPreference);
    final List<? extends CandidateInfo> candidateList = getCandidates();
    if (candidateList == null) {
        return;
    }
    for (CandidateInfo info : candidateList) {
        RadioButtonPreferenceWithExtraWidget pref = new RadioButtonPreferenceWithExtraWidget(getPrefContext());
        bindPreference(pref, info.getKey(), info, defaultKey);
        bindPreferenceExtra(pref, info.getKey(), info, defaultKey, systemDefaultKey);
        screen.addPreference(pref);
    }
    mayCheckOnlyRadioButton();
}
Also used : PreferenceScreen(androidx.preference.PreferenceScreen) CandidateInfo(com.android.settingslib.widget.CandidateInfo) RadioButtonPreferenceWithExtraWidget(com.android.settings.widget.RadioButtonPreferenceWithExtraWidget)

Aggregations

RadioButtonPreferenceWithExtraWidget (com.android.settings.widget.RadioButtonPreferenceWithExtraWidget)2 PreferenceScreen (androidx.preference.PreferenceScreen)1 CandidateInfoExtra (com.android.settings.utils.CandidateInfoExtra)1 CandidateInfo (com.android.settingslib.widget.CandidateInfo)1