use of com.google.android.setupcompat.template.FooterButton in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class FingerprintSuggestionActivity method initViews.
@Override
protected void initViews() {
super.initViews();
final FooterButton cancelButton = getCancelButton();
cancelButton.setText(this, R.string.security_settings_fingerprint_enroll_introduction_cancel);
}
use of com.google.android.setupcompat.template.FooterButton in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupFingerprintEnrollFinish method initViews.
@Override
protected void initViews() {
super.initViews();
FooterButton nextButton = getNextButton();
nextButton.setText(this, R.string.next_label);
}
use of com.google.android.setupcompat.template.FooterButton in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class FingerprintEnrollFinish method onResume.
@Override
protected void onResume() {
super.onResume();
FooterButton addButton = mFooterBarMixin.getSecondaryButton();
final FingerprintManager fpm = Utils.getFingerprintManagerOrNull(this);
boolean hideAddAnother = false;
if (fpm != null) {
int enrolled = fpm.getEnrolledFingerprints(mUserId).size();
int max = getResources().getInteger(com.android.internal.R.integer.config_fingerprintMaxTemplatesPerUser);
hideAddAnother = enrolled >= max;
}
if (hideAddAnother) {
// Don't show "Add" button if too many fingerprints already added
addButton.setVisibility(View.INVISIBLE);
} else {
addButton.setOnClickListener(this::onAddAnotherButtonClick);
}
}
use of com.google.android.setupcompat.template.FooterButton in project android_packages_apps_Settings by omnirom.
the class FaceEnrollEducation method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.face_enroll_education);
setTitle(R.string.security_settings_face_enroll_education_title);
setDescriptionText(R.string.security_settings_face_enroll_education_message);
mFaceManager = Utils.getFaceManagerOrNull(this);
mIllustrationDefault = findViewById(R.id.illustration_default);
mIllustrationLottie = findViewById(R.id.illustration_lottie);
mIllustrationAccessibility = findViewById(R.id.illustration_accessibility);
mIsUsingLottie = getResources().getBoolean(R.bool.config_face_education_use_lottie);
if (mIsUsingLottie) {
mIllustrationDefault.stop();
mIllustrationDefault.setVisibility(View.INVISIBLE);
mIllustrationLottie.setAnimation(R.raw.face_education_lottie);
mIllustrationLottie.setVisibility(View.VISIBLE);
mIllustrationLottie.playAnimation();
}
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();
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.
mAccessibilityEnabled = 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 (mAccessibilityEnabled) {
accessibilityButton.callOnClick();
}
}
use of com.google.android.setupcompat.template.FooterButton in project android_packages_apps_Settings by omnirom.
the class FingerprintSuggestionActivity method initViews.
@Override
protected void initViews() {
super.initViews();
final FooterButton cancelButton = getCancelButton();
cancelButton.setText(this, R.string.security_settings_fingerprint_enroll_introduction_cancel);
}
Aggregations