use of com.android.settings.homepage.contextualcards.ContextualCard in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SliceContextualCardRendererTest method bindView_isPendingDismiss_shouldAddViewHolderToSet.
@Test
public void bindView_isPendingDismiss_shouldAddViewHolderToSet() {
final RecyclerView.ViewHolder viewHolder = getSliceViewHolder();
final ContextualCard card = buildContextualCard(TEST_SLICE_URI).mutate().setIsPendingDismiss(true).build();
mRenderer.bindView(viewHolder, card);
assertThat(mRenderer.mFlippedCardSet).contains(viewHolder);
}
use of com.android.settings.homepage.contextualcards.ContextualCard in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SliceContextualCardRendererTest method bindView_deferredSetupCard_shouldNotCrash.
@Test
public void bindView_deferredSetupCard_shouldNotCrash() {
final RecyclerView.ViewHolder viewHolder = getDeferredSetupViewHolder();
final ContextualCard card = buildContextualCard(TEST_SLICE_URI);
mRenderer.mSliceLiveDataMap.put(TEST_SLICE_URI, mSliceLiveData);
mRenderer.bindView(viewHolder, card);
}
use of com.android.settings.homepage.contextualcards.ContextualCard in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class SliceContextualCardRendererTest method viewClick_keepCard_shouldShowSlice.
@Test
public void viewClick_keepCard_shouldShowSlice() {
final RecyclerView.ViewHolder viewHolder = getSliceViewHolder();
final View sliceView = viewHolder.itemView.findViewById(R.id.slice_view);
final View dismissalView = viewHolder.itemView.findViewById(R.id.dismissal_view);
final Button btnKeep = viewHolder.itemView.findViewById(R.id.keep);
final ContextualCard card = buildContextualCard(TEST_SLICE_URI).mutate().setIsPendingDismiss(true).build();
mRenderer.bindView(viewHolder, card);
btnKeep.performClick();
assertThat(dismissalView.getVisibility()).isEqualTo(View.GONE);
assertThat(sliceView.getVisibility()).isEqualTo(View.VISIBLE);
}
use of com.android.settings.homepage.contextualcards.ContextualCard in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DndConditionalCardControllerTest method buildContextualCard_allowSomeSounds_shouldHaveWittExceptionsSummary.
@Test
public void buildContextualCard_allowSomeSounds_shouldHaveWittExceptionsSummary() {
mNotificationManager.setZenModeConfig(getCustomConfig());
final ContextualCard card = mController.buildContextualCard();
assertThat(card.getSummaryText()).isEqualTo(mContext.getString(R.string.condition_zen_summary_with_exceptions));
}
use of com.android.settings.homepage.contextualcards.ContextualCard in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class DndConditionalCardControllerTest method buildContextualCard_allSoundsMuted_shouldHavePhoneMutedSummary.
@Test
public void buildContextualCard_allSoundsMuted_shouldHavePhoneMutedSummary() {
mNotificationManager.setZenModeConfig(getMutedAllConfig());
final ContextualCard card = mController.buildContextualCard();
assertThat(card.getSummaryText()).isEqualTo(mContext.getString(R.string.condition_zen_summary_phone_muted));
}
Aggregations