Bug 778438: ActionBar crash on Awesomebar. [r=mfinkle] [a=lsblakk]
authorSriram Ramasubramanian <sriram@mozilla.com>
Mon, 30 Jul 2012 14:21:29 -0700
changeset 102318 6098f0178631ff84d0e0ef77a87a07526bee7bbb
parent 102317 35eecb9cc1aa779cc2c831d9319b642676d90b71
child 102319 eea777847e40f27d61e142ebc3af7afa2b44cc2d
push id1860
push usersramasubramanian@mozilla.com
push dateTue, 07 Aug 2012 18:33:54 +0000
treeherdermozilla-aurora@6098f0178631 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, lsblakk
bugs778438
milestone16.0a2
Bug 778438: ActionBar crash on Awesomebar. [r=mfinkle] [a=lsblakk]
mobile/android/base/AwesomeBar.java
mobile/android/base/resources/values-v11/styles.xml
--- a/mobile/android/base/AwesomeBar.java
+++ b/mobile/android/base/AwesomeBar.java
@@ -68,20 +68,16 @@ public class AwesomeBar extends GeckoAct
     private ContentResolver mResolver;
     private ContextMenuSubject mContextMenuSubject;
     private boolean mIsUsingSwype;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        if (Build.VERSION.SDK_INT >= 11) {
-            getActionBar().hide();
-        }
-
         Log.d(LOGTAG, "creating awesomebar");
 
         mResolver = Tabs.getInstance().getContentResolver();
         LayoutInflater.from(this).setFactory(GeckoViewsFactory.getInstance());
 
         setContentView(R.layout.awesomebar);
 
         mGoButton = (ImageButton) findViewById(R.id.awesomebar_button);
@@ -170,18 +166,17 @@ public class AwesomeBar extends GeckoAct
 
                 // If the AwesomeBar has a composition string, don't call updateGoButton().
                 // That method resets IME and composition state will be broken.
                 if (!hasCompositionString(s)) {
                     updateGoButton(text);
                 }
 
                 if (Build.VERSION.SDK_INT >= 11) {
-                    if (getActionBar().isShowing())
-                        getActionBar().hide();
+                    getActionBar().hide();
                 }
             }
 
             public void beforeTextChanged(CharSequence s, int start, int count,
                                           int after) {
                 // do nothing
             }
 
@@ -230,18 +225,17 @@ public class AwesomeBar extends GeckoAct
                 return false;
             }
         });
 
         mText.setOnSelectionChangedListener(new CustomEditText.OnSelectionChangedListener() {
             @Override
             public void onSelectionChanged(int selStart, int selEnd) {
                 if (Build.VERSION.SDK_INT >= 11 && selStart == selEnd) {
-                    if (getActionBar().isShowing())
-                        getActionBar().hide();
+                    getActionBar().hide();
                 }
             }
         });
     }
 
     @Override
     public void onWindowFocusChanged(boolean hasFocus) {
         super.onWindowFocusChanged(hasFocus);
--- a/mobile/android/base/resources/values-v11/styles.xml
+++ b/mobile/android/base/resources/values-v11/styles.xml
@@ -31,16 +31,17 @@
  
     <!-- ActionBar -->
     <style name="ActionBar" parent="android:style/Widget.Holo.ActionBar" />
 
     <!-- AwesomeBar ActionBar -->
     <style name="ActionBar.AwesomeBar">
          <item name="android:displayOptions">showCustom</item>
          <item name="android:customNavigationLayout">@layout/awesomebar_actionbar</item>
+         <item name="android:visibility">gone</item>
     </style>
  
     <!-- GeckoPreferences ActionBar -->
     <style name="ActionBar.GeckoPreferences">
          <item name="android:displayOptions">showHome|homeAsUp|showTitle</item>
     </style>
  
     <!-- TabsTray ActionBar -->