Bug 844984: Remove overdraw in Awesomebar. [r=bnicholson]
authorSriram Ramasubramanian <sriram@mozilla.com>
Mon, 25 Feb 2013 12:15:00 -0800
changeset 123030 29de190ac31c1b28b6f41259b679dfcbd20a6e86
parent 123029 6a930768eb8298f33eb36ae953ff5dcc43c4dca3
child 123031 8d8cb708ed97dfd44b171028570c873d84e0157f
push id23630
push usersramasubramanian@mozilla.com
push dateTue, 26 Feb 2013 18:57:48 +0000
treeherdermozilla-inbound@29de190ac31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs844984
milestone22.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 844984: Remove overdraw in Awesomebar. [r=bnicholson]
mobile/android/base/AwesomeBarTabs.java
mobile/android/base/GeckoViewsFactory.java
mobile/android/base/resources/layout/awesomebar.xml
mobile/android/base/resources/layout/awesomebar_suggestion_prompt.xml
mobile/android/base/resources/layout/awesomebar_tabs.xml
mobile/android/base/resources/values-v11/themes.xml
mobile/android/base/resources/values/themes.xml
--- a/mobile/android/base/AwesomeBarTabs.java
+++ b/mobile/android/base/AwesomeBarTabs.java
@@ -28,17 +28,16 @@ public class AwesomeBarTabs extends TabH
     private GeckoActivity mActivity;
 
     private boolean mInflated;
     private LayoutInflater mInflater;
     private OnUrlOpenListener mUrlOpenListener;
     private View.OnTouchListener mListTouchListener;
     private boolean mSearching = false;
     private String mTarget;
-    private Background mBackground;
     private ViewPager mViewPager;
     private AwesomePagerAdapter mPagerAdapter;
     
     private AwesomeBarTab mTabs[];
 
     // FIXME: This value should probably come from a
     // prefs key (just like XUL-based fennec)
     private static final int MAX_RESULTS = 100;
@@ -133,18 +132,16 @@ public class AwesomeBarTabs extends TabH
         mListTouchListener = new View.OnTouchListener() {
             public boolean onTouch(View view, MotionEvent event) {
                 if (event.getActionMasked() == MotionEvent.ACTION_DOWN)
                     hideSoftInput(view);
                 return false;
             }
         };
 
-        mBackground = (Background) findViewById(R.id.awesomebar_background);
-
         mTabs = new AwesomeBarTab[] {
             new AllPagesTab(mContext),
             new BookmarksTab(mContext),
             new HistoryTab(mContext)
         };
 
         final TabWidget tabWidget = (TabWidget) findViewById(android.R.id.tabs);
         // hide the strip since we aren't using the TabHost...
@@ -334,25 +331,25 @@ public class AwesomeBarTabs extends TabH
     }
 
     public void setTarget(String target) {
         mTarget = target;
         styleSelectedTab();
         if (mTarget.equals(AwesomeBar.Target.CURRENT_TAB.name())) {
             Tab tab = Tabs.getInstance().getSelectedTab();
             if (tab != null && tab.isPrivate())
-                mBackground.setPrivateMode(true);
+                ((BackgroundLayout) findViewById(R.id.tab_widget_container)).setPrivateMode(true);
         }
     }
 
