use of com.google.android.setupcompat.template.FooterButton in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class FaceEnrollEducation method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.face_enroll_education);
getLayout().setHeaderText(R.string.security_settings_face_enroll_education_title);
setTitle(R.string.security_settings_face_enroll_education_title);
mHandler = new Handler();
mFaceManager = Utils.getFaceManagerOrNull(this);
mIllustrationNormal = findViewById(R.id.illustration_normal);
mIllustrationAccessibility = findViewById(R.id.illustration_accessibility);
mDescriptionText = findViewById(R.id.sud_layout_description);
mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
if (WizardManagerHelper.isAnySetupWizard(getIntent())) {
mFooterBarMixin.setSecondaryButton(new FooterButton.Builder(this).setText(R.string.skip_label).setListener(this::onSkipButtonClick).setButtonType(FooterButton.ButtonType.SKIP).setTheme(R.style.SudGlifButton_Secondary).build());
} else {
mFooterBarMixin.setSecondaryButton(new FooterButton.Builder(this).setText(R.string.security_settings_face_enroll_introduction_cancel).setListener(this::onSkipButtonClick).setButtonType(FooterButton.ButtonType.CANCEL).setTheme(R.style.SudGlifButton_Secondary).build());
}
final FooterButton footerButton = new FooterButton.Builder(this).setText(R.string.security_settings_face_enroll_education_start).setListener(this::onNextButtonClick).setButtonType(FooterButton.ButtonType.NEXT).setTheme(R.style.SudGlifButton_Primary).build();
boolean accessibilityEnabled = false;
final AccessibilityManager accessibilityManager = getApplicationContext().getSystemService(AccessibilityManager.class);
if (accessibilityManager != null) {
// Add additional check for touch exploration. This prevents other accessibility
// features such as Live Transcribe from defaulting to the accessibility setup.
accessibilityEnabled = accessibilityManager.isEnabled() && accessibilityManager.isTouchExplorationEnabled();
}
mFooterBarMixin.setPrimaryButton(footerButton);
final Button accessibilityButton = findViewById(R.id.accessibility_button);
accessibilityButton.setOnClickListener(view -> {
mSwitchDiversity.setChecked(true);
accessibilityButton.setVisibility(View.GONE);
mSwitchDiversity.setVisibility(View.VISIBLE);
});
mSwitchDiversity = findViewById(R.id.toggle_diversity);
mSwitchDiversity.setListener(mSwitchDiversityListener);
mSwitchDiversity.setOnClickListener(v -> {
mSwitchDiversity.getSwitch().toggle();
});
if (accessibilityEnabled) {
accessibilityButton.callOnClick();
}
}
Aggregations