Bug 1001243 - Disable tabs button when in editing mode. r=bnicholson, a=sledru
authorMichael Comella <michael.l.comella@gmail.com>
Mon, 12 May 2014 15:19:16 -0700
changeset 192707 cc69ae439121fffe4120eb18e82477caa3203f81
parent 192706 5caea30192d0a1973fe6710b4df63f1f60779550
child 192708 37037e7a19e8b2fc4dcd2485e0dfbc72685870e2
push id5886
push userryanvm@gmail.com
push dateTue, 13 May 2014 14:46:21 +0000
treeherdermozilla-aurora@cc69ae439121 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson, sledru
bugs1001243
milestone31.0a2
Bug 1001243 - Disable tabs button when in editing mode. r=bnicholson, a=sledru
mobile/android/base/toolbar/BrowserToolbar.java
--- a/mobile/android/base/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/toolbar/BrowserToolbar.java
@@ -997,21 +997,27 @@ public class BrowserToolbar extends Them
     private void showEditingWithoutAnimation(final int entryTranslation,
             final int curveTranslation) {
         showUrlEditLayout();
 
         if (urlBarTranslatingEdge != null) {
             ViewHelper.setTranslationX(urlBarTranslatingEdge, entryTranslation);
         }
 
+        // Prevent taps through the editing mode cancel button (bug 1001243).
+        tabsButton.setEnabled(false);
+
         ViewHelper.setTranslationX(tabsButton, curveTranslation);
         ViewHelper.setTranslationX(tabsCounter, curveTranslation);
         ViewHelper.setTranslationX(actionItemBar, curveTranslation);
 
         if (hasSoftMenuButton) {
+            // Prevent tabs through the editing mode cancel button (bug 1001243).
+            menuButton.setEnabled(false);
+
             ViewHelper.setTranslationX(menuButton, curveTranslation);
             ViewHelper.setTranslationX(menuIcon, curveTranslation);
         }
     }
 
     private void showEditingWithPhoneAnimation(final PropertyAnimator animator,
             final int entryTranslation, final int curveTranslation) {
         if (isAnimatingEntry)
@@ -1123,21 +1129,25 @@ public class BrowserToolbar extends Them
         if (urlBarTranslatingEdge != null) {
             urlBarTranslatingEdge.setVisibility(View.INVISIBLE);
             ViewHelper.setTranslationX(urlBarTranslatingEdge, 0);
             if (shouldShrinkURLBar) {
                 urlBarEntry.setLayoutParams(urlBarEntryDefaultLayoutParams);
             }
         }
 
+        tabsButton.setEnabled(true);
+
         ViewHelper.setTranslationX(tabsButton, 0);
         ViewHelper.setTranslationX(tabsCounter, 0);
         ViewHelper.setTranslationX(actionItemBar, 0);
 
         if (hasSoftMenuButton) {
+            menuButton.setEnabled(true);
+
             ViewHelper.setTranslationX(menuButton, 0);
             ViewHelper.setTranslationX(menuIcon, 0);
         }
     }
 
     private void stopEditingWithPhoneAnimation() {
         final PropertyAnimator contentAnimator = new PropertyAnimator(250);
         contentAnimator.setUseHardwareLayer(false);