Bug 817739: Theme change for synced tabs. [r=mfinkle] [a=bbajaj]
authorSriram Ramasubramanian <sriram@mozilla.com>
Thu, 10 Jan 2013 13:06:32 -0800
changeset 127276 e23eeead407fd955fbfd521b2c0d3836aa5137d6
parent 127275 db530424953a685b9c8e67f05a8de2af66b49ae3
child 127277 e936ec3bd4324c4584eaf0894d702ff79f8c1809
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, bbajaj
bugs817739
milestone20.0a2
Bug 817739: Theme change for synced tabs. [r=mfinkle] [a=bbajaj]
mobile/android/base/Makefile.in
mobile/android/base/RemoteTabs.java
mobile/android/base/TabsPanel.java
mobile/android/base/resources/drawable/remote_tabs_child_divider.xml
mobile/android/base/resources/drawable/tabs_tray_list_divider.xml
mobile/android/base/resources/layout-xlarge-v11/remote_tabs_child.xml
mobile/android/base/resources/layout-xlarge-v11/remote_tabs_group.xml
mobile/android/base/resources/layout-xlarge-v11/tabs_panel_toolbar_menu.xml
mobile/android/base/resources/layout/remote_tabs_child.xml
mobile/android/base/resources/layout/remote_tabs_group.xml
mobile/android/base/resources/layout/tabs_panel.xml.in
mobile/android/base/resources/values-xlarge-v11/dimens.xml
mobile/android/base/resources/values/dimens.xml
mobile/android/base/resources/values/styles.xml
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -1071,29 +1071,29 @@ MOZ_ANDROID_DRAWABLES += \
   mobile/android/base/resources/drawable/progress_spinner_5.png                 \
   mobile/android/base/resources/drawable/progress_spinner_6.png                 \
   mobile/android/base/resources/drawable/progress_spinner_7.png                 \
   mobile/android/base/resources/drawable/progress_spinner_8.png                 \
   mobile/android/base/resources/drawable/progress_spinner_9.png                 \
   mobile/android/base/resources/drawable/progress_spinner_10.png                \
   mobile/android/base/resources/drawable/progress_spinner_11.png                \
   mobile/android/base/resources/drawable/progress_spinner_12.png                \
+  mobile/android/base/resources/drawable/remote_tabs_child_divider.xml          \
   mobile/android/base/resources/drawable/remote_tabs_level.xml                  \
   mobile/android/base/resources/drawable/start.png                              \
   mobile/android/base/resources/drawable/site_security_level.xml                \
   mobile/android/base/resources/drawable/suggestion_selector.xml                \
   mobile/android/base/resources/drawable/tab_new_level.xml                      \
   mobile/android/base/resources/drawable/tabs_button.xml                        \
   mobile/android/base/resources/drawable/tabs_level.xml                         \
   mobile/android/base/resources/drawable/tabs_panel_indicator.xml               \
   mobile/android/base/resources/drawable/tabs_tray_bg_repeat.xml                \
   mobile/android/base/resources/drawable/tabs_tray_selected_bg_repeat.xml       \
   mobile/android/base/resources/drawable/tabs_tray_active_selector.xml          \
   mobile/android/base/resources/drawable/tabs_tray_default_selector.xml         \
-  mobile/android/base/resources/drawable/tabs_tray_list_divider.xml             \
   mobile/android/base/resources/drawable/shadow.png                             \
   mobile/android/base/resources/drawable/marketplace.png                        \
   mobile/android/base/resources/drawable/webapp_titlebar_bg.xml                 \
   $(NULL)
 
 MOZ_BRANDING_DRAWABLE_MDPI = $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn | tr '\n' ' ';  fi)
 MOZ_BRANDING_DRAWABLE_HDPI = $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-hdpi.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-hdpi.mn | tr '\n' ' ';  fi)
 MOZ_BRANDING_DRAWABLE_XHDPI = $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-xhdpi.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-xhdpi.mn | tr '\n' ' ';  fi)
