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 import android.support.annotation.StringRes; | 7 import android.support.annotation.StringRes; |
8 import android.view.LayoutInflater; | 8 import android.view.LayoutInflater; |
9 import android.view.View; | 9 import android.view.View; |
10 import android.view.View.OnClickListener; | 10 import android.view.View.OnClickListener; |
(...skipping 17 matching lines...) Expand all Loading... |
28 public int getItemViewType() { | 28 public int getItemViewType() { |
29 return ItemViewType.ALL_DISMISSED; | 29 return ItemViewType.ALL_DISMISSED; |
30 } | 30 } |
31 | 31 |
32 @Override | 32 @Override |
33 public void onBindViewHolder(NewTabPageViewHolder holder) { | 33 public void onBindViewHolder(NewTabPageViewHolder holder) { |
34 assert holder instanceof ViewHolder; | 34 assert holder instanceof ViewHolder; |
35 ((ViewHolder) holder).onBindViewHolder(); | 35 ((ViewHolder) holder).onBindViewHolder(); |
36 } | 36 } |
37 | 37 |
| 38 @Override |
| 39 public void visitOptionalItem(NodeVisitor visitor) { |
| 40 visitor.visitAllDismissedItem(); |
| 41 } |
| 42 |
38 /** | 43 /** |
39 * ViewHolder for an item of type {@link ItemViewType#ALL_DISMISSED}. | 44 * ViewHolder for an item of type {@link ItemViewType#ALL_DISMISSED}. |
40 */ | 45 */ |
41 public static class ViewHolder extends NewTabPageViewHolder { | 46 public static class ViewHolder extends NewTabPageViewHolder { |
42 private final TextView mBodyTextView; | 47 private final TextView mBodyTextView; |
43 | 48 |
44 public ViewHolder(ViewGroup root, final SectionList sections) { | 49 public ViewHolder(ViewGroup root, final SectionList sections) { |
45 super(LayoutInflater.from(root.getContext()) | 50 super(LayoutInflater.from(root.getContext()) |
46 .inflate(R.layout.new_tab_page_all_dismissed, root,
false)); | 51 .inflate(R.layout.new_tab_page_all_dismissed, root,
false)); |
47 mBodyTextView = (TextView) itemView.findViewById(R.id.body_text); | 52 mBodyTextView = (TextView) itemView.findViewById(R.id.body_text); |
(...skipping 17 matching lines...) Expand all Loading... |
65 messageId = R.string.ntp_all_dismissed_body_text_morning; | 70 messageId = R.string.ntp_all_dismissed_body_text_morning; |
66 } else if (hour >= 12 && hour < 17) { | 71 } else if (hour >= 12 && hour < 17) { |
67 messageId = R.string.ntp_all_dismissed_body_text_afternoon; | 72 messageId = R.string.ntp_all_dismissed_body_text_afternoon; |
68 } else { | 73 } else { |
69 messageId = R.string.ntp_all_dismissed_body_text_evening; | 74 messageId = R.string.ntp_all_dismissed_body_text_evening; |
70 } | 75 } |
71 mBodyTextView.setText(messageId); | 76 mBodyTextView.setText(messageId); |
72 } | 77 } |
73 } | 78 } |
74 } | 79 } |
OLD | NEW |