Commit 45b4009f authored by Wei-Yin Chen (陳威尹)'s avatar Wei-Yin Chen (陳威尹) Committed by Commit Bot

Remove card elevation in Tab Grid

The elevation is rendered slightly later than the View, and this
causes flickering when entering the Grid Tab Switcher (GTS), or
switching between normal/incognito mode in GTS.

The rendering of elevation is hardware-accelerated, and cannot be
captured in View.draw(Canvas). Removing the elevation eliminates
this discrepancy, and make it possible to have a smoother transition
from the captured Bitmap to the real Android View. We'll need this
when making the Tab to GTS transition animation.

Bug: 964406
Change-Id: I725f12a8dd186d4e6f848ef7bdef9a1cc8b9556d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617213
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661165}
parent 24da5587
...@@ -13,11 +13,10 @@ ...@@ -13,11 +13,10 @@
android:id="@+id/background_view" android:id="@+id/background_view"
android:background="@drawable/popup_bg" android:background="@drawable/popup_bg"
android:layout_margin="3dp" android:layout_margin="3dp"
android:visibility="gone"/> android:visibility="visible"/>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:elevation="4dp"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/tab_grid_card_background" android:background="@drawable/tab_grid_card_background"
android:layout_margin="8dp"> android:layout_margin="8dp">
...@@ -72,7 +71,6 @@ ...@@ -72,7 +71,6 @@
android:id="@+id/close_button" android:id="@+id/close_button"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:elevation="4dp"
android:scaleType="center" android:scaleType="center"
android:layout_gravity="end" android:layout_gravity="end"
android:tint="@color/modern_grey_800" android:tint="@color/modern_grey_800"
......
...@@ -51,7 +51,6 @@ class TabGridViewBinder { ...@@ -51,7 +51,6 @@ class TabGridViewBinder {
(int) res.getDimension(R.dimen.tab_list_selected_inset_kitkat)); (int) res.getDimension(R.dimen.tab_list_selected_inset_kitkat));
Drawable elevationDrawable = Drawable elevationDrawable =
ResourcesCompat.getDrawable(res, R.drawable.popup_bg, theme); ResourcesCompat.getDrawable(res, R.drawable.popup_bg, theme);
holder.backgroundView.setVisibility(View.VISIBLE);
holder.backgroundView.setBackground( holder.backgroundView.setBackground(
item.get(TabProperties.IS_SELECTED) ? selectedDrawable : elevationDrawable); item.get(TabProperties.IS_SELECTED) ? selectedDrawable : elevationDrawable);
} else { } else {
......
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