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

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

Issue 1833763002: Add new NTP layout with snippet cards and hide it behind a flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix IntDefs, remove separate scrollview/recyclerview layout file Created 4 years, 9 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/NewTabPageViewHolder.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageViewHolder.java
new file mode 100644
index 0000000000000000000000000000000000000000..38c32401d99529fd7ee2dcc9e655bca35b138e61
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageViewHolder.java
@@ -0,0 +1,34 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
newt (away) 2016/03/30 19:03:50 2016
dgn 2016/03/31 00:46:45 Done.
+// 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;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+
+import org.chromium.chrome.browser.ntp.v2.NewTabPageListItem;
+
+/**
+ * A class that represents an item we want to display on the NTP. An item can be anything that will
+ * be displayed on the NTP RecyclerView.
+ */
+public abstract class NewTabPageViewHolder extends RecyclerView.ViewHolder {
+ /**
+ * Constructs a NewTabPageViewHolder item used to display an part of the NTP (e.g., header,
+ * article snippet, above the fold view, etc.)
+ *
+ * @param itemView The View for this item
+ */
+ public NewTabPageViewHolder(View itemView) {
+ super(itemView);
+ }
+
+ /**
+ * Called when the NTP cards adapter is requested to update the currently visible ViewHolder
+ * with data.
+ *
+ * @param cardItem The NewTabPageListItem object that holds the data for this ViewHolder
+ */
+ public abstract void onBindViewHolder(NewTabPageListItem cardItem);
+}

Powered by Google App Engine
This is Rietveld 408576698