Home
last modified time | relevance | path

Searched refs:ContextualCard (Results 1 – 25 of 68) sorted by relevance

123

/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/
DContextualCardManagerTest.java130 .map(ContextualCard::getName) in constructor_hasSavedInstanceState_shouldContainExpectedSavedCards()
149 final List<Integer> expected = Arrays.asList(ContextualCard.CardType.CONDITIONAL, in constructor_hasSettingsCustomCards_shouldSetUpCustomControllers()
150 ContextualCard.CardType.LEGACY_SUGGESTION); in constructor_hasSettingsCustomCards_shouldSetUpCustomControllers()
178 final int[] expected = {ContextualCard.CardType.CONDITIONAL, in getSettingsCards_conditionalsEnabled_shouldContainLegacyAndConditionals()
179 ContextualCard.CardType.LEGACY_SUGGESTION}; in getSettingsCards_conditionalsEnabled_shouldContainLegacyAndConditionals()
189 final int[] expected = {ContextualCard.CardType.LEGACY_SUGGESTION}; in getSettingsCards_conditionalsDisabled_shouldContainLegacy()
201 mManager.setupController(ContextualCard.CardType.SLICE); in setupController_notLifecycleObserverInstance_shouldNotAttachToLifecycle()
209 final List<ContextualCard> cards = new ArrayList<>(); in sortCards_shouldBeDescendingOrder()
210 final ContextualCard card1 = in sortCards_shouldBeDescendingOrder()
212 final ContextualCard card2 = in sortCards_shouldBeDescendingOrder()
[all …]
DContextualCardLoaderTest.java20 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.STICKY_…
75 final List<ContextualCard> cards = getContextualCardList().stream().limit(2) in getDisplayableCards_twoEligibleCards_shouldShowAll()
79 final List<ContextualCard> result = mContextualCardLoader.getDisplayableCards(cards); in getDisplayableCards_twoEligibleCards_shouldShowAll()
86 final List<ContextualCard> cards = getContextualCardList().stream().limit(4) in getDisplayableCards_fourEligibleCards_shouldShowDefaultCardCount()
90 final List<ContextualCard> result = mContextualCardLoader.getDisplayableCards(cards); in getDisplayableCards_fourEligibleCards_shouldShowDefaultCardCount()
97 final List<ContextualCard> cards = getContextualCardList().stream().limit(5) in getDisplayableCards_oneStickyCard_shouldShowOneStickyCardAtTheTail()
101 final List<ContextualCard> result = mContextualCardLoader.getDisplayableCards(cards); in getDisplayableCards_oneStickyCard_shouldShowOneStickyCardAtTheTail()
109 final List<ContextualCard> cards = getContextualCardList(); in getDisplayableCards_threeStickyCards_shouldShowThreeStickyCardAtTheTail()
112 final List<ContextualCard> result = mContextualCardLoader.getDisplayableCards(cards); in getDisplayableCards_threeStickyCards_shouldShowThreeStickyCardAtTheTail()
154 private List<ContextualCard> getContextualCardList() { in getContextualCardList()
[all …]
DContextualCardsAdapterTest.java81 final List<ContextualCard> cards = getContextualCardList(); in getItemCount_cardList_shouldReturnListSize()
117 final Map<Integer, List<ContextualCard>> cardsToUpdate = new ArrayMap<>(); in onContextualCardUpdated_emptyList_shouldClearCardList()
118 final List<ContextualCard> newCardList = new ArrayList<>(); in onContextualCardUpdated_emptyList_shouldClearCardList()
119 cardsToUpdate.put(ContextualCard.CardType.DEFAULT, newCardList); in onContextualCardUpdated_emptyList_shouldClearCardList()
129 final Map<Integer, List<ContextualCard>> cardsToUpdate = new ArrayMap<>(); in onContextualCardUpdated_newCardList_shouldUpdateCardList()
130 final List<ContextualCard> newCardList = new ArrayList<>(); in onContextualCardUpdated_newCardList_shouldUpdateCardList()
132 cardsToUpdate.put(ContextualCard.CardType.DEFAULT, newCardList); in onContextualCardUpdated_newCardList_shouldUpdateCardList()
149 private List<ContextualCard> getContextualCardList() { in getContextualCardList()
150 final List<ContextualCard> cards = new ArrayList<>(); in getContextualCardList()
151 cards.add(new ContextualCard.Builder() in getContextualCardList()
[all …]
DEligibleCardCheckerTest.java88 final ContextualCard card = new ContextualCard.Builder() in isCardEligibleToDisplay_invalidRankingScore_returnFalse()
90 .setCardType(ContextualCard.CardType.SLICE) in isCardEligibleToDisplay_invalidRankingScore_returnFalse()
128 private ContextualCard getContextualCard(Uri sliceUri) { in getContextualCard()
129 return new ContextualCard.Builder() in getContextualCard()
132 .setCardType(ContextualCard.CardType.SLICE) in getContextualCard()
/packages/apps/Settings/src/com/android/settings/homepage/contextualcards/
DContextualCardManager.java20 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.STICKY_…
21 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.SUGGEST…
93 final List<ContextualCard> mContextualCards;
115 for (@ContextualCard.CardType int cardType : getSettingsCards()) { in ContextualCardManager()
143 for (ContextualCard card : mContextualCards) { in loadCardControllers()
151 return new int[] {ContextualCard.CardType.LEGACY_SUGGESTION}; in getSettingsCards()
154 {ContextualCard.CardType.CONDITIONAL, ContextualCard.CardType.LEGACY_SUGGESTION}; in getSettingsCards()
158 void setupController(@ContextualCard.CardType int cardType) { in setupController()
173 List<ContextualCard> sortCards(List<ContextualCard> cards) { in sortCards()
175 final List<ContextualCard> result = cards.stream() in sortCards()
[all …]
DSettingsContextualCardProvider.java21 import com.android.settings.intelligence.ContextualCardProto.ContextualCard;
35 final ContextualCard wifiCard = in getContextualCards()
36 ContextualCard.newBuilder() in getContextualCards()
39 .setCardCategory(ContextualCard.Category.IMPORTANT) in getContextualCards()
41 final ContextualCard connectedDeviceCard = in getContextualCards()
42 ContextualCard.newBuilder() in getContextualCards()
45 .setCardCategory(ContextualCard.Category.IMPORTANT) in getContextualCards()
47 final ContextualCard lowStorageCard = in getContextualCards()
48 ContextualCard.newBuilder() in getContextualCards()
51 .setCardCategory(ContextualCard.Category.IMPORTANT) in getContextualCards()
[all …]
DContextualCardLoader.java19 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.STICKY_…
50 public class ContextualCardLoader extends AsyncLoaderCompat<List<ContextualCard>> {
99 protected void onDiscardResult(List<ContextualCard> result) { in onDiscardResult()
105 public List<ContextualCard> loadInBackground() { in loadInBackground()
106 final List<ContextualCard> result = new ArrayList<>(); in loadInBackground()
114 final ContextualCard card = new ContextualCard(cursor); in loadInBackground()
128 List<ContextualCard> getDisplayableCards(List<ContextualCard> candidates) { in getDisplayableCards()
129 final List<ContextualCard> eligibleCards = filterEligibleCards(candidates); in getDisplayableCards()
130 final List<ContextualCard> stickyCards = new ArrayList<>(); in getDisplayableCards()
131 final List<ContextualCard> visibleCards = new ArrayList<>(); in getDisplayableCards()
[all …]
DContextualCardsDiffCallback.java19 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.IMPORTA…
20 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.STICKY_…
31 private final List<ContextualCard> mOldCards;
32 private final List<ContextualCard> mNewCards;
34 public ContextualCardsDiffCallback(List<ContextualCard> oldCards, in ContextualCardsDiffCallback()
35 List<ContextualCard> newCards) { in ContextualCardsDiffCallback()
58 final ContextualCard newCard = mNewCards.get(newCardPosition); in areContentsTheSame()
DContextualCardsAdapter.java48 final List<ContextualCard> mContextualCards;
72 final ContextualCard card = mContextualCards.get(position); in getItemViewType()
86 final ContextualCard card = mContextualCards.get(position); in onBindViewHolder()
119 public void onContextualCardUpdated(Map<Integer, List<ContextualCard>> cards) { in onContextualCardUpdated()
120 final List<ContextualCard> contextualCards = cards.get(ContextualCard.CardType.DEFAULT); in onContextualCardUpdated()
142 final ContextualCard card = mContextualCards.get(position).mutate() in onSwiped()
DContextualCard.java36 public class ContextualCard { class
140 public ContextualCard(Builder builder) { in ContextualCard() method in ContextualCard
159 ContextualCard(Cursor c) { in ContextualCard() method in ContextualCard
206 if (!(obj instanceof ContextualCard)) { in equals()
209 final ContextualCard that = (ContextualCard) obj; in equals()
317 public ContextualCard build() { in build()
318 return new ContextualCard(this); in build()
DEligibleCardChecker.java41 public class EligibleCardChecker implements Callable<ContextualCard> {
48 ContextualCard mCard;
50 EligibleCardChecker(Context context, ContextualCard card) { in EligibleCardChecker()
56 public ContextualCard call() { in call()
60 ContextualCard result; in call()
86 boolean isCardEligibleToDisplay(ContextualCard card) { in isCardEligibleToDisplay()
/packages/apps/Settings/src/com/android/settings/homepage/contextualcards/conditional/
DConditionContextualCardController.java24 import com.android.settings.homepage.contextualcards.ContextualCard;
73 return ContextualCard.CardType.CONDITIONAL; in getCardType()
87 public void onPrimaryClick(ContextualCard contextualCard) { in onPrimaryClick()
93 public void onActionClick(ContextualCard contextualCard) { in onActionClick()
99 public void onDismissed(ContextualCard contextualCard) { in onDismissed()
108 final List<ContextualCard> conditionCards = mConditionManager.getDisplayableCards(); in onConditionsChanged()
109 final Map<Integer, List<ContextualCard>> conditionalCards = in onConditionsChanged()
147 Map<Integer, List<ContextualCard>> buildConditionalCardsWithFooterOrHeader( in buildConditionalCardsWithFooterOrHeader()
148 List<ContextualCard> conditionCards) { in buildConditionalCardsWithFooterOrHeader()
149 final Map<Integer, List<ContextualCard>> conditionalCards = new ArrayMap<>(); in buildConditionalCardsWithFooterOrHeader()
[all …]
DConditionHeaderContextualCard.java21 import com.android.settings.homepage.contextualcards.ContextualCard;
32 public class ConditionHeaderContextualCard extends ContextualCard {
34 private final List<ContextualCard> mConditionalCards;
46 public List<ContextualCard> getConditionalCards() { in getConditionalCards()
69 public static class Builder extends ContextualCard.Builder {
71 private List<ContextualCard> mConditionalCards;
73 public Builder setConditionalCards(List<ContextualCard> conditionalCards) { in setConditionalCards()
DConditionManager.java25 import com.android.settings.homepage.contextualcards.ContextualCard;
59 public List<ContextualCard> getDisplayableCards() { in getDisplayableCards()
60 final List<ContextualCard> cards = new ArrayList<>(); in getDisplayableCards()
61 final List<Future<ContextualCard>> displayableCards = new ArrayList<>(); in getDisplayableCards()
68 for (Future<ContextualCard> cardFuture : displayableCards) { in getDisplayableCards()
70 final ContextualCard card = cardFuture.get( in getDisplayableCards()
168 public static class DisplayableChecker implements Callable<ContextualCard> {
177 public ContextualCard call() throws Exception { in call()
/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/conditional/
DConditionContextualCardControllerTest.java32 import com.android.settings.homepage.contextualcards.ContextualCard;
33 import com.android.settings.homepage.contextualcards.ContextualCard.CardType;
97 final ContextualCard fakeConditionalCard = new ConditionalContextualCard.Builder().build(); in onConditionsChanged_listenerIsSet_shouldUpdateData()
98 final List<ContextualCard> conditionalCards = new ArrayList<>(); in onConditionsChanged_listenerIsSet_shouldUpdateData()
110 final ContextualCard fakeConditionalCard = new ConditionalContextualCard.Builder().build(); in onConditionsChanged_listenerNotSet_shouldNotUpdateData()
111 final List<ContextualCard> conditionalCards = new ArrayList<>(); in onConditionsChanged_listenerNotSet_shouldNotUpdateData()
122 final Map<Integer, List<ContextualCard>> conditionalCards = in getConditionalCards_hasEmptyConditionCards_shouldReturnThreeEmptyList()
134 final Map<Integer, List<ContextualCard>> conditionalCards = in getConditionalCards_hasOneConditionCardAndExpanded_shouldGetOneFullWidthCard()
148 final Map<Integer, List<ContextualCard>> conditionalCards = in getConditionalCards_hasOneConditionCardAndCollapsed_shouldGetConditionalHeader()
160 final Map<Integer, List<ContextualCard>> conditionalCards = in getConditionalCards_hasTwoConditionCardsAndExpanded_shouldGetTwoHalfWidthCards()
[all …]
DConditionHeaderContextualCardRendererTest.java32 import com.android.settings.homepage.contextualcards.ContextualCard;
72 final ContextualCard card = generateConditionHeaderContextualCard(); in bindView_shouldSetClickListener()
78 ContextualCard.CardType.CONDITIONAL_HEADER)).thenReturn(mController); in bindView_shouldSetClickListener()
90 final ContextualCard card = generateConditionHeaderContextualCard(); in bindView_clickView_shouldSetTrueToIsConditionExpanded()
96 ContextualCard.CardType.CONDITIONAL_HEADER)).thenReturn(mController); in bindView_clickView_shouldSetTrueToIsConditionExpanded()
107 private ContextualCard generateConditionHeaderContextualCard() { in generateConditionHeaderContextualCard()
116 private List<ContextualCard> generateConditionCards(int numberOfCondition) { in generateConditionCards()
117 final List<ContextualCard> conditionCards = new ArrayList<>(); in generateConditionCards()
DConditionContextualCardRendererTest.java33 import com.android.settings.homepage.contextualcards.ContextualCard;
70 final ContextualCard card = buildConditionContextualCard(); in bindView_shouldSetListener()
77 ContextualCard.CardType.CONDITIONAL)).thenReturn(mController); in bindView_shouldSetListener()
89 final ContextualCard card = buildConditionContextualCard(); in viewClick_shouldInvokeControllerPrimaryClick()
96 ContextualCard.CardType.CONDITIONAL)).thenReturn(mController); in viewClick_shouldInvokeControllerPrimaryClick()
103 verify(mController).onPrimaryClick(any(ContextualCard.class)); in viewClick_shouldInvokeControllerPrimaryClick()
106 private ContextualCard buildConditionContextualCard() { in buildConditionContextualCard()
DConditionFooterContextualCardRendererTest.java32 import com.android.settings.homepage.contextualcards.ContextualCard;
64 final ContextualCard card = generateConditionFooterContextualCard(); in bindView_shouldSetClickListener()
70 ContextualCard.CardType.CONDITIONAL_FOOTER)).thenReturn(mController); in bindView_shouldSetClickListener()
82 final ContextualCard card = generateConditionFooterContextualCard(); in bindView_clickView_shouldSetTrueToIsConditionExpanded()
88 ContextualCard.CardType.CONDITIONAL_FOOTER)).thenReturn(mController); in bindView_clickView_shouldSetTrueToIsConditionExpanded()
99 private ContextualCard generateConditionFooterContextualCard() { in generateConditionFooterContextualCard()
/packages/apps/Settings/tests/unit/src/com/android/settings/homepage/contextualcards/
DContextualCardsDiffCallbackTest.java18 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.IMPORTA…
19 import static com.android.settings.intelligence.ContextualCardProto.ContextualCard.Category.STICKY_…
40 private List<ContextualCard> mOldCards;
41 private List<ContextualCard> mNewCards;
82 final ContextualCard card = getContextualCard("test1").mutate() in areContentsTheSame_sliceWithToggle_returnFalse()
91 final ContextualCard card = getContextualCard("test1").mutate() in areContentsTheSame_stickySlice_returnFalse()
100 final ContextualCard card = getContextualCard("test1").mutate() in areContentsTheSame_importantSlice_returnFalse()
107 private ContextualCard getContextualCard(String name) { in getContextualCard()
108 return new ContextualCard.Builder() in getContextualCard()
111 .setCardType(ContextualCard.CardType.SLICE) in getContextualCard()
/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/legacysuggestion/
DLegacySuggestionContextualCardRendererTest.java33 import com.android.settings.homepage.contextualcards.ContextualCard;
71 final ContextualCard card = buildContextualCard(); in bindView_shouldSetListener()
77 ContextualCard.CardType.LEGACY_SUGGESTION)).thenReturn(mController); in bindView_shouldSetListener()
89 final ContextualCard card = buildContextualCard(); in bindView_closeButton_shouldSetListener()
96 ContextualCard.CardType.LEGACY_SUGGESTION)).thenReturn(mController); in bindView_closeButton_shouldSetListener()
108 final ContextualCard card = buildContextualCard(); in viewClick_shouldInvokeControllerPrimaryClick()
114 ContextualCard.CardType.LEGACY_SUGGESTION)).thenReturn(mController); in viewClick_shouldInvokeControllerPrimaryClick()
121 verify(mController).onPrimaryClick(any(ContextualCard.class)); in viewClick_shouldInvokeControllerPrimaryClick()
128 final ContextualCard card = buildContextualCard(); in viewClick_closeButton_shouldInvokeControllerDismissClick()
135 ContextualCard.CardType.LEGACY_SUGGESTION)).thenReturn(mController); in viewClick_closeButton_shouldInvokeControllerDismissClick()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/
DSliceContextualCardRendererTest.java43 import com.android.settings.homepage.contextualcards.ContextualCard;
149 final ContextualCard card = buildContextualCard( in bindView_isPendingDismiss_shouldShowDismissalView()
160 final ContextualCard card = buildContextualCard( in bindView_isPendingDismiss_shouldAddViewHolderToSet()
171 final ContextualCard card = buildContextualCard(TEST_SLICE_URI); in bindView_beforeSuccessfulSliceBinding_shouldHideSwipeBackground()
182 final ContextualCard card = buildContextualCard(TEST_SLICE_URI); in bindView_reuseViewHolder_shouldHideSwipeBackgroundBeforeSliceBinding()
198 final ContextualCard card = buildContextualCard( in viewClick_keepCard_shouldShowSlice()
212 final ContextualCard card = buildContextualCard( in viewClick_keepCard_shouldRemoveViewHolderFromSet()
226 final ContextualCard card = buildContextualCard( in viewClick_removeCard_shouldRemoveViewHolderFromSet()
231 ContextualCard.CardType.SLICE); in viewClick_removeCard_shouldRemoveViewHolderFromSet()
242 final ContextualCard contextualCard = buildContextualCard(TEST_SLICE_URI); in viewClick_removeCard_sliceLiveDataShouldRemoveObservers()
[all …]
/packages/apps/Settings/src/com/android/settings/homepage/contextualcards/legacysuggestion/
DLegacySuggestionContextualCardController.java29 import com.android.settings.homepage.contextualcards.ContextualCard;
50 final List<ContextualCard> mSuggestions;
76 return ContextualCard.CardType.LEGACY_SUGGESTION; in getCardType()
80 public void onPrimaryClick(ContextualCard card) { in onPrimaryClick()
89 public void onActionClick(ContextualCard card) { in onActionClick()
94 public void onDismissed(ContextualCard card) { in onDismissed()
143 final List<ContextualCard> cards = new ArrayList<>(); in loadSuggestions()
171 final Map<Integer, List<ContextualCard>> suggestionCards = new ArrayMap<>(); in updateAdapter()
172 suggestionCards.put(ContextualCard.CardType.LEGACY_SUGGESTION, mSuggestions); in updateAdapter()
/packages/apps/Settings/src/com/android/settings/homepage/contextualcards/slices/
DSliceContextualCardController.java28 import com.android.settings.homepage.contextualcards.ContextualCard;
55 return ContextualCard.CardType.SLICE; in getCardType()
59 public void onPrimaryClick(ContextualCard card) { in onPrimaryClick()
64 public void onActionClick(ContextualCard card) { in onActionClick()
69 public void onDismissed(ContextualCard card) { in onDismissed()
91 void showFeedbackDialog(ContextualCard card) { in showFeedbackDialog()
109 private String getSimpleCardName(ContextualCard card) { in getSimpleCardName()
/packages/apps/Settings/tests/robotests/src/com/android/settings/homepage/contextualcards/logging/
DContextualCardLogUtilsTest.java23 import com.android.settings.homepage.contextualcards.ContextualCard;
38 private static final ContextualCard TEST_CARD =
39 new ContextualCard.Builder()
81 final ContextualCard testcard = in parseCardClickList_isValid_returnCorrectData()
82 new ContextualCard.Builder() in parseCardClickList_isValid_returnCorrectData()
86 final List<ContextualCard> cardList = new ArrayList<>(); in parseCardClickList_isValid_returnCorrectData()
/packages/apps/Settings/tests/legacy_unit/src/com/android/settings/homepage/contextualcards/
DContextualCardLoaderTest.java59 final List<ContextualCard> cards = new ArrayList<>(); in filterEligibleCards_twoInvalidCards_shouldReturnOneCard()
64 final List<ContextualCard> result = mContextualCardLoader.filterEligibleCards(cards); in filterEligibleCards_twoInvalidCards_shouldReturnOneCard()
86 private ContextualCard getContextualCard(Uri sliceUri) { in getContextualCard()
87 return new ContextualCard.Builder() in getContextualCard()
90 .setCardType(ContextualCard.CardType.SLICE) in getContextualCard()

123