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

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: oo 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.VIEW_TYPE_ABOVE_THE_FOLD,
dgn 2016/10/13 15:42:41 nit: remove the VIEW_TYPE prefix on the constants?
Bernhard Bauer 2016/10/13 16:13:13 Done.
20 ItemViewType.VIEW_TYPE_HEADER,
21 ItemViewType.VIEW_TYPE_SNIPPET,
22 ItemViewType.VIEW_TYPE_SPACING,
23 ItemViewType.VIEW_TYPE_STATUS,
24 ItemViewType.VIEW_TYPE_PROGRESS,
25 ItemViewType.VIEW_TYPE_ACTION,
26 ItemViewType.VIEW_TYPE_FOOTER,
27 ItemViewType.VIEW_TYPE_PROMO,
28 ItemViewType.VIEW_TYPE_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 VIEW_TYPE_ABOVE_THE_FOLD = 1;
39 /**
40 * View type for card group headers
41 *
42 * @see Adapter#getItemViewType(int)
43 */
44 int VIEW_TYPE_HEADER = 2;
45 /**
46 * View type for snippet cards
47 *
48 * @see Adapter#getItemViewType(int)
49 */
50 int VIEW_TYPE_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 VIEW_TYPE_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 VIEW_TYPE_STATUS = 5;
63 /**
64 * View type for a {@link ProgressItem}, the progress indicator.
65 *
66 * @see Adapter#getItemViewType(int)
67 */
68 int VIEW_TYPE_PROGRESS = 6;
69 /**
70 * View type for a {@link ActionItem}, an action button.
71 *
72 * @see Adapter#getItemViewType(int)
73 */
74 int VIEW_TYPE_ACTION = 7;
75 /**
76 * View type for a {@link Footer}.
77 *
78 * @see Adapter#getItemViewType(int)
79 */
80 int VIEW_TYPE_FOOTER = 8;
81 /**
82 * View type for a {@link SignInPromo}.
83 *
84 * @see Adapter#getItemViewType(int)
85 */
86 int VIEW_TYPE_PROMO = 9;
87 /**
88 * View type for a {@link AllDismissedItem}.
89 *
90 * @see Adapter#getItemViewType(int)
91 */
92 int VIEW_TYPE_ALL_DISMISSED = 10;
93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698