Bug 1130203 - Remove header container in share overlay & roughly style text. r=mhaigh
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 05 Feb 2015 19:29:01 -0800
changeset 265824 9a2166dd61dc9bf3f97f519295c52d2a6ebbdcc7
parent 265823 6d9a05956ad88a42d9bcd823e63e0d1b89400c23
child 265825 b29f773bd048f64662701f791c88b8076540c028
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 - Remove header container in share overlay & roughly style text. r=mhaigh Removing the header container also has the benefit of improving performance by flattening the View hierarchy. Note that this patch also improves performance by switching the outermost container from a RelativeLayout to a FrameLayout. Final text styling is awaiting UX mocks.
mobile/android/base/overlays/ui/ShareDialog.java
mobile/android/base/resources/layout/overlay_share_dialog.xml
mobile/android/base/resources/values/colors.xml
mobile/android/base/resources/values/styles.xml
--- a/mobile/android/base/overlays/ui/ShareDialog.java
+++ b/mobile/android/base/overlays/ui/ShareDialog.java
@@ -259,40 +259,42 @@ public class ShareDialog extends Locales
         final TextView subtitleView = (TextView) findViewById(R.id.subtitle);
         subtitleView.setText(pageUrl);
         subtitleView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
         subtitleView.setSingleLine(true);
         subtitleView.setMarqueeRepeatLimit(5);
         subtitleView.setSelected(true);
 
         final ImageView foxIcon = (ImageView) findViewById(R.id.share_overlay_icon);
-        final LinearLayout topBar = (LinearLayout) findViewById(R.id.share_overlay_top_bar);
+        final View titleView = findViewById(R.id.title);
 
         if (state == State.DEVICES_ONLY) {
             bookmarkButton.setVisibility(View.GONE);
             readingListButton.setVisibility(View.GONE);
 
             foxIcon.setOnClickListener(null);
-            topBar.setOnClickListener(null);
+            titleView.setOnClickListener(null);
+            subtitleView.setOnClickListener(null);
             return;
         }
 
         bookmarkButton.setVisibility(View.VISIBLE);
         readingListButton.setVisibility(View.VISIBLE);
 
         // Configure buttons.
         final View.OnClickListener launchBrowser = new View.OnClickListener() {
             @Override
             public void onClick(View view) {
                 ShareDialog.this.launchBrowser();
             }
         };
 
         foxIcon.setOnClickListener(launchBrowser);
-        topBar.setOnClickListener(launchBrowser);
+        titleView.setOnClickListener(launchBrowser);
+        subtitleView.setOnClickListener(launchBrowser);
 
         final LocalBrowserDB browserDB = new LocalBrowserDB(getCurrentProfile());
         setButtonState(url, browserDB);
 
         // Start the slide-up animation.
         final Animation anim = AnimationUtils.loadAnimation(this, R.anim.overlay_slide_up);
         findViewById(R.id.sharedialog).startAnimation(anim);
     }
--- a/mobile/android/base/resources/layout/overlay_share_dialog.xml
+++ b/mobile/android/base/resources/layout/overlay_share_dialog.xml
@@ -1,70 +1,51 @@
 <?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/. -->
 
 <!-- Serves to position the content on the screen (bottom, centered) and provide the drop-shadow -->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/sharedialog"
     android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
+    android:layout_height="match_parent"
     android:layout_marginLeft="15dp"
     android:layout_marginRight="15dp"
-    android:layout_marginBottom="-12dp"
     android:paddingTop="30dp"
-    android:layout_gravity="bottom|center"
     android:clipChildren="false"
     android:clipToPadding="false">
 
     <LinearLayout
-        android:id="@+id/share_overlay_content"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:layout_gravity="bottom|center"
         android:paddingTop="8dp"
-        android:orientation="vertical"
-        android:background="@drawable/share_overlay_background">
+        android:orientation="vertical">
 
