diff options
author | Florian Edelmann <florian-edelmann@online.de> | 2013-04-12 14:38:22 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2013-04-13 06:13:16 -0700 |
commit | 8fd6c3e0041a106152d4924b441d5f0676bbdef3 (patch) | |
tree | fafa47a45c679e9d1f5344b09d14676b74104c78 /src | |
parent | d395d64ddcd218eebf4ff8c110fb5774ec84a83b (diff) | |
download | packages_apps_trebuchet-8fd6c3e0041a106152d4924b441d5f0676bbdef3.zip packages_apps_trebuchet-8fd6c3e0041a106152d4924b441d5f0676bbdef3.tar.gz packages_apps_trebuchet-8fd6c3e0041a106152d4924b441d5f0676bbdef3.tar.bz2 |
Trebuchet: updated "carousel" transition effect
fixed vertical drawer support
changed pivotY to half the screen height, so
it looks better now
Change-Id: I152ec456e80de7342d9f06985aa060c40407f856
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java | 17 | ||||
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Workspace.java | 2 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java b/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java index 4e7eb05..a38d826 100644 --- a/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java +++ b/src/com/cyanogenmod/trebuchet/AppsCustomizePagedView.java @@ -2082,13 +2082,20 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen View v = getPageAt(i); if (v != null) { float scrollProgress = getScrollProgress(screenScroll, v, i); - float rotation = 90.0f * -scrollProgress; + float rotation = 90.0f * scrollProgress; v.setCameraDistance(mDensity * mCameraDistance); - v.setTranslationX(v.getMeasuredWidth() * scrollProgress); - v.setPivotX(left ? 0f : v.getMeasuredWidth()); - v.setPivotY(0f); - v.setRotationY(rotation); + if (!mVertical) { + v.setTranslationX(v.getMeasuredWidth() * scrollProgress); + v.setPivotX(left ? 0f : v.getMeasuredWidth()); + v.setPivotY(v.getMeasuredHeight() / 2); + v.setRotationY(-rotation); + } else { + v.setTranslationY(v.getMeasuredHeight() * scrollProgress); + v.setPivotX(v.getMeasuredWidth() / 2); + v.setPivotY(left ? 0f : v.getMeasuredHeight()); + v.setRotationX(rotation); + } if (mFadeInAdjacentScreens) { float alpha = 1 - Math.abs(scrollProgress); diff --git a/src/com/cyanogenmod/trebuchet/Workspace.java b/src/com/cyanogenmod/trebuchet/Workspace.java index ca6cc2c..092f5a0 100644 --- a/src/com/cyanogenmod/trebuchet/Workspace.java +++ b/src/com/cyanogenmod/trebuchet/Workspace.java @@ -1675,7 +1675,7 @@ public class Workspace extends PagedView cl.setCameraDistance(mDensity * mCameraDistance); cl.setTranslationX(cl.getMeasuredWidth() * scrollProgress); cl.setPivotX(left ? 0f : cl.getMeasuredWidth()); - cl.setPivotY(0f); + cl.setPivotY(cl.getMeasuredHeight() / 2); cl.setRotationY(rotation); if (mFadeInAdjacentScreens && !isSmall()) { |