OSDN Git Service

Prevent clipping of shadow when button is pressed
authorPhilip P. Moltmann <moltmann@google.com>
Fri, 28 Apr 2017 00:19:33 +0000 (17:19 -0700)
committerPhilip P. Moltmann <moltmann@google.com>
Fri, 28 Apr 2017 21:17:05 +0000 (14:17 -0700)
Move padding around so that the shadow can blead into the padding.

Bug: 37754078
Test: Pressed button, took screenshot and checked for clipping
Change-Id: Iaed2c7e7c432061878af410ee270de97764bcadf

core/res/res/layout/autofill_save.xml

index cbea275..60df492 100644 (file)
@@ -25,7 +25,7 @@
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:layout_marginTop="32dp"
-        android:padding="16dp"
+        android:paddingTop="16dp"
         android:elevation="32dp"
         android:background="?android:attr/colorBackground"
         android:orientation="vertical">
         <LinearLayout
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
-            android:orientation="horizontal">
+            android:paddingLeft="16dp"
+            android:paddingRight="16dp"
+            android:orientation="vertical">
 
-            <TextView
-                android:id="@+id/autofill_save_title"
-                android:layout_width="0dp"
+            <LinearLayout
+                android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
-                android:text="@string/autofill_save_title"
-                android:textSize="16sp"
-                android:textColor="?android:attr/textColorPrimary"
-                android:layout_weight="1">
-            </TextView>
+                android:orientation="horizontal">
+
+                <TextView
+                    android:id="@+id/autofill_save_title"
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:text="@string/autofill_save_title"
+                    android:textSize="16sp"
+                    android:textColor="?android:attr/textColorPrimary"
+                    android:layout_weight="1">
+                </TextView>
+
+                <ImageView
+                    android:id="@+id/autofill_save_close"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="16dp"
+                    android:src="@android:drawable/ic_close"
+                    android:alpha="0.54"
+                    android:background="?android:attr/selectableItemBackgroundBorderless">
+                </ImageView>
+
+            </LinearLayout>
 
-            <ImageView
-                android:id="@+id/autofill_save_close"
-                android:layout_width="wrap_content"
+            <TextView
+                android:id="@+id/autofill_save_subtitle"
+                android:layout_width="fill_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="16dp"
-                android:src="@android:drawable/ic_close"
-                android:alpha="0.54"
-                android:background="?android:attr/selectableItemBackgroundBorderless">
-            </ImageView>
+                android:layout_marginTop="4dp"
+                android:visibility="gone">
+            </TextView>
 
         </LinearLayout>
 
-        <TextView
-            android:id="@+id/autofill_save_subtitle"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="4dp"
-            android:visibility="gone">
-        </TextView>
-
         <com.android.internal.widget.ButtonBarLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="end"
-            android:layout_marginTop="16dp"
+            android:padding="16dp"
+            android:clipToPadding="false"
             android:layout_weight="1"
             android:orientation="horizontal">