diff options
author | Sagar Dhawan <sdhawan@codeaurora.org> | 2015-07-28 18:02:05 -0700 |
---|---|---|
committer | jrizzoli <joey@cyanogenmoditalia.it> | 2015-08-28 13:15:46 +0200 |
commit | 95ce7df1465d70fad9e01b439bac293ffc60dfc5 (patch) | |
tree | 38e2827caf504d29d6b357eccbd72a6249d70a4c | |
parent | 1ac3f010aea388de14c7a3e4bdbbddef85bc9d9d (diff) | |
download | android_packages_apps_Gello-95ce7df1465d70fad9e01b439bac293ffc60dfc5.tar.gz android_packages_apps_Gello-95ce7df1465d70fad9e01b439bac293ffc60dfc5.tar.bz2 android_packages_apps_Gello-95ce7df1465d70fad9e01b439bac293ffc60dfc5.zip |
Fix edge navigation page dimming
Stationary views are correctly dimmed when using
edge navigation.
Page will no longer flash when partial swiping from
left and then swiping from the right.
Change-Id: I4fd83793840330707cfd97a978c77294dab4b197
-rw-r--r-- | src/com/android/browser/EdgeSwipeController.java | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/com/android/browser/EdgeSwipeController.java b/src/com/android/browser/EdgeSwipeController.java index 1f7eb488..5e82ff67 100644 --- a/src/com/android/browser/EdgeSwipeController.java +++ b/src/com/android/browser/EdgeSwipeController.java @@ -321,11 +321,11 @@ public class EdgeSwipeController extends ViewDragHelper.Callback { if (mbNavigated) { mView.setStationaryViewBitmap(getSnapshotOrFavicon(mCurrIndex)); - mView.setStationaryViewAlpha(1.0f); } else { swipeSessionCleanup(); } + mView.setStationaryViewAlpha(1.0f); mView.invalidate(); setState(ViewDragHelper.STATE_SETTLING, ViewDragHelper.STATE_IDLE); @@ -387,6 +387,7 @@ public class EdgeSwipeController extends ViewDragHelper.Callback { if (mView.isLive()) { return; } + mView.setStationaryViewAlpha(mMinAlpha + alpha * (1 - mMinAlpha)); if (mState != ViewDragHelper.STATE_IDLE) { mView.moveShadowView(left); @@ -398,13 +399,10 @@ public class EdgeSwipeController extends ViewDragHelper.Callback { if (!mView.stationaryViewHasImage()) { mView.setStationaryViewBitmap(getSnapshotOrFavicon(mPrevIndex)); } - - if (mActiveTab.getWebView().canGoToHistoryIndex(mPrevIndex)) { - mView.setStationaryViewAlpha(mMinAlpha + alpha * (1 - mMinAlpha)); - } } break; case ViewDragHelper.EDGE_RIGHT: + mView.setStationaryViewAlpha(mMinAlpha + (1 - alpha) * (1 - mMinAlpha)); if (mState != ViewDragHelper.STATE_IDLE) { mView.moveShadowView(mView.getMeasuredWidth() + left); @@ -417,10 +415,6 @@ public class EdgeSwipeController extends ViewDragHelper.Callback { mView.goDormant(); } } - if (mNextIndex < mMaxIndex && - mActiveTab.getWebView().canGoToHistoryIndex(mNextIndex)) { - mView.setStationaryViewAlpha(mMinAlpha + (1 - alpha) * (1 - mMinAlpha)); - } break; default: break; |