Bug 1254555 - Unnecessary scroll to reveal full first run panel. r=mhoye draft
authorShubham <shubham2892@gmail.com>
Wed, 21 Sep 2016 15:48:49 -0400
changeset 416271 a244097b221fdc68384e49908ad544c15cfbd440
parent 403581 f97a056ae6235de7855fd8aaa04fb1c8d183bd06
child 531801 d7e2b6439ad4658f40815b232c89b49fdae24206
push id30085
push userbmo:shubham2892@gmail.com
push dateWed, 21 Sep 2016 19:59:44 +0000
reviewersmhoye
bugs1254555
milestone51.0a1
Bug 1254555 - Unnecessary scroll to reveal full first run panel. r=mhoye MozReview-Commit-ID: E7V4L1SRvbt
mobile/android/base/resources/layout/firstrun_basepanel_checkable_fragment.xml
--- a/mobile/android/base/resources/layout/firstrun_basepanel_checkable_fragment.xml
+++ b/mobile/android/base/resources/layout/firstrun_basepanel_checkable_fragment.xml
@@ -1,58 +1,67 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-            android:layout_height="wrap_content"
+            android:layout_height="match_parent"
             android:layout_width="match_parent"
             android:orientation="vertical"
             android:fillViewport="true">
 
-    <LinearLayout android:layout_width="match_parent"
+    <RelativeLayout android:layout_width="match_parent"
                   android:layout_height="wrap_content"
                   android:minHeight="@dimen/firstrun_min_height"
                   android:background="@color/about_page_header_grey"
                   android:gravity="center_horizontal"
                   android:orientation="vertical">
 
         <ImageView android:id="@+id/firstrun_image"
                    android:layout_width="wrap_content"
                    android:layout_height="@dimen/firstrun_background_height"
+                   android:layout_centerHorizontal="true"
                    android:layout_marginTop="40dp"
                    android:layout_marginBottom="40dp"
                    android:scaleType="fitCenter"
                    android:layout_gravity="center"
                    android:adjustViewBounds="true"/>
 
         <TextView android:id="@+id/firstrun_text"
                   android:layout_width="@dimen/firstrun_content_width"
                   android:layout_height="wrap_content"
-                  android:gravity="center"
+                  android:gravity="center_horizontal"
+                  android:layout_centerHorizontal="true"
+                  android:layout_below="@id/firstrun_image"
                   android:textAppearance="@style/TextAppearance.FirstrunLight.Main"/>
 
         <TextView android:id="@+id/firstrun_subtext"
                   android:layout_width="@dimen/firstrun_content_width"
                   android:layout_height="wrap_content"
                   android:paddingTop="20dp"
+                  android:layout_centerHorizontal="true"
                   android:paddingBottom="30dp"
-                  android:gravity="center"
+                  android:gravity="center_horizontal"
+                  android:layout_below="@id/firstrun_text"
                   android:textAppearance="@style/TextAppearance.FirstrunRegular.Body"/>
 
         <android.support.v7.widget.SwitchCompat
                   android:id="@+id/firstrun_switch"
                   android:layout_width="wrap_content"
-                  android:layout_height="0dp"
-                  android:layout_weight="1"
-                  android:visibility="invisible"/>
+                  android:layout_height="wrap_content"
+                  android:gravity="center_horizontal"
+                  android:layout_centerHorizontal="true"
+                  android:layout_below="@id/firstrun_subtext"
+                  android:visibility="gone"/>
 
         <TextView android:id="@+id/firstrun_link"
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:padding="30dp"
-                  android:gravity="center"
+                  android:gravity="center_horizontal"
+                  android:layout_alignParentBottom="true"
+                  android:layout_centerHorizontal="true"
                   android:textAppearance="@style/TextAppearance.FirstrunRegular.Link"
                   android:text="@string/firstrun_button_next"/>
-    </LinearLayout>
+    </RelativeLayout>
 </ScrollView>