use of com.android.settingslib.drawer.Tile in project android_packages_apps_Settings by LineageOS.
the class SuggestionsChecksTest method testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintAdded.
@Test
public void testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintAdded() {
stubFingerprintSupported(true);
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(true);
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
Tile tile = createFingerprintTile();
assertThat(mSuggestionsChecks.isSuggestionComplete(tile)).isTrue();
}
use of com.android.settingslib.drawer.Tile in project android_packages_apps_Settings by LineageOS.
the class SuggestionsChecksTest method testFingerprintEnrollmentIntroductionIsCompleteWhenHardwareNotDetected.
@Test
public void testFingerprintEnrollmentIntroductionIsCompleteWhenHardwareNotDetected() {
stubFingerprintSupported(true);
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(false);
when(mFingerprintManager.isHardwareDetected()).thenReturn(false);
Tile tile = createFingerprintTile();
assertThat(mSuggestionsChecks.isSuggestionComplete(tile)).isTrue();
}
use of com.android.settingslib.drawer.Tile in project android_packages_apps_Settings by omnirom.
the class DashboardFragmentTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
FakeFeatureFactory.setupForTest(mContext);
mFakeFeatureFactory = (FakeFeatureFactory) FeatureFactory.getFactory(mContext);
mDashboardCategory.tiles = new ArrayList<>();
mDashboardCategory.tiles.add(new Tile());
mTestFragment = new TestFragment(ShadowApplication.getInstance().getApplicationContext());
when(mFakeFeatureFactory.dashboardFeatureProvider.getProgressiveDisclosureMixin(nullable(Context.class), eq(mTestFragment), nullable(Bundle.class))).thenReturn(mDisclosureMixin);
when(mFakeFeatureFactory.dashboardFeatureProvider.getTilesForCategory(nullable(String.class))).thenReturn(mDashboardCategory);
mTestFragment.onAttach(ShadowApplication.getInstance().getApplicationContext());
when(mContext.getPackageName()).thenReturn("TestPackage");
}
use of com.android.settingslib.drawer.Tile in project android_packages_apps_Settings by omnirom.
the class DashboardFragmentTest method tintTileIcon_hasMetadata_shouldReturnIconTintableMetadata.
@Test
public void tintTileIcon_hasMetadata_shouldReturnIconTintableMetadata() {
final Tile tile = new Tile();
tile.icon = mock(Icon.class);
final Bundle metaData = new Bundle();
tile.metaData = metaData;
metaData.putBoolean(TileUtils.META_DATA_PREFERENCE_ICON_TINTABLE, false);
assertThat(mTestFragment.tintTileIcon(tile)).isFalse();
metaData.putBoolean(TileUtils.META_DATA_PREFERENCE_ICON_TINTABLE, true);
assertThat(mTestFragment.tintTileIcon(tile)).isTrue();
}
use of com.android.settingslib.drawer.Tile in project android_packages_apps_Settings by omnirom.
the class DashboardItemAnimatorTest method SetUp.
@Before
public void SetUp() {
final Context context = ShadowApplication.getInstance().getApplicationContext();
mDashboardItemAnimator = new DashboardItemAnimator();
mViewHolder = new ViewHolder(new TextView(context));
mViewHolder.itemView.setTag(new Tile());
}
Aggregations