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

This commit is contained in:
android-build-team Robot
2018-05-09 19:09:08 +00:00
committed by Android (Google) Code Review
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() {