Search in sources :

Example 1 with ChooseLockPatternFragment

use of com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment in project android_packages_apps_Settings by omnirom.

the class ChooseLockPatternTest method assertThat_chooseLockIconChanged_WhenFingerprintExtraSet.

@Test
public void assertThat_chooseLockIconChanged_WhenFingerprintExtraSet() {
    ChooseLockPattern activity = createActivity(true);
    ChooseLockPatternFragment fragment = (ChooseLockPatternFragment) activity.getFragmentManager().findFragmentById(R.id.main_content);
    ShadowDrawable drawable = Shadows.shadowOf(((GlifLayout) fragment.getView()).getIcon());
    assertThat(drawable.getCreatedFromResId()).isEqualTo(R.drawable.ic_fingerprint_header);
}
Also used : ChooseLockPatternFragment(com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment) ShadowDrawable(org.robolectric.shadows.ShadowDrawable) Test(org.junit.Test)

Example 2 with ChooseLockPatternFragment

use of com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment in project android_packages_apps_Settings by crdroidandroid.

the class ChooseLockPatternTest method assertThat_chooseLockIconChanged_WhenFingerprintExtraSet.

@Test
public void assertThat_chooseLockIconChanged_WhenFingerprintExtraSet() {
    ChooseLockPattern activity = createActivity(true);
    ChooseLockPatternFragment fragment = (ChooseLockPatternFragment) activity.getFragmentManager().findFragmentById(R.id.main_content);
    ShadowDrawable drawable = Shadows.shadowOf(((GlifLayout) fragment.getView()).getIcon());
    assertThat(drawable.getCreatedFromResId()).isEqualTo(R.drawable.ic_fingerprint_header);
}
Also used : ChooseLockPatternFragment(com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment) ShadowDrawable(org.robolectric.shadows.ShadowDrawable) Test(org.junit.Test)

Example 3 with ChooseLockPatternFragment

use of com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment in project Resurrection_packages_apps_Settings by ResurrectionRemix.

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

Example 4 with ChooseLockPatternFragment

use of com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ChooseLockPatternTest method smallScreens_shouldHideIcon.

@Config(qualifiers = "sw300dp")
@Test
public void smallScreens_shouldHideIcon() {
    ChooseLockPattern activity = createActivity(true);
    ChooseLockPatternFragment fragment = (ChooseLockPatternFragment) activity.getSupportFragmentManager().findFragmentById(R.id.main_content);
    View iconView = fragment.getView().findViewById(R.id.sud_layout_icon);
    assertThat(iconView.getVisibility()).isEqualTo(View.GONE);
}
Also used : ChooseLockPatternFragment(com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment) View(android.view.View) Test(org.junit.Test) Config(org.robolectric.annotation.Config)

Example 5 with ChooseLockPatternFragment

use of com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment in project android_packages_apps_Settings by LineageOS.

the class ChooseLockPatternTest method assertThat_chooseLockIconChanged_WhenFingerprintExtraSet.

@Test
public void assertThat_chooseLockIconChanged_WhenFingerprintExtraSet() {
    ChooseLockPattern activity = createActivity(true);
    ChooseLockPatternFragment fragment = (ChooseLockPatternFragment) activity.getFragmentManager().findFragmentById(R.id.main_content);
    ShadowDrawable drawable = Shadows.shadowOf(((GlifLayout) fragment.getView()).getIcon());
    assertThat(drawable.getCreatedFromResId()).isEqualTo(R.drawable.ic_fingerprint_header);
}
Also used : ChooseLockPatternFragment(com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment) ShadowDrawable(org.robolectric.shadows.ShadowDrawable) Test(org.junit.Test)

Aggregations

ChooseLockPatternFragment (com.android.settings.password.ChooseLockPattern.ChooseLockPatternFragment)9 Test (org.junit.Test)9 ShadowDrawable (org.robolectric.shadows.ShadowDrawable)6 Config (org.robolectric.annotation.Config)2 View (android.view.View)1 Button (android.widget.Button)1 PartnerCustomizationLayout (com.google.android.setupcompat.PartnerCustomizationLayout)1 FooterBarMixin (com.google.android.setupcompat.template.FooterBarMixin)1