gello: revamp edge setup ui

CYAN-7103

Change-Id: I40c05c82858298fd11ef598d7e3971bdc0ba5081
Signed-off-by: jrizzoli <joey@cyanogenmoditalia.it>
diff --git a/res/drawable-nodpi/edge_header.png b/res/drawable-nodpi/edge_header.png
new file mode 100644
index 0000000..981fd60
--- /dev/null
+++ b/res/drawable-nodpi/edge_header.png
Binary files differ
diff --git a/res/layout/tab.xml b/res/layout/tab.xml
index 003c814..68eeaf6 100755
--- a/res/layout/tab.xml
+++ b/res/layout/tab.xml
@@ -28,7 +28,7 @@
     <ImageView android:id="@+id/navview_opacity"
         android:layout_gravity="top"
         android:scaleType="fitStart"
-        android:background="@android:color/black"
+        android:background="@color/black"
         android:visibility="gone"
         android:layout_width="match_parent"
         android:layout_height="match_parent" />
@@ -61,78 +61,95 @@
         android:layout_width="10dp"
         android:layout_height="match_parent" />
 
+    <!-- Edge setup screen -->
+
     <LinearLayout android:id="@+id/edge_sliding_settings"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
+        android:layout_height="fill_parent"
         android:visibility="gone"
-        android:background="#00838f"
-        android:alpha="0.92"
+        android:background="@color/mynav_primary"
+        android:layout_gravity="top"
         android:orientation="vertical">
-        <TextView
-            android:layout_width="wrap_content"
+        <ImageView
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_gravity="center"
-            android:gravity="center_horizontal|center_vertical"
-            android:layout_weight=".25"
-            android:textSize="32sp"
-            android:textColor="@color/white"
-            android:text="@string/pref_edge_swipe_title"/>
+            android:paddingTop="32dp"
+            android:layout_alignParentTop="true"
+            android:layout_centerHorizontal="true"
+            android:adjustViewBounds="true"
+            android:src="@drawable/edge_header"/>
 
-        <TextView
-            android:layout_width="wrap_content"
+        <FrameLayout android:id="@+id/edge_title_layout"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_gravity="center"
-            android:textSize="21sp"
-            android:textColor="@color/white"
-            android:text="@string/pref_edge_swipe_option_msg"/>
-
-        <RadioGroup
-            android:id="@+id/edge_sliding_settings_options"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_weight=".25"
-            android:layout_gravity="center_horizontal"
-            android:padding="10dp"
-            android:orientation="vertical">
-            <RadioButton
-                android:id="@+id/edge_sliding_settings_options_temporal"
+            android:paddingTop="16dp">
+            <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="@string/pref_temporal_edge_swipe"
+                android:textSize="32sp"
                 android:textColor="@color/white"
-                android:drawableEnd="@drawable/deco_swipe_temporal"
-                android:textSize="18sp"
-                android:padding="10dp"/>
-            <RadioButton
-                android:id="@+id/edge_sliding_settings_options_spatial"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/pref_spatial_edge_swipe"
-                android:textColor="@color/white"
-                android:drawableEnd="@drawable/deco_swipe_spatial"
-                android:textSize="18sp"
-                android:visibility="gone"
-                android:padding="10dp"/>
-            <RadioButton
-                android:id="@+id/edge_sliding_settings_options_disabled"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/pref_disable_edge_swipe"
-                android:textColor="@color/white"
-                android:textSize="18sp"
-                android:padding="10dp"/>
-        </RadioGroup>
-
-        <Button
-            android:id="@+id/edge_sliding_settings_close_btn"
+                android:paddingStart="16dp"
+                android:paddingEnd="16dp"
+                android:layout_gravity="top"
+                android:text="@string/pref_edge_swipe_title"/>
+        </FrameLayout>
+        <LinearLayout android:id="@+id/edge_content_layout"
+            android:paddingStart="16dp"
+            android:paddingEnd="16dp"
+            android:paddingTop="16dp"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="@string/pref_edge_swipe_option_close"
-            android:padding="10dp"
-            android:gravity="center_horizontal|center_vertical"
-            android:layout_gravity="center"
-            style="@android:style/Widget.Holo.Button.Borderless"/>
-
+            android:orientation="vertical"
+            android:layout_gravity="top">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/white"
+                android:textSize="18sp"
+                android:text="@string/pref_edge_swipe_setup_desc"/>
+            <RadioGroup
+                android:id="@+id/edge_sliding_settings_options"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:paddingTop="16dp"
+                android:paddingBottom="24dp">
+                <RadioButton
+                    android:id="@+id/edge_sliding_settings_options_temporal"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/pref_edge_enable"
+                    android:textColor="@color/white"
+                    android:paddingEnd="48dp"
+                    android:textSize="18sp"/>
+                <RadioButton
+                    android:id="@+id/edge_sliding_settings_options_spatial"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/pref_edge_enable"
+                    android:textColor="@color/white"
+                    android:textSize="18sp"
+                    android:visibility="gone"/>
+                <RadioButton
+                    android:id="@+id/edge_sliding_settings_options_disabled"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/pref_edge_disable"
+                    android:textColor="@color/white"
+                    android:textSize="18sp"/>
+            </RadioGroup>
+            <Button
+                android:id="@+id/edge_sliding_settings_close_btn"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:paddingEnd="16dp"
+                android:text="@string/pref_edge_swipe_option_close"
+                android:textColor="@color/mynav_accent"
+                android:textSize="16dp"
+                android:layout_alignParentEnd="true"
+                android:gravity="end"
+                style="@android:style/Widget.Material.Button.Borderless"/>
+        </LinearLayout>
     </LinearLayout>
 
 </com.android.browser.DraggableFrameLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 90b8962..c78cdb9 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -484,12 +484,12 @@
     <string name="pref_default_text_encoding">Text encoding</string>
     <!-- Do not translate. Actual encoding values. Must be valid text encodings understandable from WebKit. -->
     <string name="pref_default_text_encoding_default">UTF-8</string>
-    <string name="pref_edge_swipe_title">Edge swipe</string>
+    <string name="pref_edge_swipe_title">Edge navigation</string>
     <string name="pref_edge_swipe_option_msg">When swiping, would you like:</string>
     <string name="pref_temporal_edge_swipe">Previous/Next Web Site</string>
     <string name="pref_spatial_edge_swipe">Change Tab</string>
     <string name="pref_disable_edge_swipe">Do nothing</string>
-    <string name="pref_edge_swipe_option_close">Close</string>
+    <string name="pref_edge_swipe_option_close">Choose later</string>
     <string name="pref_temporal_edge_swipe_enabled_toast">Swipe from edge to navigate</string>
     <string name="pref_spatial_edge_swipe_enabled_toast">Swipe from edge to change tabs</string>
     <string name="pref_edge_swipe_disabled_toast">Swiping from edge disabled</string>
@@ -501,6 +501,9 @@
 -->
         <item>@string/pref_disable_edge_swipe</item>
     </string-array>
+    <string name="pref_edge_swipe_setup_desc">Swipe from the edge to navigate across history.\nThis feature may conflict with websites using edge-based actions</string>
+    <string name="pref_edge_enable">Enable</string>
+    <string name="pref_edge_disable">Disable</string>
     <string name="pref_coloredsb_title">Colored statusbar</string>
     <string name="pref_coloredsb_summary">Statusbar will change color basing on the visited page</string>
     <!-- Title for accessibility settings [CHAR LIMIT=25] -->