Bug 778438: ActionBar crash on Awesomebar. [r=mfinkle]
authorSriram Ramasubramanian <sriram@mozilla.com>
Mon, 30 Jul 2012 14:21:29 -0700
changeset 100904 c6de46640373ca5a269898476a0eb6d0eb8e0232
parent 100903 fb45f540d9eac6a8c57fbeec715855614dbd8cc3
child 100905 205889645965ca5008311a04266917f20d408c55
push id23202
push useremorley@mozilla.com
push dateTue, 31 Jul 2012 12:59:27 +0000
treeherdermozilla-central@1ab429a89429 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs778438
milestone17.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 778438: ActionBar crash on Awesomebar. [r=mfinkle]
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
@@ -66,20 +66,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);
@@ -168,18 +164,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
             }
 
@@ -228,18 +223,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 -->