diff options
author | Jorge Ruesga <jorge@ruesga.com> | 2013-05-08 01:14:44 +0200 |
---|---|---|
committer | Jorge Ruesga <jorge@ruesga.com> | 2013-05-08 01:14:44 +0200 |
commit | 1f5cc0ddb1dd2bcc5ff0e48fa9c1d2a05eefb7ac (patch) | |
tree | ebcd8603db0440d6127fd121768ca2b4cfbf1e69 /src | |
parent | decbaf63416b21d1aece708b8c0b6523b47f74ac (diff) | |
download | packages_apps_trebuchet-1f5cc0ddb1dd2bcc5ff0e48fa9c1d2a05eefb7ac.zip packages_apps_trebuchet-1f5cc0ddb1dd2bcc5ff0e48fa9c1d2a05eefb7ac.tar.gz packages_apps_trebuchet-1f5cc0ddb1dd2bcc5ff0e48fa9c1d2a05eefb7ac.tar.bz2 |
Trebuchet: Fix drawer vertical orientation bugs
Change-Id: I6c76830c944be85b62c043991c36ba5bd18f036e
JIRA: CYAN-901
Issue: https://jira.cyanogenmod.org/browse/CYAN-901
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/PagedView.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/com/cyanogenmod/trebuchet/PagedView.java b/src/com/cyanogenmod/trebuchet/PagedView.java index 42ae968..5090f8d 100644 --- a/src/com/cyanogenmod/trebuchet/PagedView.java +++ b/src/com/cyanogenmod/trebuchet/PagedView.java @@ -320,14 +320,19 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc */ protected void updateCurrentPageScroll() { // If the current page is invalid, just reset the scroll position to zero - int newX = 0; + int newScrollPos = 0; if (0 <= mCurrentPage && mCurrentPage < getPageCount()) { int offset = getChildOffset(mCurrentPage); int relOffset = getRelativeChildOffset(mCurrentPage); - newX = offset - relOffset; + newScrollPos = offset - relOffset; + } + if (!mVertical) { + scrollTo(newScrollPos, 0); + mScroller.setFinalX(newScrollPos); + } else { + scrollTo(0, newScrollPos); + mScroller.setFinalY(newScrollPos); } - scrollTo(newX, 0); - mScroller.setFinalX(newX); mScroller.forceFinished(true); } |