Bug 778438: ActionBar crash on Awesomebar. [r=mfinkle] [a=lsblakk]
authorSriram Ramasubramanian <sriram@mozilla.com>
Mon, 30 Jul 2012 14:21:29 -0700
changeset 100450 1fb1f90a2bc7ea64d90c5c019482439760f08af5
parent 100449 5b96d31cd936f1ee4ecf01c5e3513daa0164cae8
child 100451 ad803799f66bc609f2dbd9ab538c54ac351c4fcb
push id1240
push usersramasubramanian@mozilla.com
push dateTue, 07 Aug 2012 18:49:15 +0000
treeherdermozilla-beta@1fb1f90a2bc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, lsblakk
bugs778438
milestone15.0
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
@@ -84,20 +84,16 @@ public class AwesomeBar extends GeckoAct
     private SuggestClient mSuggestClient;
     private AsyncTask<String, Void, ArrayList<String>> mSuggestTask;
     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);
@@ -204,18 +200,17 @@ public class AwesomeBar extends GeckoAct
                          protected void onPostExecute(ArrayList<String> suggestions) {
                              mAwesomeTabs.setSuggestions(suggestions);
                          }
                     };
                     mSuggestTask.execute(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
             }
 
@@ -264,18 +259,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();
                 }
             }
         });
 
         registerForContextMenu(mAwesomeTabs.findViewById(R.id.all_pages_list));
         registerForContextMenu(mAwesomeTabs.findViewById(R.id.bookmarks_list));
         registerForContextMenu(mAwesomeTabs.findViewById(R.id.history_list));
 
--- 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 -->