Change to show two footer buttons in SUW lockscreen page.
Bug: 121183851 Test: RunSettingsRoboTests Change-Id: Id850e10a10bb8f3a344ef986e07bab1c39c37aa6
This commit is contained in:
@@ -408,9 +408,9 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
ViewGroup container = view.findViewById(R.id.password_container);
|
||||
container.setOpticalInsets(Insets.NONE);
|
||||
|
||||
mSkipButton = (Button) view.findViewById(R.id.skip_button);
|
||||
mSkipButton = view.findViewById(R.id.skip_button);
|
||||
mSkipButton.setOnClickListener(this);
|
||||
mNextButton = (Button) view.findViewById(R.id.next_button);
|
||||
mNextButton = view.findViewById(R.id.next_button);
|
||||
mNextButton.setOnClickListener(this);
|
||||
mClearButton = view.findViewById(R.id.clear_button);
|
||||
mClearButton.setOnClickListener(this);
|
||||
@@ -894,12 +894,13 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
mPasswordRequirementAdapter.setRequirements(messages);
|
||||
// Enable/Disable the next button accordingly.
|
||||
setNextEnabled(errorCode == NO_ERROR);
|
||||
mClearButton.setVisibility(View.GONE);
|
||||
} else {
|
||||
// Hide password requirement view when we are just asking user to confirm the pw.
|
||||
mPasswordRestrictionView.setVisibility(View.GONE);
|
||||
setHeaderText(getString(mUiStage.getHint(mIsAlphaMode, getStageType())));
|
||||
setNextEnabled(canInput && length >= mPasswordMinLength);
|
||||
mClearButton.setEnabled(canInput && length > 0);
|
||||
mClearButton.setVisibility(toVisibility(canInput && length > 0));
|
||||
}
|
||||
int message = mUiStage.getMessage(mIsAlphaMode, getStageType());
|
||||
if (message != 0) {
|
||||
@@ -909,13 +910,11 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
mMessage.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
mClearButton.setVisibility(toVisibility(mUiStage != Stage.Introduction));
|
||||
|
||||
setNextText(mUiStage.buttonText);
|
||||
mPasswordEntryInputDisabler.setInputEnabled(canInput);
|
||||
}
|
||||
|
||||
private int toVisibility(boolean visibleOrGone) {
|
||||
protected int toVisibility(boolean visibleOrGone) {
|
||||
return visibleOrGone ? View.VISIBLE : View.GONE;
|
||||
}
|
||||
|
||||
|
@@ -135,9 +135,13 @@ public class SetupChooseLockPassword extends ChooseLockPassword {
|
||||
@Override
|
||||
protected void updateUi() {
|
||||
super.updateUi();
|
||||
|
||||
// Show the skip button during SUW but not during Settings > Biometric Enrollment
|
||||
mSkipButton.setVisibility(View.VISIBLE);
|
||||
if (mUiStage == Stage.Introduction) {
|
||||
mSkipButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mSkipButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (mOptionsButton != null) {
|
||||
mOptionsButton.setVisibility(
|
||||
mUiStage == Stage.Introduction ? View.VISIBLE : View.GONE);
|
||||
|
@@ -59,6 +59,7 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
|
||||
|
||||
@Nullable
|
||||
private Button mOptionsButton;
|
||||
private Button mSkipButton;
|
||||
|
||||
@Override
|
||||
public View onCreateView(
|
||||
@@ -71,9 +72,8 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
|
||||
.show(getChildFragmentManager(), null));
|
||||
}
|
||||
// Show the skip button during SUW but not during Settings > Biometric Enrollment
|
||||
Button skipButton = view.findViewById(R.id.skip_button);
|
||||
skipButton.setVisibility(View.VISIBLE);
|
||||
skipButton.setOnClickListener(v -> {
|
||||
mSkipButton = view.findViewById(R.id.skip_button);
|
||||
mSkipButton.setOnClickListener(v -> {
|
||||
SetupSkipDialog dialog = SetupSkipDialog.newInstance(
|
||||
getActivity().getIntent()
|
||||
.getBooleanExtra(SetupSkipDialog.EXTRA_FRP_SUPPORTED, false));
|
||||
@@ -100,6 +100,12 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
|
||||
stage == Stage.ChoiceTooShort || stage == Stage.FirstChoiceValid)
|
||||
? View.VISIBLE : View.INVISIBLE);
|
||||
}
|
||||
|
||||
if (stage.leftMode == LeftButtonMode.Gone && stage == Stage.Introduction) {
|
||||
mSkipButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mSkipButton.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user