From 8fd6c3e0041a106152d4924b441d5f0676bbdef3 Mon Sep 17 00:00:00 2001 From: Florian Edelmann Date: Fri, 12 Apr 2013 14:38:22 +0200 Subject: Trebuchet: updated "carousel" transition effect fixed vertical drawer support changed pivotY to half the screen height, so it looks better now Change-Id: I152ec456e80de7342d9f06985aa060c40407f856 --- .../cyanogenmod/trebuchet/AppsCustomizePagedView.java | 17 ++++++++++++----- src/com/cyanogenmod/trebuchet/Workspace.java | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src') 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()) { -- cgit v1.1