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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ProgressItem.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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.ntp.cards; 5 package org.chromium.chrome.browser.ntp.cards;
6 6
7 /** 7 /**
8 * Represents a progress indicator for the recycler view. A visibility flag can be set to be used 8 * Represents a progress indicator for the recycler view. A visibility flag can be set to be used
9 * by its associated view holder when it is bound. 9 * by its associated view holder when it is bound.
10 * 10 *
11 * @see ProgressViewHolder 11 * @see ProgressViewHolder
12 */ 12 */
13 class ProgressItem implements NewTabPageItem { 13 class ProgressItem extends Leaf {
14 private boolean mVisible = false; 14 private boolean mVisible = false;
15 15
16 @Override 16 @Override
17 public int getType() { 17 @ItemViewType
18 return NewTabPageItem.VIEW_TYPE_PROGRESS; 18 protected int getItemViewType() {
19 return ItemViewType.PROGRESS;
19 } 20 }
20 21
21 public boolean isVisible() { 22 public boolean isVisible() {
22 return mVisible; 23 return mVisible;
23 } 24 }
24 25
25 public void setVisible(boolean visible) { 26 public void setVisible(boolean visible) {
26 mVisible = visible; 27 mVisible = visible;
27 } 28 }
28 29
29 @Override 30 @Override
30 public void onBindViewHolder(NewTabPageViewHolder holder) { 31 protected void onBindViewHolder(NewTabPageViewHolder holder) {
31 assert holder instanceof ProgressViewHolder; 32 assert holder instanceof ProgressViewHolder;
32 ((ProgressViewHolder) holder).onBindViewHolder(this); 33 ((ProgressViewHolder) holder).onBindViewHolder(this);
33 } 34 }
34 } 35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698