Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa2542a4 authored by Adam Cohen's avatar Adam Cohen
Browse files

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
parent 470f900f
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -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());