Commit 1a8fd934 authored by Yue Zhang's avatar Yue Zhang Committed by Commit Bot

Remove original content of SelectableItemView for SelectableTabGridView

http://crrev.com/c/2024495 makes SelectableItemView inflate
modern_list_item_view in its onFinishInflate(). However, even though
SelectableTabGridView extends SelectableItemView, it doesn't use the
views within it. Thus, this CL removes content from SelectableItemView
right after it is inflated to ensure the UI is correct.

Bug: 1047595
Change-Id: Ia4da1559c039be95a6463368c642b3c53f4f7c90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2033805
Commit-Queue: Yue Zhang <yuezhanggg@chromium.org>
Auto-Submit: Yue Zhang <yuezhanggg@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738401}
parent a02e0495
......@@ -12,6 +12,7 @@ import android.support.v4.content.res.ResourcesCompat;
import android.util.AttributeSet;
import android.widget.ImageView;
import org.chromium.chrome.tab_ui.R;
import org.chromium.components.browser_ui.widget.selectable_list.SelectableItemView;
/**
......@@ -27,19 +28,19 @@ public class SelectableTabGridView extends SelectableItemView<Integer> {
protected void onFinishInflate() {
super.onFinishInflate();
Drawable selectionListIcon = ResourcesCompat.getDrawable(getResources(),
org.chromium.chrome.tab_ui.R.drawable.tab_grid_selection_list_icon,
getContext().getTheme());
Drawable selectionListIcon = ResourcesCompat.getDrawable(
getResources(), R.drawable.tab_grid_selection_list_icon, getContext().getTheme());
InsetDrawable drawable = new InsetDrawable(selectionListIcon,
(int) getResources().getDimension(
org.chromium.chrome.tab_ui.R.dimen.selection_tab_grid_toggle_button_inset));
ImageView actionButton =
(ImageView) fastFindViewById(org.chromium.chrome.tab_ui.R.id.action_button);
(int) getResources().getDimension(R.dimen.selection_tab_grid_toggle_button_inset));
ImageView actionButton = (ImageView) fastFindViewById(R.id.action_button);
actionButton.setBackground(drawable);
actionButton.getBackground().setLevel(getResources().getInteger(
org.chromium.chrome.tab_ui.R.integer.list_item_level_default));
actionButton.setImageDrawable(AnimatedVectorDrawableCompat.create(getContext(),
org.chromium.chrome.tab_ui.R.drawable.ic_check_googblue_20dp_animated));
actionButton.getBackground().setLevel(
getResources().getInteger(R.integer.list_item_level_default));
actionButton.setImageDrawable(AnimatedVectorDrawableCompat.create(
getContext(), R.drawable.ic_check_googblue_20dp_animated));
// Remove the original content from SelectableItemView since we are not using them.
removeView(mContentView);
}
@Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment