Bug 1130203 - Clean up share overlay toast styles. r=mhaigh a=sylvestre
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 19 Mar 2015 17:47:30 -0700
changeset 258350 8a05ce8c5ff7
parent 258349 abff0e240078
child 258351 dd5f8068b392
push id4648
push usermichael.l.comella@gmail.com
push date2015-04-08 16:26 +0000
treeherdermozilla-beta@e399294c9df3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh, sylvestre
bugs1130203
milestone38.0
Bug 1130203 - Clean up share overlay toast styles. r=mhaigh a=sylvestre
mobile/android/base/overlays/ui/OverlayToastHelper.java
mobile/android/base/resources/drawable/toolbar_grey_round.xml
mobile/android/base/resources/layout/overlay_share_toast.xml
--- a/mobile/android/base/overlays/ui/OverlayToastHelper.java
+++ b/mobile/android/base/overlays/ui/OverlayToastHelper.java
@@ -49,28 +49,26 @@ public class OverlayToastHelper {
 
         View layout = inflater.inflate(R.layout.overlay_share_toast, null);
 
         TextView text = (TextView) layout.findViewById(R.id.overlay_toast_message);
         text.setText(message);
 
         if (retryListener == null) {
             // Hide the retry button.
-            layout.findViewById(R.id.overlay_toast_separator).setVisibility(View.GONE);
             layout.findViewById(R.id.overlay_toast_retry_btn).setVisibility(View.GONE);
         } else {
             // Set up the button to perform a retry.
             Button retryBtn = (Button) layout.findViewById(R.id.overlay_toast_retry_btn);
             retryBtn.setOnClickListener(retryListener);
         }
 
         if (!success) {
             // Hide the happy green tick.
             text.setCompoundDrawables(null, null, null, null);
         }
 
         Toast toast = new Toast(context);
-        toast.setGravity(Gravity.CENTER_VERTICAL | Gravity.BOTTOM, 0, 0);
         toast.setDuration(Toast.LENGTH_SHORT);
         toast.setView(layout);
         toast.show();
     }
 }
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable/toolbar_grey_round.xml
@@ -0,0 +1,10 @@
+<?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/. -->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/toolbar_grey"/>
+    <corners android:radius="@dimen/button_corner_radius"/>
+</shape>
+
--- a/mobile/android/base/resources/layout/overlay_share_toast.xml
+++ b/mobile/android/base/resources/layout/overlay_share_toast.xml
@@ -1,64 +1,35 @@
 <?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/. -->
 
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/overlay_share_toast"
-    android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:orientation="vertical"
-    android:background="@drawable/share_overlay_background"
-    android:layout_marginLeft="5dp"
-    android:layout_marginRight="5dp"
-    android:layout_gravity="bottom|center">
-
-    <!-- Header -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_margin="0dp"
-        android:background="@color/background_light"
-        android:orientation="horizontal"
-        android:paddingLeft="5dp"
-        android:paddingRight="10dp"
-        android:paddingTop="5dp"
-        android:paddingBottom="5dp">
+    android:background="@drawable/toolbar_grey_round"
+    android:orientation="horizontal"
+    android:padding="20dp">
 
-        <!-- Large attractive green tick with label to the right -->
-        <TextView
-            android:textAppearance="@style/ShareOverlayTextAppearance.Button"
-            android:id="@+id/overlay_toast_message"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:maxLines="1"
-            android:textColor="@color/text_color_primary"
-            android:textSize="14sp"
-            android:minHeight="60dp"
-            android:paddingLeft="15dp"
-            android:paddingRight="15dp"
-            android:paddingTop="17dp"
-            android:paddingBottom="17dp"
-            android:drawablePadding="15dp"
-            android:drawableLeft="@drawable/overlay_check"/>
+    <TextView
+        android:id="@+id/overlay_toast_message"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_vertical"
+        android:layout_weight="2"
+        android:layout_marginRight="10dp"
+        android:textColor="@color/text_and_tabs_tray_grey"
+        android:textSize="14sp"
+        android:drawablePadding="15dp"
+        android:drawableLeft="@drawable/overlay_check"/>
 
-        <!-- Evil separator -->
-        <View
-            android:id="@+id/overlay_toast_separator"
-            android:layout_marginTop="15dp"
-            android:layout_marginBottom="15dp"
-            android:layout_height="match_parent"
-            android:layout_width="1dp"
-            android:background="@color/background_light"/>
+    <!-- Retry button -->
+    <Button
+        android:id="@+id/overlay_toast_retry_btn"
+        android:layout_height="wrap_content"
+        android:layout_width="wrap_content"
+        android:layout_weight="1"
+        android:text="@string/overlay_share_retry"
+        android:onClick="selfDestruct" />
 
-        <!-- Retry button -->
-        <Button
-            android:id="@+id/overlay_toast_retry_btn"
-            android:layout_height="wrap_content"
-            android:layout_width="wrap_content"
-            android:text="@string/overlay_share_retry"
-            android:onClick="selfDestruct" />
-
-    </LinearLayout>
 </LinearLayout>