Search in sources :

Example 1 with ScrollToParentEditText

use of com.android.settings.widget.ScrollToParentEditText in project Resurrection_packages_apps_Settings by ResurrectionRemix.

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));
}
Also used : PartnerCustomizationLayout(com.google.android.setupcompat.PartnerCustomizationLayout) ScrollToParentEditText(com.android.settings.widget.ScrollToParentEditText) Button(android.widget.Button) SetupChooseLockPasswordFragment(com.android.settings.password.SetupChooseLockPassword.SetupChooseLockPasswordFragment) FooterBarMixin(com.google.android.setupcompat.template.FooterBarMixin) Test(org.junit.Test)

Aggregations

Button (android.widget.Button)1 SetupChooseLockPasswordFragment (com.android.settings.password.SetupChooseLockPassword.SetupChooseLockPasswordFragment)1 ScrollToParentEditText (com.android.settings.widget.ScrollToParentEditText)1 PartnerCustomizationLayout (com.google.android.setupcompat.PartnerCustomizationLayout)1 FooterBarMixin (com.google.android.setupcompat.template.FooterBarMixin)1 Test (org.junit.Test)1