Invalidate folder drawing paramaters when top padding changes
am: aa2542a
* commit 'aa2542a461072a57058ce45946ff6f5552ecce8a':
Invalidate folder drawing paramaters when top padding changes
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());