From aa2542a461072a57058ce45946ff6f5552ecce8a Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Mon, 21 Mar 2016 13:40:02 -0700 Subject: [PATCH] Invalidate folder drawing paramaters when top padding changes -> This fixes issues when moving folders between the workspace and hotseat (which have different top paddings) Change-Id: Iac5a4575a403ce8eadd1d3195f02ab10fe5dac23 --- src/com/android/launcher3/folder/FolderIcon.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index 62007f0720..a9b707fcf8 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -105,8 +105,10 @@ public class FolderIcon extends FrameLayout implements FolderListener { // These variables are all associated with the drawing of the preview; they are stored // as member variables for shared usage and to avoid computation on each frame - private int mIntrinsicIconSize; - private int mTotalWidth; + private int mIntrinsicIconSize = -1; + private int mTotalWidth = -1; + private int mPrevTopPadding = -1; + PreviewBackground mBackground = new PreviewBackground(); private PreviewLayoutRule mPreviewLayoutRule; @@ -376,11 +378,13 @@ public class FolderIcon extends FrameLayout implements FolderListener { } private void computePreviewDrawingParams(int drawableSize, int totalSize) { - if (mIntrinsicIconSize != drawableSize || mTotalWidth != totalSize) { + if (mIntrinsicIconSize != drawableSize || mTotalWidth != totalSize || + mPrevTopPadding != getPaddingTop()) { DeviceProfile grid = mLauncher.getDeviceProfile(); mIntrinsicIconSize = drawableSize; mTotalWidth = totalSize; + mPrevTopPadding = getPaddingTop(); mBackground.setup(getResources().getDisplayMetrics(), grid, this, mTotalWidth, getPaddingTop());