diff options
author | Adam Cohen <adamcohen@google.com> | 2014-06-11 17:37:53 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-11 17:37:53 +0000 |
commit | 74ba0c31a87b06c0ed7a78aad92586955d7ca241 (patch) | |
tree | 4bc228115ff1fae421b9e12c06a9175bfd5a7791 /src | |
parent | 2854d54b94203c3e4070de475edcfcb3f8140507 (diff) | |
parent | ada8d7dfe1a52eab1e2a0954cf369ed6d198de94 (diff) | |
download | packages_apps_Trebuchet-74ba0c31a87b06c0ed7a78aad92586955d7ca241.tar.gz packages_apps_Trebuchet-74ba0c31a87b06c0ed7a78aad92586955d7ca241.tar.bz2 packages_apps_Trebuchet-74ba0c31a87b06c0ed7a78aad92586955d7ca241.zip |
am ada8d7df: Merge "Make folder stack more vertical for LMP preview" into ub-now-nova
* commit 'ada8d7dfe1a52eab1e2a0954cf369ed6d198de94':
Make folder stack more vertical for LMP preview
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/FolderIcon.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/FolderIcon.java index 4a701d558..be6cf4857 100644 --- a/src/com/android/launcher3/FolderIcon.java +++ b/src/com/android/launcher3/FolderIcon.java @@ -73,6 +73,8 @@ public class FolderIcon extends FrameLayout implements FolderListener { // The amount of vertical spread between items in the stack [0...1] private static final float PERSPECTIVE_SHIFT_FACTOR = 0.24f; + private static final float PERSPECTIVE_SHIFT_FACTOR_L = 0.18f; + // Flag as to whether or not to draw an outer ring. Currently none is designed. public static final boolean HAS_OUTER_RING = true; @@ -501,10 +503,16 @@ public class FolderIcon extends FrameLayout implements FolderListener { int adjustedAvailableSpace = (int) ((mAvailableSpaceInPreview / 2) * (1 + 0.8f)); int unscaledHeight = (int) (mIntrinsicIconSize * (1 + PERSPECTIVE_SHIFT_FACTOR)); + if (Utilities.isLmp()) { + unscaledHeight = (int) (mIntrinsicIconSize * (1 + PERSPECTIVE_SHIFT_FACTOR_L)); + } mBaselineIconScale = (1.0f * adjustedAvailableSpace / unscaledHeight); mBaselineIconSize = (int) (mIntrinsicIconSize * mBaselineIconScale); mMaxPerspectiveShift = mBaselineIconSize * PERSPECTIVE_SHIFT_FACTOR; + if (Utilities.isLmp()) { + mMaxPerspectiveShift = mBaselineIconSize * PERSPECTIVE_SHIFT_FACTOR_L; + } mPreviewOffsetX = (mTotalWidth - mAvailableSpaceInPreview) / 2; mPreviewOffsetY = previewPadding + grid.folderBackgroundOffset; @@ -559,6 +567,10 @@ public class FolderIcon extends FrameLayout implements FolderListener { float totalScale = mBaselineIconScale * scale; final int overlayAlpha = (int) (80 * (1 - r)); + if (Utilities.isLmp()) { + transX = (mAvailableSpaceInPreview - scaledSize) / 2; + } + if (params == null) { params = new PreviewItemDrawingParams(transX, transY, totalScale, overlayAlpha); } else { |