Commit d55246f3 authored by Pavel Yatsuk's avatar Pavel Yatsuk Committed by Commit Bot

Fix snackbar layout for tablet

Snackbar layout is a RelativeLayout with top, left and right shadow views and
Linear layout with content. Because left and right shadows' bottoms are not
anchored to anything RelativeLayout allows them to grow to maximum  height.
This causes snackbar to push to the top of the screen.

Anchoring bottoms of side shadows to the bottom of content view forces
RelativeLayout to set their heights explicitly to the height of top shadow and
content, instead of letting shadow views expand to full height.

BUG=1035954
R=mdjones@chromium.org

Change-Id: I39be9b8db5136fb726ae9cdec5dc5df24823a5c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1977824
Commit-Queue: Pavel Yatsuk <pavely@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727606}
parent 277e68f9
...@@ -20,30 +20,32 @@ ...@@ -20,30 +20,32 @@
android:background="@drawable/infobar_shadow_top" /> android:background="@drawable/infobar_shadow_top" />
<View <View
android:id="@+id/snackbar_shadow_left" android:id="@id/snackbar_shadow_left"
android:layout_width="@dimen/snackbar_shadow_height" android:layout_width="@dimen/snackbar_shadow_height"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignTop="@id/snackbar_shadow_top" android:layout_alignTop="@id/snackbar_shadow_top"
android:layout_alignBottom="@+id/snackbar"
android:background="@drawable/infobar_shadow_left" android:background="@drawable/infobar_shadow_left"
android:visibility="gone" /> android:visibility="gone" />
<View <View
android:id="@+id/snackbar_shadow_right" android:id="@id/snackbar_shadow_right"
android:layout_width="@dimen/snackbar_shadow_height" android:layout_width="@dimen/snackbar_shadow_height"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignTop="@id/snackbar_shadow_top" android:layout_alignTop="@id/snackbar_shadow_top"
android:layout_alignBottom="@+id/snackbar"
android:background="@drawable/infobar_shadow_left" android:background="@drawable/infobar_shadow_left"
android:scaleX="-1" android:scaleX="-1"
android:visibility="gone" /> android:visibility="gone" />
<LinearLayout <LinearLayout
android:id="@+id/snackbar" android:id="@id/snackbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="@dimen/snackbar_min_height" android:minHeight="@dimen/snackbar_min_height"
android:layout_below="@+id/snackbar_shadow_top" android:layout_below="@id/snackbar_shadow_top"
android:layout_toEndOf="@id/snackbar_shadow_left" android:layout_toEndOf="@id/snackbar_shadow_left"
android:layout_toStartOf="@id/snackbar_shadow_right" android:layout_toStartOf="@id/snackbar_shadow_right"
android:orientation="horizontal" > android:orientation="horizontal" >
......
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