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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/TreeNode.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 org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
8
9 /**
10 * A tree interface to allow the New Tab Page RecyclerView to delegate to other components.
11 */
12 interface TreeNode {
13 /**
14 * @return The number of items under this subtree.
15 * @see android.support.v7.widget.RecyclerView.Adapter#getItemCount()
16 */
17 int getItemCount();
18
19 /**
20 * @param position The position to query
21 * @return The view type of the item at {@code position} under this subtree.
22 * @see android.support.v7.widget.RecyclerView.Adapter#getItemViewType
23 */
24 @ItemViewType
25 int getItemViewType(int position);
26
27 /**
28 * Display the data at {@code position} under this subtree.
29 * @param holder The view holder that should be updated.
30 * @param position The position of the item under this subtree.
31 * @see android.support.v7.widget.RecyclerView.Adapter#onBindViewHolder
32 */
33 void onBindViewHolder(NewTabPageViewHolder holder, final int position);
34
35 /**
36 * @param position The position to query.
37 * @return The article at {@code position} under this subtree, or null if th e item is not
38 * an article.
39 */
40 SnippetArticle getSuggestionAt(int position);
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698