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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ItemViewType.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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser.ntp.cards;
6
7 import android.support.annotation.IntDef;
8 import android.support.v7.widget.RecyclerView.Adapter;
9
10 import java.lang.annotation.Retention;
11 import java.lang.annotation.RetentionPolicy;
12
13 /**
14 * View type values for the items that will be held by the NTP's RecyclerView.
15 *
16 * @see Adapter#getItemViewType(int)
17 */
18 @IntDef({
19 ItemViewType.ABOVE_THE_FOLD,
20 ItemViewType.HEADER,
21 ItemViewType.SNIPPET,
22 ItemViewType.SPACING,
23 ItemViewType.STATUS,
24 ItemViewType.PROGRESS,
25 ItemViewType.ACTION,
26 ItemViewType.FOOTER,
27 ItemViewType.PROMO,
28 ItemViewType.ALL_DISMISSED
29 })
30 @Retention(RetentionPolicy.SOURCE)
31 public @interface ItemViewType {
32
33 /**
34 * View type for the above the fold item
35 *
36 * @see Adapter#getItemViewType(int)
37 */
38 int ABOVE_THE_FOLD = 1;
39 /**
40 * View type for card group headers
41 *
42 * @see Adapter#getItemViewType(int)
43 */
44 int HEADER = 2;
45 /**
46 * View type for snippet cards
47 *
48 * @see Adapter#getItemViewType(int)
49 */
50 int SNIPPET = 3;
51 /**
52 * View type for a {@link SpacingItem} used to provide spacing at the end of the list.
53 *
54 * @see Adapter#getItemViewType(int)
55 */
56 int SPACING = 4;
57 /**
58 * View type for a {@link StatusItem}, the card displaying status informatio n
59 *
60 * @see Adapter#getItemViewType(int)
61 */
62 int STATUS = 5;
63 /**
64 * View type for a {@link ProgressItem}, the progress indicator.
65 *
66 * @see Adapter#getItemViewType(int)
67 */
68 int PROGRESS = 6;
69 /**
70 * View type for a {@link ActionItem}, an action button.
71 *
72 * @see Adapter#getItemViewType(int)
73 */
74 int ACTION = 7;
75 /**
76 * View type for a {@link Footer}.
77 *
78 * @see Adapter#getItemViewType(int)
79 */
80 int FOOTER = 8;
81 /**
82 * View type for a {@link SignInPromo}.
83 *
84 * @see Adapter#getItemViewType(int)
85 */
86 int PROMO = 9;
87 /**
88 * View type for a {@link AllDismissedItem}.
89 *
90 * @see Adapter#getItemViewType(int)
91 */
92 int ALL_DISMISSED = 10;
93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698