Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3940)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java

Issue 2223743004: 📰 Add an action button that can be used in sections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
index f3d98d2cdb4a3afdd78773167e77e69cc01f0b9e..4b8632f8d4a465e4932f50b2963f9bc84f94a1bb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java
@@ -21,9 +21,12 @@
private final SnippetHeaderListItem mHeader = new SnippetHeaderListItem();
private StatusListItem mStatus;
private final ProgressListItem mProgressIndicator = new ProgressListItem();
+ private final ActionListItem mMoreButton;
public SuggestionsSection(List<SnippetArticleListItem> suggestions,
- @CategoryStatusEnum int status, NewTabPageAdapter adapter) {
+ @CategoryStatusEnum int status, NewTabPageAdapter adapter, boolean showMoreButton) {
+ mMoreButton = showMoreButton ? new ActionListItem() : null;
+
// TODO(mvanouwerkerk): Pass in the header text.
setSuggestions(suggestions, status, adapter);
}
@@ -36,6 +39,8 @@ public SuggestionsSection(List<SnippetArticleListItem> suggestions,
if (mSuggestions.isEmpty()) {
items.add(mStatus);
items.add(mProgressIndicator);
+ } else if (mMoreButton != null) {
+ items.add(mMoreButton);
}
return Collections.unmodifiableList(items);
}

Powered by Google App Engine
This is Rietveld 408576698