--- a/mobile/android/base/RemoteTabs.java
+++ b/mobile/android/base/RemoteTabs.java
@@ -29,19 +29,19 @@ public class RemoteTabs extends Expandab
     private static final String LOGTAG = "GeckoRemoteTabs";
 
     private Context mContext;
     private TabsPanel mTabsPanel;
 
     private static ArrayList <ArrayList <HashMap <String, String>>> mTabsList;
 
     private static final String[] CLIENT_KEY = new String[] { "name" };
-    private static final String[] TAB_KEY = new String[] { "title" };
+    private static final String[] TAB_KEY = new String[] { "title", "url" };
     private static final int[] CLIENT_RESOURCE = new int[] { R.id.client };
-    private static final int[] TAB_RESOURCE = new int[] { R.id.tab };
+    private static final int[] TAB_RESOURCE = new int[] { R.id.tab, R.id.url };
 
     public RemoteTabs(Context context, AttributeSet attrs) {
         super(context, attrs);
         mContext = context;
 
         setOnGroupClickListener(this);
         setOnChildClickListener(this);
     }
--- a/mobile/android/base/TabsPanel.java
+++ b/mobile/android/base/TabsPanel.java
@@ -68,19 +68,16 @@ public class TabsPanel extends TabHost
     private boolean mInflated;
 
     private GeckoPopupMenu mPopupMenu;
     private Menu mMenu;
 
     private GeckoPopupMenu mTabsPopupMenu;
     private Menu mTabsMenu;
 
