Show Option of "Screen lock options" on SUW pattern screen page

Add more check for stages of Patern input. Make sure that button "Screen lock options" is visiable.

Test: atest SetupChooseLockPatternTest
Bug: 76431549
Change-Id: Iec7d0eb4a3c16ebd2a504fbbc6de465c341ca43a
This commit is contained in:
pastychang
2018-05-04 11:01:24 +08:00
parent 07ec1d47df
commit aea3e0b205
2 changed files with 7 additions and 2 deletions

View File

@@ -97,7 +97,9 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
if (!getResources().getBoolean(R.bool.config_lock_pattern_minimal_ui)
&& mOptionsButton != null) {
mOptionsButton.setVisibility(
stage == Stage.Introduction ? View.VISIBLE : View.INVISIBLE);
(stage == Stage.Introduction || stage == Stage.HelpScreen ||
stage == Stage.ChoiceTooShort || stage == Stage.FirstChoiceValid)
? View.VISIBLE : View.INVISIBLE);
}
}

View File

@@ -92,13 +92,16 @@ public class SetupChooseLockPatternTest {
}
@Test
public void selectPattern_shouldHideOptionsButton() {
public void optionsButton_whenPatternSelected_shouldBeVisible() {
Button button = mActivity.findViewById(R.id.screen_lock_options);
assertThat(button).isNotNull();
assertThat(button.getVisibility()).isEqualTo(View.VISIBLE);
LockPatternView lockPatternView = mActivity.findViewById(R.id.lockPattern);
ReflectionHelpers.callInstanceMethod(lockPatternView, "notifyPatternDetected");
enterPattern();
assertThat(button.getVisibility()).isEqualTo(View.VISIBLE);
}
private void verifyScreenLockOptionsShown() {