Search in sources :

Example 1 with FooterButton

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);
}
Also used : FooterButton(com.google.android.setupcompat.template.FooterButton)

Example 2 with FooterButton

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);
}
Also used : FooterButton(com.google.android.setupcompat.template.FooterButton)

Example 3 with FooterButton

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);
    }
}
Also used : FooterButton(com.google.android.setupcompat.template.FooterButton) FingerprintManager(android.hardware.fingerprint.FingerprintManager)

Example 4 with FooterButton

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();
    }
}
Also used : AccessibilityManager(android.view.accessibility.AccessibilityManager) FooterButton(com.google.android.setupcompat.template.FooterButton) CompoundButton(android.widget.CompoundButton) Button(android.widget.Button) FooterButton(com.google.android.setupcompat.template.FooterButton) FooterBarMixin(com.google.android.setupcompat.template.FooterBarMixin)

Example 5 with FooterButton

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);
}
Also used : FooterButton(com.google.android.setupcompat.template.FooterButton)

Aggregations

FooterButton (com.google.android.setupcompat.template.FooterButton)11 FooterBarMixin (com.google.android.setupcompat.template.FooterBarMixin)3 FingerprintManager (android.hardware.fingerprint.FingerprintManager)2 AccessibilityManager (android.view.accessibility.AccessibilityManager)2 Button (android.widget.Button)2 CompoundButton (android.widget.CompoundButton)2 TextView (android.widget.TextView)2 WifiManager (android.net.wifi.WifiManager)1 Handler (android.os.Handler)1 RequireScrollMixin (com.google.android.setupdesign.template.RequireScrollMixin)1