From 6f16b35d7f2d218b996e621b893952bccb75b604 Mon Sep 17 00:00:00 2001 From: Lucas Rocha Date: Fri, 22 Feb 2013 07:22:37 +0000 Subject: [PATCH] Bug 817721/817735/817732 - Always scroll on tabs tray animation (r=mfinkle) --- mobile/android/base/BrowserApp.java | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index 597d22a88bcf..4895c953328e 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -576,20 +576,17 @@ abstract public class BrowserApp extends GeckoApp // Set the gecko layout for sliding. if (!mTabsPanel.isShown()) { ((LinearLayout.LayoutParams) mGeckoLayout.getLayoutParams()).setMargins(0, 0, 0, 0); - if (!usingTextureView) - mGeckoLayout.scrollTo(mTabsPanel.getWidth() * -1, 0); + mGeckoLayout.scrollTo(mTabsPanel.getWidth() * -1, 0); mGeckoLayout.requestLayout(); } mMainLayoutAnimator.attach(mGeckoLayout, - usingTextureView ? PropertyAnimator.Property.TRANSLATION_X : - PropertyAnimator.Property.SCROLL_X, - usingTextureView ? width : -width); + PropertyAnimator.Property.SCROLL_X, + -width); } else { mMainLayoutAnimator.attach(mMainLayout, - usingTextureView ? PropertyAnimator.Property.TRANSLATION_Y : - PropertyAnimator.Property.SCROLL_Y, - usingTextureView ? height : -height); + PropertyAnimator.Property.SCROLL_Y, + -height); } mMainLayoutAnimator.start(); @@ -618,14 +615,8 @@ abstract public class BrowserApp extends GeckoApp if (mTabsPanel.isShown()) { if (hasTabsSideBar()) { - boolean usingTextureView = mLayerView.shouldUseTextureView(); - - int leftMargin = (usingTextureView ? 0 : mTabsPanel.getWidth()); - int rightMargin = (usingTextureView ? mTabsPanel.getWidth() : 0); - ((LinearLayout.LayoutParams) mGeckoLayout.getLayoutParams()).setMargins(leftMargin, 0, rightMargin, 0); - - if (!usingTextureView) - mGeckoLayout.scrollTo(0, 0); + ((LinearLayout.LayoutParams) mGeckoLayout.getLayoutParams()).setMargins(mTabsPanel.getWidth(), 0, 0, 0); + mGeckoLayout.scrollTo(0, 0); } mGeckoLayout.requestLayout();