Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 017545c6 authored by Joe Bolinger's avatar Joe Bolinger
Browse files

Persist state of no thanks button.

Fix: 207724636
Test: manual (scroll to bottom and rotate device)
Change-Id: I5ef486dc49abd22387b5f6edf67eedaacc9ded4a
parent d3a7ec88
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
    private static final String TAG = "BiometricEnrollIntroduction";

    private static final String KEY_CONFIRMING_CREDENTIALS = "confirming_credentials";
    private static final String KEY_SCROLLED_TO_BOTTOM = "scrolled";

    private UserManager mUserManager;
    private boolean mHasPassword;
@@ -64,6 +65,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
    protected boolean mConfirmingCredentials;
    protected boolean mNextClicked;
    private boolean mParentalConsentRequired;
    private boolean mHasScrolledToBottom = false;

    @Nullable private PorterDuffColorFilter mIconColorFilter;

@@ -152,6 +154,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase

        if (savedInstanceState != null) {
            mConfirmingCredentials = savedInstanceState.getBoolean(KEY_CONFIRMING_CREDENTIALS);
            mHasScrolledToBottom = savedInstanceState.getBoolean(KEY_SCROLLED_TO_BOTTOM);
        }

        Intent intent = getIntent();
@@ -196,14 +199,14 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
        mFooterBarMixin = layout.getMixin(FooterBarMixin.class);
        mFooterBarMixin.setPrimaryButton(getPrimaryFooterButton());
        mFooterBarMixin.setSecondaryButton(getSecondaryFooterButton(), true /* usePrimaryStyle */);
        mFooterBarMixin.getSecondaryButton().setVisibility(View.INVISIBLE);
        mFooterBarMixin.getSecondaryButton().setVisibility(
                mHasScrolledToBottom ? View.VISIBLE : View.INVISIBLE);

        final RequireScrollMixin requireScrollMixin = layout.getMixin(RequireScrollMixin.class);
        requireScrollMixin.requireScrollWithButton(this, getPrimaryFooterButton(),
                getMoreButtonTextRes(), this::onNextButtonClick);
        requireScrollMixin.setOnRequireScrollStateChangedListener(
                scrollNeeded -> {

                    boolean enrollmentCompleted = checkMaxEnrolled() != 0;
                    if (!enrollmentCompleted) {
                        // Update text of primary button from "More" to "Agree".
@@ -216,6 +219,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
                    // Show secondary button once scroll is completed.
                    if (!scrollNeeded) {
                        getSecondaryFooterButton().setVisibility(View.VISIBLE);
                        mHasScrolledToBottom = true;
                    }
                });
    }
@@ -241,6 +245,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putBoolean(KEY_CONFIRMING_CREDENTIALS, mConfirmingCredentials);
        outState.putBoolean(KEY_SCROLLED_TO_BOTTOM, mHasScrolledToBottom);
    }

    @Override