OLD | NEW |
(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.history; |
| 6 |
| 7 import android.content.Context; |
| 8 import android.util.AttributeSet; |
| 9 import android.widget.TextView; |
| 10 |
| 11 import org.chromium.chrome.R; |
| 12 import org.chromium.chrome.browser.widget.selection.SelectableItemView; |
| 13 |
| 14 /** |
| 15 * The SelectableItemView for items displayed in the browsing history UI. |
| 16 */ |
| 17 public class HistoryItemView extends SelectableItemView<HistoryItem> { |
| 18 private TextView mTitle; |
| 19 private TextView mDomain; |
| 20 |
| 21 public HistoryItemView(Context context, AttributeSet attrs) { |
| 22 super(context, attrs); |
| 23 } |
| 24 |
| 25 @Override |
| 26 protected void onFinishInflate() { |
| 27 super.onFinishInflate(); |
| 28 mTitle = (TextView) findViewById(R.id.title); |
| 29 mDomain = (TextView) findViewById(R.id.domain); |
| 30 } |
| 31 |
| 32 @Override |
| 33 public void setItem(HistoryItem item) { |
| 34 super.setItem(item); |
| 35 mTitle.setText(item.getTitle()); |
| 36 mDomain.setText(item.getDomain()); |
| 37 } |
| 38 |
| 39 @Override |
| 40 protected void onClick() { |
| 41 // TODO(twellington): Handle clicks on the HistoryItemView. |
| 42 } |
| 43 } |
OLD | NEW |