diff options
author | Michael Kolb <kolby@google.com> | 2011-03-03 16:30:25 -0800 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-03-03 16:30:34 -0800 |
commit | d72f15971e4e5f60abd12658174535d1d0aa4546 (patch) | |
tree | ec67a6d21213126a3fe9a85f31f4be66bd63e2af /src/com/android | |
parent | b52c0d8be3486e0e2d89a39c521daa5020605ac2 (diff) | |
download | packages_apps_Browser-d72f15971e4e5f60abd12658174535d1d0aa4546.zip packages_apps_Browser-d72f15971e4e5f60abd12658174535d1d0aa4546.tar.gz packages_apps_Browser-d72f15971e4e5f60abd12658174535d1d0aa4546.tar.bz2 |
fix tab switching animation bug
Bug: 3510200
block tab swicthing while animation is running
this shouldn't affect users much,
but prevent some monkey business
Change-Id: I198d3572ec5c0b3170ee15355ab9edcfb20743d1
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/ScrollWebView.java | 3 | ||||
-rw-r--r-- | src/com/android/browser/XLargeUi.java | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/browser/ScrollWebView.java b/src/com/android/browser/ScrollWebView.java index d1dc25b..2ee2ac0 100644 --- a/src/com/android/browser/ScrollWebView.java +++ b/src/com/android/browser/ScrollWebView.java @@ -151,14 +151,15 @@ public class ScrollWebView extends WebView implements Runnable { } void setDrawCached(boolean cached) { + if (cached == mDrawCached) return; if (cached) { buildDrawingCache(); mBitmap = getDrawingCache(false); mDrawCached = (mBitmap != null); } else { + mDrawCached = false; mBitmap = null; destroyDrawingCache(); - mDrawCached = false; } } diff --git a/src/com/android/browser/XLargeUi.java b/src/com/android/browser/XLargeUi.java index 33151f7..371e649 100644 --- a/src/com/android/browser/XLargeUi.java +++ b/src/com/android/browser/XLargeUi.java @@ -51,6 +51,7 @@ public class XLargeUi extends BaseUi implements ScrollListener { private boolean mUseQuickControls; private PieControl mPieControl; + private boolean mInAnimation = false; /** * @param browser @@ -210,7 +211,9 @@ public class XLargeUi extends BaseUi implements ScrollListener { @Override public void setActiveTab(final Tab tab) { + if (mInAnimation) return; if ((tab != mActiveTab) && (mActiveTab != null)) { + mInAnimation = true; // animate between the two final ScrollWebView fromWV = (ScrollWebView) mActiveTab.getWebView(); fromWV.setDrawCached(true); @@ -234,6 +237,7 @@ public class XLargeUi extends BaseUi implements ScrollListener { fromWV.setDrawCached(false); toWV.setDrawCached(false); setActiveTab(tab, false); + mInAnimation = false; } @Override @@ -241,6 +245,7 @@ public class XLargeUi extends BaseUi implements ScrollListener { fromWV.setDrawCached(false); toWV.setDrawCached(false); setActiveTab(tab, false); + mInAnimation = false; } @Override |