Search in sources :

Example 31 with ContextualCard

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);
}
Also used : ContextualCard(com.android.settings.homepage.contextualcards.ContextualCard) RecyclerView(androidx.recyclerview.widget.RecyclerView) Test(org.junit.Test)

Example 32 with ContextualCard

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);
}
Also used : ContextualCard(com.android.settings.homepage.contextualcards.ContextualCard) RecyclerView(androidx.recyclerview.widget.RecyclerView) Test(org.junit.Test)

Example 33 with ContextualCard

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);
}
Also used : Button(android.widget.Button) ContextualCard(com.android.settings.homepage.contextualcards.ContextualCard) RecyclerView(androidx.recyclerview.widget.RecyclerView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) Test(org.junit.Test)

Example 34 with ContextualCard

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));
}
Also used : ContextualCard(com.android.settings.homepage.contextualcards.ContextualCard) Test(org.junit.Test)

Example 35 with ContextualCard

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));
}
Also used : ContextualCard(com.android.settings.homepage.contextualcards.ContextualCard) Test(org.junit.Test)

Aggregations

ContextualCard (com.android.settings.homepage.contextualcards.ContextualCard)35 Test (org.junit.Test)32 RecyclerView (androidx.recyclerview.widget.RecyclerView)21 View (android.view.View)15 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)10 ArrayList (java.util.ArrayList)6 Button (android.widget.Button)4 Cursor (android.database.Cursor)1 Uri (android.net.Uri)1 Suggestion (android.service.settings.suggestions.Suggestion)1 List (java.util.List)1 ExecutionException (java.util.concurrent.ExecutionException)1 Future (java.util.concurrent.Future)1 TimeoutException (java.util.concurrent.TimeoutException)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1