Apply Expressive style "More” page-down button for Settings
Face Enroll Introduction page Flag: EXEMPT use SUW/Settings Expressive style API to check Bug: 394223273 Test: build and manually check the UI and its behaviors Change-Id: Iad9d6a53363fabad05b45a822f8ba6f1b83b9d7b
This commit is contained in:
@@ -155,6 +155,7 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
final boolean isExpressiveStyle = BiometricUtils.isExpressiveStyle(getBaseContext());
|
||||
|
||||
if (shouldShowSplitScreenDialog()) {
|
||||
BiometricsSplitScreenDialog
|
||||
@@ -213,28 +214,33 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
|
||||
mFooterBarMixin = layout.getMixin(FooterBarMixin.class);
|
||||
mFooterBarMixin.setPrimaryButton(getPrimaryFooterButton());
|
||||
mFooterBarMixin.setSecondaryButton(getSecondaryFooterButton(), true /* usePrimaryStyle */);
|
||||
mFooterBarMixin.getSecondaryButton().setVisibility(
|
||||
mHasScrolledToBottom ? View.VISIBLE : View.INVISIBLE);
|
||||
if (!isExpressiveStyle) {
|
||||
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".
|
||||
final int primaryButtonTextRes = scrollNeeded
|
||||
? getMoreButtonTextRes()
|
||||
: getAgreeButtonTextRes();
|
||||
getPrimaryFooterButton().setText(this, primaryButtonTextRes);
|
||||
}
|
||||
if (!isExpressiveStyle) {
|
||||
requireScrollMixin.setOnRequireScrollStateChangedListener(
|
||||
scrollNeeded -> {
|
||||
boolean enrollmentCompleted = checkMaxEnrolled() != 0;
|
||||
if (!enrollmentCompleted) {
|
||||
// Update text of primary button from "More" to "Agree".
|
||||
final int primaryButtonTextRes = scrollNeeded
|
||||
? getMoreButtonTextRes()
|
||||
: getAgreeButtonTextRes();
|
||||
getPrimaryFooterButton().setText(this, primaryButtonTextRes);
|
||||
}
|
||||
|
||||
// Show secondary button once scroll is completed.
|
||||
getSecondaryFooterButton().setVisibility(
|
||||
!scrollNeeded && !enrollmentCompleted ? View.VISIBLE : View.INVISIBLE);
|
||||
mHasScrolledToBottom = !scrollNeeded;
|
||||
});
|
||||
// Show secondary button once scroll is completed.
|
||||
getSecondaryFooterButton().setVisibility(
|
||||
!scrollNeeded && !enrollmentCompleted ? View.VISIBLE
|
||||
: View.INVISIBLE);
|
||||
mHasScrolledToBottom = !scrollNeeded;
|
||||
});
|
||||
}
|
||||
|
||||
final boolean isScrollNeeded = requireScrollMixin.isScrollingRequired();
|
||||
final boolean enrollmentCompleted = checkMaxEnrolled() != 0;
|
||||
|
||||
Reference in New Issue
Block a user