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

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

Issue 2396523002: Unify NewTabPageItem and ItemGroup into a single tree-structured interface. (Closed)
Patch Set: review Created 4 years, 2 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/NewTabPageItem.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageItem.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageItem.java
deleted file mode 100644
index 6be6060d887fea9db93a34dca4733598b030c385..0000000000000000000000000000000000000000
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageItem.java
+++ /dev/null
@@ -1,103 +0,0 @@
-// 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.cards;
-
-import android.support.annotation.IntDef;
-import android.support.v7.widget.RecyclerView.Adapter;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/** Base type for anything to add to the new tab page */
-public interface NewTabPageItem {
- /**
- * View type values for the items that will be held by the NTP's RecyclerView.
- * @see Adapter#getItemViewType(int)
- * @see NewTabPageItem#getType()
- */
- @IntDef({VIEW_TYPE_ABOVE_THE_FOLD, VIEW_TYPE_HEADER, VIEW_TYPE_SNIPPET, VIEW_TYPE_SPACING,
- VIEW_TYPE_STATUS, VIEW_TYPE_PROGRESS, VIEW_TYPE_ACTION, VIEW_TYPE_FOOTER,
- VIEW_TYPE_PROMO, VIEW_TYPE_ALL_DISMISSED})
- @Retention(RetentionPolicy.SOURCE)
- public @interface ViewType {}
-
- /**
- * View type for the above the fold item
- * @see Adapter#getItemViewType(int)
- */
- public static final int VIEW_TYPE_ABOVE_THE_FOLD = 1;
-
- /**
- * View type for card group headers
- * @see Adapter#getItemViewType(int)
- */
- public static final int VIEW_TYPE_HEADER = 2;
-
- /**
- * View type for snippet cards
- * @see Adapter#getItemViewType(int)
- */
- public static final int VIEW_TYPE_SNIPPET = 3;
-
- /**
- * View type for a {@link SpacingItem} used to provide spacing at the end of the list.
- * @see Adapter#getItemViewType(int)
- */
- public static final int VIEW_TYPE_SPACING = 4;
-
- /**
- * View type for a {@link StatusItem}, the card displaying status information
- * @see Adapter#getItemViewType(int)
- */
- public static final int VIEW_TYPE_STATUS = 5;
-
- /**
- * View type for a {@link ProgressItem}, the progress indicator.
- * @see Adapter#getItemViewType(int)
- */
- public static final int VIEW_TYPE_PROGRESS = 6;
-
- /**
- * View type for a {@link ActionItem}, an action button.
- * @see Adapter#getItemViewType(int)
- */
- public static final int VIEW_TYPE_ACTION = 7;
-
- /**
- * View type for a {@link Footer}.
- * @see Adapter#getItemViewType(int)
- */
- public static final int VIEW_TYPE_FOOTER = 8;
-
- /**
- * View type for a {@link SignInPromo}.
- * @see Adapter#getItemViewType(int)
- */
- public static final int VIEW_TYPE_PROMO = 9;
-
- /**
- * View type for a {@link AllDismissedItem}.
- * @see Adapter#getItemViewType(int)
- */
- public static final int VIEW_TYPE_ALL_DISMISSED = 10;
-
- // NOTE: when adding new entries here, also update the IntDef at the top of this file, and
- // CardViewHolder#isCard(int type).
-
- /**
- * Returns the type ({@link ViewType}) of this list item. This is so we can
- * distinguish between different elements that are held in a single RecyclerView holder.
- *
- * @return the type of this list item.
- */
- @ViewType
- public int getType();
-
- /**
- * Update the given {@link NewTabPageViewHolder} with data from this item.
- * @param holder The {@link NewTabPageViewHolder} to update.
- */
- void onBindViewHolder(NewTabPageViewHolder holder);
-}

Powered by Google App Engine
This is Rietveld 408576698