Commit ed44a1c8 authored by Yue Zhang's avatar Yue Zhang Committed by Commit Bot

Fix favicon misbehavior in TabGridDialog animation

To build the TabGridDialog show/hide animation, we create an animation
card view that looks very similar to a GridTabSwitcher card view.
However, when trying to clone the layout of the GridTabSwitcher card
view, we missed out the padding setup for the favicon which leads to
some visual misbehavior for the animation. This CL fixes this issue
by making the padding of the favicon in animation card view same
as that of GridTabSwitcher card view (https://source.chromium.org/chromium/chromium/src/+/master:chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java;l=142;drc=6fd9af2e6b5ed2f65a762090823ddf8c09e95ae4;bpv=1;bpt=0)

Bug: 1136328
Change-Id: Ibf2ce5d8dbd3bc4dfa9505812b9795dae5fde602
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2460249
Auto-Submit: Yue Zhang <yuezhanggg@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Commit-Queue: Yue Zhang <yuezhanggg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818534}
parent 35e78f28
......@@ -618,9 +618,14 @@ public class TabGridDialogView extends FrameLayout {
mAnimationCardView.findViewById(R.id.card_view)
.setBackground(view.findViewById(R.id.card_view).getBackground());
((ImageView) (mAnimationCardView.findViewById(R.id.tab_favicon)))
.setImageDrawable(
((ImageView) (view.findViewById(R.id.tab_favicon))).getDrawable());
ImageView sourceCardFavicon = view.findViewById(R.id.tab_favicon);
ImageView animationCardFavicon = mAnimationCardView.findViewById(R.id.tab_favicon);
if (sourceCardFavicon.getDrawable() != null) {
int padding =
mContext.getResources().getDimensionPixelSize(R.dimen.tab_list_card_padding);
animationCardFavicon.setPadding(padding, padding, padding, padding);
animationCardFavicon.setImageDrawable(sourceCardFavicon.getDrawable());
}
((TextView) (mAnimationCardView.findViewById(R.id.tab_title)))
.setText(((TextView) (view.findViewById(R.id.tab_title))).getText());
......
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