[DO NOT MERGE] Update contextual cards display mechanism
1. Make Wi-Fi card default to collapse. 2. Support showing a default card when there's no displayable card. 3. Solve the problem of icon not showing for cached slices in card renderer Bug: 163288869 Fixes: 159092915 Test: manual, robotest Change-Id: Ie8b61ad58410337334e29b7a794353b0c6a6ba8c
This commit is contained in:
@@ -164,6 +164,16 @@ public class ContextualCardLoader extends AsyncLoaderCompat<List<ContextualCard>
|
||||
SettingsEnums.ACTION_CONTEXTUAL_CARD_NOT_SHOW,
|
||||
ContextualCardLogUtils.buildCardListLog(hiddenCards));
|
||||
}
|
||||
|
||||
// Add a default card if no other visible cards
|
||||
if (visibleCards.isEmpty() && maxCardCount == 1) {
|
||||
final ContextualCard defaultCard = FeatureFactory.getFactory(mContext)
|
||||
.getContextualCardFeatureProvider(mContext).getDefaultContextualCard();
|
||||
if (defaultCard != null) {
|
||||
Log.i(TAG, "Default card: " + defaultCard.getSliceUri());
|
||||
visibleCards.add(defaultCard);
|
||||
}
|
||||
}
|
||||
return visibleCards;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user