Loading src/com/android/settings/homepage/contextualcards/ContextualCardManager.java +10 −3 Original line number Diff line number Diff line Loading @@ -170,9 +170,16 @@ public class ContextualCardManager implements ContextualCardLoader.CardContentLo @VisibleForTesting List<ContextualCard> sortCards(List<ContextualCard> cards) { // take mContextualCards as the source and do the ranking based on the rule. return cards.stream() final List<ContextualCard> result = cards.stream() .sorted((c1, c2) -> Double.compare(c2.getRankingScore(), c1.getRankingScore())) .collect(Collectors.toList()); final List<ContextualCard> stickyCards = result.stream() .filter(c -> c.getCategory() == STICKY_VALUE) .collect(Collectors.toList()); // make sticky cards be at the tail end. result.removeAll(stickyCards); result.addAll(stickyCards); return result; } @Override Loading Loading
src/com/android/settings/homepage/contextualcards/ContextualCardManager.java +10 −3 Original line number Diff line number Diff line Loading @@ -170,9 +170,16 @@ public class ContextualCardManager implements ContextualCardLoader.CardContentLo @VisibleForTesting List<ContextualCard> sortCards(List<ContextualCard> cards) { // take mContextualCards as the source and do the ranking based on the rule. return cards.stream() final List<ContextualCard> result = cards.stream() .sorted((c1, c2) -> Double.compare(c2.getRankingScore(), c1.getRankingScore())) .collect(Collectors.toList()); final List<ContextualCard> stickyCards = result.stream() .filter(c -> c.getCategory() == STICKY_VALUE) .collect(Collectors.toList()); // make sticky cards be at the tail end. result.removeAll(stickyCards); result.addAll(stickyCards); return result; } @Override Loading