-    public static class Background extends GeckoLinearLayout
-                                   implements LightweightTheme.OnChangeListener { 
+    public static class BackgroundLayout extends GeckoLinearLayout
+                                         implements LightweightTheme.OnChangeListener { 
         private GeckoActivity mActivity;
 
-        public Background(Context context, AttributeSet attrs) {
+        public BackgroundLayout(Context context, AttributeSet attrs) {
             super(context, attrs);
             mActivity = (GeckoActivity) context;
         }
 
         @Override
         public void onAttachedToWindow() {
             super.onAttachedToWindow();
             mActivity.getLightweightTheme().addListener(this);
--- a/mobile/android/base/GeckoViewsFactory.java
+++ b/mobile/android/base/GeckoViewsFactory.java
@@ -39,17 +39,17 @@ public final class GeckoViewsFactory imp
         Class<Context> arg1Class = Context.class;
         Class<AttributeSet> arg2Class = AttributeSet.class;
         try {
             mFactoryMap.put("AboutHomePromoBox", AboutHomePromoBox.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("AboutHomeContent", AboutHomeContent.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("AboutHomeContent$TopSitesGridView", AboutHomeContent.TopSitesGridView.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("AboutHomeSection", AboutHomeSection.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("AwesomeBarTabs", AwesomeBarTabs.class.getConstructor(arg1Class, arg2Class));
-            mFactoryMap.put("AwesomeBarTabs.Background", AwesomeBarTabs.Background.class.getConstructor(arg1Class, arg2Class));
+            mFactoryMap.put("AwesomeBarTabs$BackgroundLayout", AwesomeBarTabs.BackgroundLayout.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("BackButton", BackButton.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("BrowserToolbarBackground", BrowserToolbarBackground.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("BrowserToolbar$RightEdge", BrowserToolbar.RightEdge.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("CheckableLinearLayout", CheckableLinearLayout.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("FormAssistPopup", FormAssistPopup.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("ForwardButton", ForwardButton.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("GeckoApp$MainLayout", GeckoApp.MainLayout.class.getConstructor(arg1Class, arg2Class));
             mFactoryMap.put("LinkTextView", LinkTextView.class.getConstructor(arg1Class, arg2Class));
--- a/mobile/android/base/resources/layout/awesomebar.xml
+++ b/mobile/android/base/resources/layout/awesomebar.xml
@@ -1,14 +1,14 @@
 <?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/awesome_screen"
-              style="@style/Screen">
+              style="@style/Screen.Transparent">
 
     <include layout="@layout/awesomebar_search"/>
 
     <include layout="@layout/awesomebar_tabs"/>
 
 </LinearLayout>
--- a/mobile/android/base/resources/layout/awesomebar_suggestion_prompt.xml
+++ b/mobile/android/base/resources/layout/awesomebar_suggestion_prompt.xml
@@ -1,20 +1,22 @@
 <?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:layout_width="fill_parent"
-              android:layout_height="wrap_content"
-              android:minHeight="@dimen/awesomebar_row_height"
-              android:orientation="horizontal"
-              android:gravity="center_vertical"
-              android:padding="10dip">
+<view xmlns:android="http://schemas.android.com/apk/res/android"
+      class="org.mozilla.gecko.AwesomeBarTabs$BackgroundLayout"
+      android:layout_width="fill_parent"
+      android:layout_height="wrap_content"
+      android:orientation="horizontal"
+      android:minHeight="@dimen/awesomebar_row_height"
+      android:gravity="center_vertical"
+      android:padding="10dip"
+      android:background="@drawable/address_bar_bg">
 
     <Gecko.TextView android:id="@+id/suggestions_prompt_title"
                     android:layout_height="wrap_content"
                     android:layout_width="wrap_content"
                     android:textColor="@color/awesome_bar_title"
                     android:layout_marginLeft="6dip"
                     android:textSize="13sp"
                     android:layout_weight="1" />
@@ -40,9 +42,9 @@
             android:background="@drawable/suggestion_selector"
             android:paddingLeft="15dp"
             android:paddingRight="15dp"
             android:paddingTop="7dp"
             android:paddingBottom="7dp"
             android:clickable="true"
             android:text="@string/button_no" />
 
-</LinearLayout>
+</view>
--- a/mobile/android/base/resources/layout/awesomebar_tabs.xml
+++ b/mobile/android/base/resources/layout/awesomebar_tabs.xml
@@ -3,43 +3,42 @@
    - 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/. -->
 
 <org.mozilla.gecko.AwesomeBarTabs xmlns:android="http://schemas.android.com/apk/res/android"
                                   android:id="@+id/awesomebar_tabs"
                                   android:layout_width="fill_parent"
                                   android:layout_height="fill_parent">
 
-    <view class="org.mozilla.gecko.AwesomeBarTabs.Background"
-          android:id="@+id/awesomebar_background"
-          android:orientation="vertical"
-          android:layout_width="fill_parent"
-          android:layout_height="fill_parent"
-          android:background="@drawable/address_bar_bg">
+    <LinearLayout android:orientation="vertical"
+                  android:layout_width="fill_parent"
+                  android:layout_height="fill_parent">
 
-        <LinearLayout android:id="@+id/tab_widget_container"
-                      android:layout_width="fill_parent"
-                      android:layout_height="wrap_content">
+        <view class="org.mozilla.gecko.AwesomeBarTabs$BackgroundLayout"
+              android:id="@+id/tab_widget_container"
+              android:layout_width="fill_parent"
+              android:layout_height="wrap_content"
+              android:background="@drawable/address_bar_bg">
 
             <View android:id="@+id/tab_widget_left"
                   style="@style/AwesomeBarTabIndicatorCurve.Left"/>
 
             <TabWidget android:id="@android:id/tabs"
                        style="@style/TabWidget"/>
 
             <View android:id="@+id/tab_widget_right"
                   style="@style/AwesomeBarTabIndicatorCurve.Right"/>
 
-        </LinearLayout>
+        </view>
 
         <FrameLayout android:id="@android:id/tabcontent"
                      android:visibility="gone"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"/>
 
         <android.support.v4.view.ViewPager
                         android:id="@+id/tabviewpager"
                         android:layout_width="fill_parent"
                         android:layout_height="fill_parent"/>
 
-    </view>
+    </LinearLayout>
 
 </org.mozilla.gecko.AwesomeBarTabs>
--- a/mobile/android/base/resources/values-v11/themes.xml
+++ b/mobile/android/base/resources/values-v11/themes.xml
@@ -49,16 +49,17 @@
         <item name="android:dropDownListViewStyle">@style/DropDownListView</item>
         <item name="android:listViewStyle">@style/GeckoList</item>
         <item name="android:spinnerItemStyle">@style/SpinnerItem</item>
         <item name="android:spinnerDropDownItemStyle">@style/SpinnerDropDownItem</item>
     </style>
 
     <style name="Gecko.Light.AwesomeBar">
         <item name="android:actionBarStyle">@style/ActionBar.AwesomeBar</item>
+        <item name="android:windowBackground">@null</item>
     </style>
 
     <style name="Gecko.TitleBar.Preferences">
         <item name="android:actionBarStyle">@style/ActionBar.GeckoPreferences</item>
     </style>
 
     <style name="Gecko.Translucent.TabsTray">
         <item name="android:actionBarStyle">@style/ActionBar.TabsTray</item>
--- a/mobile/android/base/resources/values/themes.xml
+++ b/mobile/android/base/resources/values/themes.xml
@@ -35,15 +35,17 @@
     <style name="Gecko.Translucent" parent="@android:style/Theme.Translucent">
         <item name="android:windowNoTitle">true</item>
     </style>
 
     <style name="Gecko.App">
         <item name="android:windowBackground">@color/background_normal</item>
     </style>
 
-    <style name="Gecko.Light.AwesomeBar"/>
+    <style name="Gecko.Light.AwesomeBar">
+        <item name="android:windowBackground">@null</item>
+    </style>
     
     <style name="Gecko.TitleBar.Preferences"/>
     
     <style name="Gecko.Translucent.TabsTray"/>
 
 </resources>