Bug 1130203 - Clean up share overlay toast styles. r=mhaigh
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 19 Mar 2015 17:47:30 -0700
changeset 265839 70cebff5abed7b39f903aad8f8833cb13605261c
parent 265838 570d7c14c38d008d57dc8a8598060dc5f62f6965
child 265840 8c3212c240bc88356e454109c60a8f31426a7b6f
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh
bugs1130203
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1130203 - Clean up share overlay toast styles. r=mhaigh
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/placeholder_active_grey"
-            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>