diff options
author | Michael Kolb <kolby@google.com> | 2011-03-03 17:08:49 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-03 17:08:49 -0800 |
commit | d0a0e2b4f99f996b578f000214e96a346cb7b55d (patch) | |
tree | 3045f668a24c1dfc2f16798786da26cf3d3195e6 | |
parent | d1eca40474ae9c02372038cc19c3d8791c0e212a (diff) | |
parent | d72f15971e4e5f60abd12658174535d1d0aa4546 (diff) | |
download | packages_apps_Browser-d0a0e2b4f99f996b578f000214e96a346cb7b55d.zip packages_apps_Browser-d0a0e2b4f99f996b578f000214e96a346cb7b55d.tar.gz packages_apps_Browser-d0a0e2b4f99f996b578f000214e96a346cb7b55d.tar.bz2 |
Merge "fix tab switching animation bug" into honeycomb-mr1
-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 |