Index: chrome/android/java/res/layout/data_reduction_promo_screen.xml |
diff --git a/chrome/android/java/res/layout/data_reduction_promo_screen.xml b/chrome/android/java/res/layout/data_reduction_promo_screen.xml |
index d0fe45f7a86f06c1d53a087196f5e997a22f8dc7..96a3cb01b067984551fb3bd65e53c3a716b09d5e 100644 |
--- a/chrome/android/java/res/layout/data_reduction_promo_screen.xml |
+++ b/chrome/android/java/res/layout/data_reduction_promo_screen.xml |
@@ -35,18 +35,18 @@ |
android:layout_height="wrap_content" |
android:layout_width="match_parent" |
android:layout_below="@+id/close_button" |
- android:layout_marginTop="8dp" |
+ android:layout_marginTop="16dp" |
android:orientation="vertical" |
android:paddingEnd="24dp" |
android:paddingStart="24dp" > |
<ImageView |
android:layout_height="wrap_content" |
- android:layout_width="match_parent" |
- android:layout_marginBottom="24dp" |
+ android:layout_width="wrap_content" |
+ android:layout_gravity="center_horizontal" |
+ android:layout_marginBottom="@dimen/data_reduction_promo_illustration_margin_bottom" |
android:adjustViewBounds="true" |
android:contentDescription="@null" |
- android:gravity="center" |
android:src="@drawable/data_reduction_illustration" /> |
<TextView |
@@ -66,35 +66,54 @@ |
android:textSize="@dimen/data_reduction_promo_normal_text_size" /> |
</LinearLayout> |
- <LinearLayout |
+ <FrameLayout |
android:layout_height="wrap_content" |
android:layout_width="match_parent" |
android:layout_alignParentBottom="true" |
- android:layout_below="@id/data_reduction_promo_text" |
- android:padding="16dp" |
- android:clipToPadding="false" |
- android:gravity="end|bottom" |
- android:orientation="horizontal" > |
- <org.chromium.ui.widget.ButtonCompat |
- android:id="@+id/no_thanks_button" |
- android:layout_height="wrap_content" |
- android:layout_width="wrap_content" |
- android:layout_marginEnd="8dp" |
- android:minHeight="40dp" |
- android:text="@string/no_thanks" |
- android:textColor="@color/light_normal_color" |
- android:textSize="@dimen/data_reduction_promo_button_text_size" |
- chrome:buttonColor="#FFFFFF" /> |
- <org.chromium.ui.widget.ButtonCompat |
- android:id="@+id/enable_button" |
+ android:layout_below="@id/data_reduction_promo_text" > |
+ |
+ <!-- The FrameLayout must have layout_below so that the buttons don't |
+ overlap the text. This causes the FrameLayout to extend from |
+ data_reduction_promo_text to the bottom of the RelativeLayout. |
+ In order for the buttons to adjust their height when the screen |
+ size causes multiple lines of text, but not be the size of the |
+ empty space between the text and bottom of the promo we need |
+ this second LinearLayout. --> |
+ <LinearLayout |
android:layout_height="wrap_content" |
- android:layout_width="wrap_content" |
- android:minHeight="40dp" |
- android:text="@string/data_reduction_enable_button" |
- android:textColor="#FFFFFF" |
- android:textSize="@dimen/data_reduction_promo_button_text_size" |
- chrome:buttonColor="@color/light_active_color" /> |
- </LinearLayout> |
+ android:layout_width="match_parent" |
+ android:layout_gravity="bottom" |
+ android:orientation="horizontal" |
+ android:clipToPadding="false" |
+ android:padding="16dp" |
+ android:gravity="end" > |
+ |
+ <org.chromium.ui.widget.ButtonCompat |
+ android:id="@+id/no_thanks_button" |
+ android:layout_height="match_parent" |
+ android:layout_width="wrap_content" |
+ android:layout_marginEnd="8dp" |
+ android:layout_weight="1" |
+ android:minHeight="40dp" |
+ android:text="@string/no_thanks" |
+ android:textColor="@color/light_normal_color" |
+ android:textSize="@dimen/data_reduction_promo_button_text_size" |
+ chrome:buttonColor="#FFFFFF" |
+ style="@style/ButtonCompatBorderless" /> |
+ |
+ <org.chromium.ui.widget.ButtonCompat |
+ android:id="@+id/enable_button" |
+ android:layout_height="match_parent" |
+ android:layout_width="wrap_content" |
+ android:layout_weight="1" |
+ android:elevation="0dp" |
+ android:minHeight="40dp" |
+ android:text="@string/data_reduction_enable_button" |
+ android:textColor="#FFFFFF" |
+ android:textSize="@dimen/data_reduction_promo_button_text_size" |
+ chrome:buttonColor="@color/light_active_color" /> |
+ </LinearLayout> |
+ </FrameLayout> |
</RelativeLayout> |
</ScrollView> |
</org.chromium.chrome.browser.widget.PaddedFrameLayout> |