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);
}
}
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();
}
Aggregations