Bug 1348086 - Part 1 - Use distinct R.id for the tabs tray menu button. r?gbrown draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Thu, 16 Mar 2017 21:33:44 +0100
changeset 503087 d3942916b32d4f9c4c776c1b2f9b0ea73a1b12bd
parent 503086 56dc8552674e192b2074375d91e32c6ddd72c879
child 503088 c2de34d14d09a3d92d5edc91aa9e422dab81f549
push id50492
push usermozilla@buttercookie.de
push dateWed, 22 Mar 2017 20:44:05 +0000
reviewersgbrown
bugs1348086
milestone55.0a1
Bug 1348086 - Part 1 - Use distinct R.id for the tabs tray menu button. r?gbrown Robocop/Robotium gets terribly confused if multiple views use the same R.id, even if they're never shown together at the same time. Without this patch, opening of the main menu fails once the tabs tray has been opened (and closed again) at least once. MozReview-Commit-ID: IOyxG4SCyzF
mobile/android/base/java/org/mozilla/gecko/tabs/TabsPanel.java
mobile/android/base/resources/layout/tabs_panel_default.xml
--- a/mobile/android/base/java/org/mozilla/gecko/tabs/TabsPanel.java
+++ b/mobile/android/base/java/org/mozilla/gecko/tabs/TabsPanel.java
@@ -164,17 +164,17 @@ public class TabsPanel extends LinearLay
         privateTabsPanel.setPrivateMode(true);
 
         if (!Restrictions.isAllowed(mContext, Restrictable.PRIVATE_BROWSING)) {
             mTabWidget.setVisibility(View.GONE);
         }
 
         mTabWidget.setTabSelectionListener(this);
 
-        mMenuButton = findViewById(R.id.menu);
+        mMenuButton = findViewById(R.id.tabs_menu);
         mMenuButton.setOnClickListener(new Button.OnClickListener() {
             @Override
             public void onClick(View view) {
                 showMenu();
             }
         });
 
         final ImageButton navBackButton = (ImageButton) findViewById(R.id.nav_back);
--- a/mobile/android/base/resources/layout/tabs_panel_default.xml
+++ b/mobile/android/base/resources/layout/tabs_panel_default.xml
@@ -44,17 +44,17 @@
             <ImageButton android:id="@+id/add_tab"
                          style="@style/UrlBar.ImageButton"
                          android:layout_width="@dimen/tabs_panel_button_width"
                          android:padding="@dimen/browser_toolbar_button_padding"
                          android:src="@drawable/tab_new"
                          android:contentDescription="@string/new_tab"
                          android:background="@drawable/action_bar_button_inverse"/>
 
-            <FrameLayout android:id="@+id/menu"
+            <FrameLayout android:id="@+id/tabs_menu"
                          style="@style/UrlBar.ImageButton"
                          android:layout_width="@dimen/tabs_panel_button_width"
                          android:background="@drawable/action_bar_button_inverse"
                          android:contentDescription="@string/menu">
 
                 <ImageView
                         style="@style/UrlBar.ImageButton"
                         android:layout_width="wrap_content"