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
diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java
index 62007f07..a9b707f 100644
--- a/src/com/android/launcher3/folder/FolderIcon.java
+++ b/src/com/android/launcher3/folder/FolderIcon.java
@@ -105,8 +105,10 @@
// 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 @@
}
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());