| OLD | NEW |
| 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 * Item in the RecyclerView that will hold the above the fold contents for the N
TP, i.e. the | 8 * Item in the RecyclerView that will hold the above the fold contents for the N
TP, i.e. the |
| 9 * logo, tiles and search bar that are initially visible when opening the NTP. | 9 * logo, tiles and search bar that are initially visible when opening the NTP. |
| 10 * | 10 * |
| 11 * When using the new NTP UI, that is based on a RecyclerView, the view containi
ng the entire | 11 * When using the new NTP UI, that is based on a RecyclerView, the view containi
ng the entire |
| 12 * content of the old UI is put in the AboveTheFoldItem, and inserted in the Rec
yclerView. | 12 * content of the old UI is put in the AboveTheFoldItem, and inserted in the Rec
yclerView. |
| 13 * Other elements coming after it and initially off-screen are just added to the
RecyclerView after | 13 * Other elements coming after it and initially off-screen are just added to the
RecyclerView after |
| 14 * that. | 14 * that. |
| 15 */ | 15 */ |
| 16 class AboveTheFoldItem extends Leaf { | 16 class AboveTheFoldItem extends Leaf { |
| 17 @Override | 17 @Override |
| 18 @ItemViewType | 18 @ItemViewType |
| 19 protected int getItemViewType() { | 19 protected int getItemViewType() { |
| 20 return ItemViewType.ABOVE_THE_FOLD; | 20 return ItemViewType.ABOVE_THE_FOLD; |
| 21 } | 21 } |
| 22 | 22 |
| 23 @Override | 23 @Override |
| 24 protected void onBindViewHolder(NewTabPageViewHolder holder) { | 24 protected void onBindViewHolder(NewTabPageViewHolder holder) { |
| 25 // Nothing to do. | 25 // Nothing to do. |
| 26 } | 26 } |
| 27 |
| 28 @Override |
| 29 public void visitItems(NodeVisitor visitor) { |
| 30 visitor.visitAboveTheFoldItem(); |
| 31 } |
| 27 } | 32 } |
| OLD | NEW |