-    private static final int REMOTE_TABS_HIDDEN = 1;
-    private static final int REMOTE_TABS_SHOWN = 2;
-
     public TabsPanel(Context context, AttributeSet attrs) {
         super(context, attrs);
         mContext = context;
         mActivity = (GeckoApp) context;
 
         mCurrentPanel = Panel.NORMAL_TABS;
         mVisible = false;
 
@@ -377,19 +374,21 @@ public class TabsPanel extends TabHost
         int index = panel.ordinal();
         setCurrentTab(index);
 
         mPanel = (PanelView) getTabContentView().getChildAt(index);
         mPanel.show();
 
         if (mCurrentPanel == Panel.REMOTE_TABS) {
             mAddTab.setVisibility(View.INVISIBLE);
+            mMenuButton.setVisibility(View.INVISIBLE);
         } else {
             mAddTab.setVisibility(View.VISIBLE);
             mAddTab.setImageLevel(index);
+            mMenuButton.setVisibility(View.VISIBLE);
         }
 
         if (isSideBar()) {
             if (showAnimation)
                 dispatchLayoutChange(getWidth(), getHeight());
         } else {
             int actionBarHeight = mContext.getResources().getDimensionPixelSize(R.dimen.browser_toolbar_height);
             int height = actionBarHeight + getTabContainerHeight(getTabContentView());
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable/remote_tabs_child_divider.xml
@@ -0,0 +1,12 @@
+<?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"
+       android:shape="rectangle">
+
+       <size android:height="1dp"/>
+       <solid android:color="#FF313131"/>
+
+</shape>
deleted file mode 100644
--- a/mobile/android/base/resources/drawable/tabs_tray_list_divider.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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/. -->
-
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item>
-
-        <shape android:shape="rectangle">
-             <size android:height="1dp"/>
-             <solid android:color="#4C5157"/>
-        </shape>
-
-    </item>
-
-    <item android:top="1dp">
-
-        <shape android:shape="rectangle">
-             <size android:height="1dp"/>
-             <solid android:color="#7A7E81"/>
-        </shape>
-
-    </item>
-
-</layer-list>
--- a/mobile/android/base/resources/layout-xlarge-v11/remote_tabs_child.xml
+++ b/mobile/android/base/resources/layout-xlarge-v11/remote_tabs_child.xml
@@ -1,15 +1,27 @@
 <?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/. -->
 
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-          android:id="@+id/tab"
-          android:layout_width="fill_parent"
-          android:layout_height="@dimen/remote_tab_child_row_height"
-          style="@style/TabRowTextAppearance"
-          android:paddingLeft="10dip"
-          android:paddingRight="10dip"
-          android:textSize="14sp"
-          android:background="@drawable/tabs_tray_default_selector"
-          android:gravity="center_vertical"/>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:layout_width="fill_parent"
+              android:layout_height="@dimen/remote_tab_child_row_height"
+              android:gravity="center_vertical"
+              android:orientation="vertical"
+              android:background="@drawable/tabs_tray_default_selector"
+              android:paddingLeft="2dp"
+              android:paddingRight="2dp">
+
+    <TextView android:id="@+id/tab"
+              android:layout_width="fill_parent"
+              android:layout_height="wrap_content"
+              style="@style/RemoteTabRowTextAppearance"
+              android:textSize="14sp"/>
+
+    <TextView android:id="@+id/url"
+              android:layout_width="fill_parent"
+              android:layout_height="wrap_content"
+              style="@style/RemoteTabRowTextAppearance.Url"
+              android:textSize="12sp"/>
+
+</LinearLayout>
--- a/mobile/android/base/resources/layout-xlarge-v11/remote_tabs_group.xml
+++ b/mobile/android/base/resources/layout-xlarge-v11/remote_tabs_group.xml
@@ -1,18 +1,18 @@
 <?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/. -->
 
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-          android:id="@+id/client"
-          android:layout_width="fill_parent"
-          android:layout_height="@dimen/remote_tab_group_row_height"
-          style="@style/TabRowTextAppearance"
-          android:paddingLeft="10dip"
-          android:paddingRight="10dip"
-          android:textStyle="bold"
-          android:textSize="13sp"
-          android:singleLine="false"
-          android:maxLines="2"
-          android:background="@drawable/tabs_tray_selected_bg_repeat"
-          android:gravity="center_vertical"/>
+<Gecko.AllCapsTextView xmlns:android="http://schemas.android.com/apk/res/android"
+                       android:id="@+id/client"
+                       android:layout_width="fill_parent"
+                       android:layout_height="@dimen/remote_tab_group_row_height"
+                       style="@style/RemoteTabRowTextAppearance.Url"
+                       android:background="@android:color/transparent"
+                       android:paddingLeft="2dip"
+                       android:paddingRight="2dip"
+                       android:textStyle="bold"
+                       android:textSize="12sp"
+                       android:singleLine="false"
+                       android:maxLines="2"
+                       android:gravity="center_vertical"/>
--- a/mobile/android/base/resources/layout-xlarge-v11/tabs_panel_toolbar_menu.xml
+++ b/mobile/android/base/resources/layout-xlarge-v11/tabs_panel_toolbar_menu.xml
@@ -10,17 +10,18 @@
                android:layout_height="0dip"
                android:visibility="gone"/>
 
     <Button android:id="@+id/tabs_menu"
             android:layout_width="0dip"
             android:layout_height="fill_parent"
             android:layout_weight="1.0"
             android:text="@string/tabs_normal"
-            android:textColor="@color/tabs_counter_color"
+            android:textColor="#FFFFFFFF"
+            android:textSize="18sp"
             android:background="@drawable/action_bar_button"/>
 
     <ImageButton android:id="@+id/add_tab"
                  android:layout_width="@dimen/browser_toolbar_height"
                  android:layout_height="@dimen/browser_toolbar_height"
                  android:paddingTop="15dip"
                  android:paddingBottom="15dip"
                  android:paddingLeft="20dip"
--- a/mobile/android/base/resources/layout/remote_tabs_child.xml
+++ b/mobile/android/base/resources/layout/remote_tabs_child.xml
@@ -1,15 +1,27 @@
 <?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/. -->
 
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-          android:id="@+id/tab"
-          android:layout_width="fill_parent"
-          android:layout_height="@dimen/remote_tab_child_row_height"
-          style="@style/TabRowTextAppearance"
-          android:paddingLeft="10dip"
-          android:paddingRight="10dip"
-          android:textSize="16sp"
-          android:background="@drawable/tabs_tray_default_selector"
-          android:gravity="center_vertical"/>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              android:layout_width="fill_parent"
+              android:layout_height="@dimen/remote_tab_child_row_height"
+              android:gravity="center_vertical"
+              android:orientation="vertical"
+              android:background="@drawable/tabs_tray_default_selector"
+              android:paddingLeft="4dp"
+              android:paddingRight="4dp">
+
+    <TextView android:id="@+id/tab"
+              android:layout_width="fill_parent"
+              android:layout_height="wrap_content"
+              style="@style/RemoteTabRowTextAppearance"
+              android:textSize="18sp"/>
+
+    <TextView android:id="@+id/url"
+              android:layout_width="fill_parent"
+              android:layout_height="wrap_content"
+              style="@style/RemoteTabRowTextAppearance.Url"
+              android:textSize="14sp"/>
+
+</LinearLayout>
--- a/mobile/android/base/resources/layout/remote_tabs_group.xml
+++ b/mobile/android/base/resources/layout/remote_tabs_group.xml
@@ -1,16 +1,16 @@
 <?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/. -->
 
-<TextView xmlns:android="http://schemas.android.com/apk/res/android"
-          android:id="@+id/client"
-          android:layout_width="fill_parent"
-          android:layout_height="@dimen/remote_tab_group_row_height"
-          style="@style/TabRowTextAppearance"
-          android:paddingLeft="10dip"
-          android:paddingRight="10dip"
-          android:textStyle="bold"
-          android:textSize="14sp"
-          android:background="@drawable/tabs_tray_selected_bg_repeat"
-          android:gravity="center_vertical"/>
+<Gecko.AllCapsTextView xmlns:android="http://schemas.android.com/apk/res/android"
+                       android:id="@+id/client"
+                       android:layout_width="fill_parent"
+                       android:layout_height="@dimen/remote_tab_group_row_height"
+                       style="@style/RemoteTabRowTextAppearance.Url"
+                       android:background="@android:color/transparent"
+                       android:paddingLeft="4dp"
+                       android:paddingRight="4dp"
+                       android:textStyle="bold"
+                       android:textSize="14sp"
+                       android:gravity="center_vertical"/>
--- a/mobile/android/base/resources/layout/tabs_panel.xml.in
+++ b/mobile/android/base/resources/layout/tabs_panel.xml.in
@@ -35,15 +35,18 @@
                                         style="@style/TabsList"
                                         android:layout_width="fill_parent"
                                         android:layout_height="fill_parent"
                                         gecko:tabs="tabs_private"/>
 
             <org.mozilla.gecko.RemoteTabs android:id="@+id/synced_tabs"
                                           style="@style/RemoteTabsList"
                                           android:layout_width="fill_parent"
-                                          android:layout_height="fill_parent"/>
+                                          android:layout_height="fill_parent"
+                                          android:paddingLeft="@dimen/tabs_panel_list_padding"
+                                          android:paddingRight="@dimen/tabs_panel_list_padding"
+                                          android:scrollbarStyle="outsideOverlay"/>
 
         </view>
 
    </LinearLayout>
 
 </merge>
--- a/mobile/android/base/resources/values-xlarge-v11/dimens.xml
+++ b/mobile/android/base/resources/values-xlarge-v11/dimens.xml
@@ -8,14 +8,15 @@
     <dimen name="abouthome_gutter_small">20dp</dimen>
     <dimen name="abouthome_gutter_large">40dp</dimen>
     <dimen name="abouthome_icon_crop">0dp</dimen>
     <dimen name="awesomebar_header_row_height">24dp</dimen>
     <dimen name="awesomebar_row_height">66dp</dimen>
     <dimen name="awesomebar_tab_transparency_height">46dp</dimen>
     <dimen name="browser_toolbar_height">56dp</dimen>
     <dimen name="local_tab_row_height">150dp</dimen>
-    <dimen name="remote_tab_child_row_height">48dp</dimen>
-    <dimen name="remote_tab_group_row_height">28dp</dimen>
+    <dimen name="remote_tab_child_row_height">56dp</dimen>
+    <dimen name="remote_tab_group_row_height">34dp</dimen>
     <dimen name="tabs_counter_size">26sp</dimen>
+    <dimen name="tabs_panel_list_padding">8dip</dimen>
     <dimen name="addressbar_offset_left">84dip</dimen>
 
 </resources>
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -36,22 +36,23 @@
     <dimen name="menu_popup_offset">8dp</dimen>
     <dimen name="menu_popup_width">256dp</dimen>
     <dimen name="nav_button_border_width">1dp</dimen>
     <dimen name="prompt_service_group_padding_size">32dp</dimen>
     <dimen name="prompt_service_icon_size">72dp</dimen>
     <dimen name="prompt_service_icon_text_padding">10dp</dimen>
     <dimen name="prompt_service_left_right_text_with_icon_padding">10dp</dimen>
     <dimen name="prompt_service_top_bottom_text_with_icon_padding">8dp</dimen>
-    <dimen name="remote_tab_child_row_height">54dp</dimen>
+    <dimen name="remote_tab_child_row_height">64dp</dimen>
     <dimen name="remote_tab_group_row_height">26dp</dimen>
     <dimen name="popup_width">400dp</dimen>
     <dimen name="tab_thumbnail_height">78dp</dimen>
     <dimen name="tab_thumbnail_width">136dp</dimen>
     <dimen name="tabs_counter_size">22sp</dimen>
+    <dimen name="tabs_panel_list_padding">16dip</dimen>
     <dimen name="tabs_list_divider_height">2dp</dimen>
     <dimen name="text_selection_handle_width">30dp</dimen>
     <dimen name="text_selection_handle_height">44dp</dimen>
     <dimen name="text_selection_handle_shadow">2dp</dimen>
     <dimen name="validation_message_height">50dp</dimen>
     <dimen name="validation_message_margin_top">6dp</dimen>
     <dimen name="widget_padding">8dp</dimen>
     <dimen name="forward_default_offset">-11dip</dimen>
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -134,37 +134,51 @@
     <style name="AwesomeBarTabIndicatorCurve.Right">
          <item name="android:layout_width">20dp</item>
     </style>
 
     <!-- TabsTray List -->
     <style name="TabsList" parent="android:style/Widget.ListView">
          <item name="android:background">@android:color/transparent</item>
          <item name="android:cacheColorHint">@android:color/transparent</item>
-         <item name="android:divider">@drawable/tabs_tray_list_divider</item>
-         <item name="android:dividerHeight">2dip</item>
+         <item name="android:divider">@android:color/transparent</item>
+         <item name="android:dividerHeight">0dip</item>
+         <item name="android:listSelector">@android:color/transparent</item>
     </style>
 
     <!-- RemoteTabsList -->
     <style name="RemoteTabsList" parent="TabsList">
-         <item name="android:childDivider">@drawable/tabs_tray_list_divider</item>
+         <item name="android:dividerHeight">1dip</item>
+         <item name="android:childDivider">@drawable/remote_tabs_child_divider</item>
          <item name="android:groupIndicator">@android:color/transparent</item>
     </style>
 
     <!-- TabsTray Row -->
     <style name="TabRowTextAppearance">
-        <item name="android:textColor">#E5F2FF</item>
+        <item name="android:textColor">#FFFFFFFF</item>
         <item name="android:shadowColor">#7F000000</item>
         <item name="android:shadowRadius">1</item>
         <item name="android:shadowDx">0</item>
         <item name="android:shadowDy">1</item>
         <item name="android:singleLine">true</item>
         <item name="android:ellipsize">middle</item>
     </style>
 
+    <!-- RemoteTabs Row -->
+    <style name="RemoteTabRowTextAppearance">
+        <item name="android:textColor">#FFFFFFFF</item>
+        <item name="android:singleLine">true</item>
+        <item name="android:ellipsize">middle</item>
+    </style>
+
+    <!-- RemoteTabs Row Url -->
+    <style name="RemoteTabRowTextAppearance.Url">
+        <item name="android:textColor">#FFA4A7A9</item>
+    </style>
+
     <!-- TabWidget --> 
     <style name="TabWidget">
         <item name="android:layout_width">wrap_content</item>
         <item name="android:layout_height">40dip</item>
         <item name="android:layout_weight">1.0</item>
     </style>
 
     <!-- Find bar -->