Bug 771727 - Block focus in tabs panel when it is hidden. r=sriram
authorEitan Isaacson <eitan@monotonous.org>
Wed, 11 Jul 2012 16:11:42 -0700
changeset 99021 61d879a04b013294e1650f570abb8324de3a56b5
parent 99020 a2a27bb34f239181a056831d9c6ac39acbebf661
child 99022 17bc02a42a1ac8621fd59ebb7bc4845d6d962a19
push id23099
push useremorley@mozilla.com
push dateThu, 12 Jul 2012 16:29:09 +0000
treeherdermozilla-central@f9499238bd4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssriram
bugs771727
milestone16.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 771727 - Block focus in tabs panel when it is hidden. r=sriram
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -344,16 +344,19 @@ abstract public class BrowserApp extends
         return mTabsPanel.isShown();
     }
 
     @Override
     public void onTabsLayoutChange(int width, int height) {
         if (mMainLayoutAnimator != null)
             mMainLayoutAnimator.stop();
 
+        if (mTabsPanel.isShown())
+            mTabsPanel.setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
+
         mMainLayoutAnimator = new PropertyAnimator(150);
         mMainLayoutAnimator.setPropertyAnimationListener(this);
 
         if (isTablet()) {
             mMainLayoutAnimator.attach(mBrowserToolbar.getLayout(),
                                        PropertyAnimator.Property.SHRINK_LEFT,
                                        width);
 
@@ -392,18 +395,20 @@ abstract public class BrowserApp extends
             public void run() {
                 if (isTablet() && mTabsPanel.isShown()) {
                     // Fake the gecko layout to have been shrunk, instead of sliding.
                     ((LinearLayout.LayoutParams) mGeckoLayout.getLayoutParams()).setMargins(mTabsPanel.getWidth(), 0, 0, 0);
                     mGeckoLayout.scrollTo(0, 0);
                     mGeckoLayout.requestLayout();
                 }
 
-                if (!mTabsPanel.isShown())
+                if (!mTabsPanel.isShown()) {
                     mBrowserToolbar.updateTabs(false);
+                    mTabsPanel.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
+                }
             }
         });
     }
 
     /* Doorhanger notification methods */
     @Override
     void updatePopups(final Tab tab) {
         mDoorHangerPopup.updatePopup(mBrowserToolbar.mFavicon);