-        <!-- Header -->
-        <LinearLayout
-            android:id="@+id/share_overlay_top_bar"
+        <!-- Title -->
+        <TextView
+            android:id="@+id/title"
+            style="@style/ShareOverlayTitle"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_margin="0dp"
-            android:background="@color/overlay_share_header_background"
-            android:orientation="vertical"
-            android:paddingTop="10dp"
-            android:paddingBottom="15dp"
-            android:paddingLeft="15dp"
-            android:paddingRight="15dp"
-            android:layout_gravity="center">
+            android:ellipsize="end"
+            android:maxLines="2"
+            android:scrollHorizontally="true"
+            android:textSize="24sp"/>
 
-            <!-- Title -->
-            <TextView
-                android:id="@+id/title"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:paddingBottom="7dp"
-                android:ellipsize="end"
-                android:maxLines="2"
-                android:scrollHorizontally="true"
-                android:textColor="@color/placeholder_active_grey"
-                android:textSize="17sp"/>
+        <!-- Subtitle (url) -->
+        <TextView
+            android:id="@+id/subtitle"
+            style="@style/ShareOverlayTitle"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"/>
 
-            <!-- Subtitle (url) -->
-            <TextView
-                android:id="@+id/subtitle"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:textColor="@color/placeholder_grey"/>
-
-        </LinearLayout>
-
+        <!-- TODO: Add back drop shadow? -->
         <!-- Buttons -->
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:background="@color/overlay_share_background"
             android:orientation="vertical">
 
             <!-- TODO: Once API 11 is available, stick "showDividers=middle" into the parent and get rid
@@ -103,14 +84,13 @@
         </LinearLayout>
     </LinearLayout>
 
     <!-- Firefox logo (has to appear higher in the z-order than the content. -->
     <ImageView
         android:id="@+id/share_overlay_icon"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_above="@+id/share_overlay_content"
+        android:layout_gravity="top|center"
         android:scaleType="center"
-        android:layout_centerHorizontal="true"
         android:src="@drawable/icon"
         android:layout_marginBottom="-6dp"/>
-</RelativeLayout>
+</FrameLayout>
--- a/mobile/android/base/resources/values/colors.xml
+++ b/mobile/android/base/resources/values/colors.xml
@@ -80,18 +80,16 @@
   <color name="text_color_primary_inverse">#F5F5F5</color>
   <color name="text_color_secondary_inverse">#DDDDDD</color>
   <color name="text_color_tertiary_inverse">#A4A7A9</color>
 
   <!-- Colour used for share overlay button labels -->
   <color name="text_color_overlaybtn">#666666</color>
   <color name="text_color_overlaybtn_disabled">#AFB1B3</color>
 
-  <color name="overlay_share_header_background">#FFFFFFFF</color>
-
   <!-- Colours used for share overlay button background -->
   <color name="overlay_share_background">#FFEBEBF0</color>
   <color name="overlay_share_selected">#FFF5F5F5</color>
 
   <!-- Disabled colors -->
   <color name="text_color_primary_disable_only">#999999</color>
 
   <!-- Hint colors -->
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -773,16 +773,24 @@
     </style>
 
     <style name="GeckoActionBar.Buttons">
         <item name="android:background">@android:color/transparent</item>
         <item name="android:textColor">@color/placeholder_active_grey</item>
         <item name="android:gravity">right</item>
     </style>
 
+    <style name="ShareOverlayTitle">
+        <item name="android:gravity">center_horizontal</item>
+        <item name="android:textColor">@android:color/white</item>
+        <item name="android:paddingBottom">18dp</item>
+        <item name="android:paddingLeft">15dp</item>
+        <item name="android:paddingRight">15dp</item>
+    </style>
+
     <!-- TODO: Clean up this and inherited styles. -->
     <style name="ShareOverlayButton">
         <item name="android:layout_width">match_parent</item>
         <item name="android:layout_height">wrap_content</item>
         <item name="android:minHeight">60dp</item>
         <item name="android:gravity">center_vertical</item>
         <item name="android:paddingLeft">15dp</item>
         <item name="android:paddingRight">15dp</item>