Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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.contextmenu; | 5 package org.chromium.chrome.browser.contextmenu; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.graphics.drawable.Drawable; | 8 import android.graphics.drawable.Drawable; |
| 9 import android.view.LayoutInflater; | 9 import android.view.LayoutInflater; |
| 10 import android.view.View; | 10 import android.view.View; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 | 65 |
| 66 convertView.setTag(viewHolder); | 66 convertView.setTag(viewHolder); |
| 67 } else { | 67 } else { |
| 68 viewHolder = (ViewHolderItem) convertView.getTag(); | 68 viewHolder = (ViewHolderItem) convertView.getTag(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 viewHolder.mText.setText(menuItem.getString(mContext)); | 71 viewHolder.mText.setText(menuItem.getString(mContext)); |
| 72 Drawable icon = menuItem.getDrawableAndDescription(mContext); | 72 Drawable icon = menuItem.getDrawableAndDescription(mContext); |
| 73 viewHolder.mIcon.setImageDrawable(icon); | 73 viewHolder.mIcon.setImageDrawable(icon); |
| 74 viewHolder.mIcon.setVisibility(icon != null ? View.VISIBLE : View.INVISI BLE); | 74 viewHolder.mIcon.setVisibility(icon != null ? View.VISIBLE : View.INVISI BLE); |
| 75 | 75 viewHolder.mIcon.setOnClickListener(new View.OnClickListener() { |
| 76 @Override | |
| 77 public void onClick(View view) {} | |
|
Ted C
2017/03/31 18:48:32
is this needed right now?
JJ
2017/03/31 19:01:20
Nope, sorry.
| |
| 78 }); | |
| 76 return convertView; | 79 return convertView; |
| 77 } | 80 } |
| 78 | 81 |
| 79 private static class ViewHolderItem { | 82 private static class ViewHolderItem { |
| 80 ImageView mIcon; | 83 ImageView mIcon; |
| 81 TextView mText; | 84 TextView mText; |
| 82 } | 85 } |
| 83 } | 86 } |
| OLD | NEW |