use of com.google.android.setupcompat.PartnerCustomizationLayout in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SetupChooseLockPasswordAppTest method testSkipDialogIsShown.
@Test
public void testSkipDialogIsShown() throws Throwable {
SetupChooseLockPassword activity = mActivityTestRule.launchActivity(null);
PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
final Button skipOrClearButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
assertThat(skipOrClearButton.getText()).isEqualTo(mContext.getString(R.string.skip_label));
assertThat(skipOrClearButton.getVisibility()).isEqualTo(View.VISIBLE);
skipOrClearButton.performClick();
assertThat(activity.isFinishing()).named("Is finishing").isTrue();
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project android_packages_apps_Settings by omnirom.
the class SetupFingerprintEnrollIntroductionTest method testKeyguardSecure_shouldFinishWithFingerprintResultSkip.
@Test
public void testKeyguardSecure_shouldFinishWithFingerprintResultSkip() {
getShadowKeyguardManager().setIsKeyguardSecure(true);
mController.create().resume();
PartnerCustomizationLayout layout = mController.get().findViewById(R.id.setup_wizard_layout);
final Button skipButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
assertWithMessage("Skip visible").that(skipButton.getVisibility()).isEqualTo(View.VISIBLE);
skipButton.performClick();
ShadowActivity shadowActivity = Shadows.shadowOf(mController.get());
assertWithMessage("Is finishing").that(mController.get().isFinishing()).isTrue();
assertWithMessage("Result code").that(shadowActivity.getResultCode()).isEqualTo(BiometricEnrollBase.RESULT_SKIP);
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project android_packages_apps_Settings by omnirom.
the class SetupChooseLockPasswordAppTest method clearIsShown_when_somethingEnteredToConfirm.
@Test
public void clearIsShown_when_somethingEnteredToConfirm() {
SetupChooseLockPassword activity = mActivityTestRule.launchActivity(null);
PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
onView(withId(R.id.password_entry)).perform(ViewActions.typeText("1234")).perform(pressKey(KeyEvent.KEYCODE_ENTER));
mActivityTestRule.launchActivity(null);
onView(withId(R.id.password_entry)).perform(ViewActions.typeText("1234")).perform(pressKey(KeyEvent.KEYCODE_ENTER)).perform(ViewActions.typeText("1"));
// clear should be present if text field contains content
assertThat(layout.getMixin(FooterBarMixin.class).getSecondaryButtonView().getVisibility()).isEqualTo(View.VISIBLE);
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project android_packages_apps_Settings by omnirom.
the class SetupChooseLockPatternTest method createActivity_enterPattern_clearButtonShouldBeShown.
@Test
public void createActivity_enterPattern_clearButtonShouldBeShown() {
ChooseLockPatternFragment fragment = findFragment(mActivity);
PartnerCustomizationLayout layout = mActivity.findViewById(R.id.setup_wizard_layout);
final Button skipOrClearButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
assertThat(skipOrClearButton.isEnabled()).isTrue();
assertThat(skipOrClearButton.getVisibility()).isEqualTo(View.VISIBLE);
assertThat(skipOrClearButton.getText()).isEqualTo(application.getString(R.string.skip_label));
enterPattern();
assertThat(skipOrClearButton.isEnabled()).isTrue();
assertThat(skipOrClearButton.getVisibility()).isEqualTo(View.VISIBLE);
assertThat(skipOrClearButton.getText()).isEqualTo(application.getString(R.string.lockpattern_retry_button_text));
}
use of com.google.android.setupcompat.PartnerCustomizationLayout in project android_packages_apps_Settings by omnirom.
the class SetupChooseLockPasswordTest method createActivity_inputPasswordInConfirmStage_clearButtonShouldBeShown.
@Test
public void createActivity_inputPasswordInConfirmStage_clearButtonShouldBeShown() {
SetupChooseLockPassword activity = createSetupChooseLockPassword();
SetupChooseLockPasswordFragment fragment = (SetupChooseLockPasswordFragment) activity.getSupportFragmentManager().findFragmentById(R.id.main_content);
ScrollToParentEditText passwordEntry = activity.findViewById(R.id.password_entry);
passwordEntry.setText("");
fragment.updateStage(Stage.NeedToConfirm);
final PartnerCustomizationLayout layout = activity.findViewById(R.id.setup_wizard_layout);
final Button skipOrClearButton = layout.getMixin(FooterBarMixin.class).getSecondaryButtonView();
assertThat(skipOrClearButton.isEnabled()).isTrue();
assertThat(skipOrClearButton.getVisibility()).isEqualTo(View.GONE);
passwordEntry.setText("1234");
fragment.updateUi();
assertThat(skipOrClearButton.getVisibility()).isEqualTo(View.VISIBLE);
assertThat(skipOrClearButton.getText()).isEqualTo(application.getString(R.string.lockpassword_clear_label));
}
Aggregations