Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/v2/HeaderListItem.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/v2/HeaderListItem.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/v2/HeaderListItem.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..13539d6dbd876ee7b72063152c910ecbb57d153a |
--- /dev/null |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/v2/HeaderListItem.java |
@@ -0,0 +1,47 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.chrome.browser.ntp.v2; |
+ |
+import android.view.LayoutInflater; |
+import android.view.View; |
+import android.view.ViewGroup; |
+ |
+import org.chromium.chrome.R; |
+import org.chromium.chrome.browser.ntp.NewTabPageViewHolder; |
+ |
+/** |
+ * Represents the data for a header of a group of snippets |
+ */ |
+public class HeaderListItem implements NewTabPageListItem { |
+ /** |
+ * A class that represents the view for a header of a group of card snippets. |
+ */ |
+ public static class ViewHolder extends NewTabPageViewHolder { |
newt (away)
2016/03/30 19:03:51
This looks identical to SnippetHeaderViewHolder. A
dgn
2016/03/31 00:46:45
made NTPViewHolder concrete and removed those two,
|
+ public ViewHolder(View view) { |
+ super(view); |
+ } |
+ |
+ /** |
+ * Creates the TextView object for displaying the header for a group of snippets |
newt (away)
2016/03/30 19:03:50
I'd replace "TextView" with "View", since "TextVie
dgn
2016/03/31 00:46:45
Done.
|
+ * |
+ * @param parent The parent view for the header |
+ * @return a TextView object for displaying a header for a group of snippets |
+ */ |
+ public static View createView(ViewGroup parent) { |
+ return LayoutInflater.from(parent.getContext()) |
+ .inflate(R.layout.new_tab_page_snippets_header, parent, false); |
+ } |
+ |
+ @Override |
+ public void onBindViewHolder(NewTabPageListItem snippetItem) {} |
+ } |
+ |
+ public HeaderListItem() {} |
newt (away)
2016/03/30 19:03:50
not needed
dgn
2016/03/31 00:46:45
Done.
|
+ |
+ @Override |
+ public int getType() { |
+ return NewTabPageListItem.VIEW_TYPE_HEADER; |
+ } |
+} |