Loading src/com/android/launcher3/folder/FolderIcon.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -203,6 +203,10 @@ public class FolderIcon extends FrameLayout implements FolderListener { mBackground.getBounds(outBounds); mBackground.getBounds(outBounds); } } public float getBackgroundStrokeWidth() { return mBackground.getStrokeWidth(); } public Folder getFolder() { public Folder getFolder() { return mFolder; return mFolder; } } Loading src/com/android/launcher3/views/FloatingIconView.java +24 −19 Original line number Original line Diff line number Diff line Loading @@ -259,8 +259,6 @@ public class FloatingIconView extends View implements mFgSpringX.animateToFinalPosition(diffX); mFgSpringX.animateToFinalPosition(diffX); mFgSpringY.animateToFinalPosition(diffY); mFgSpringY.animateToFinalPosition(diffY); } } } } invalidate(); invalidate(); invalidateOutline(); invalidateOutline(); Loading Loading @@ -368,10 +366,13 @@ public class FloatingIconView extends View implements drawable = v.getBackground(); drawable = v.getBackground(); } } } else { } else { boolean isFolderIcon = v instanceof FolderIcon; int width = isFolderIcon ? v.getWidth() : lp.width; int height = isFolderIcon ? v.getHeight() : lp.height; if (supportsAdaptiveIcons) { if (supportsAdaptiveIcons) { drawable = Utilities.getFullDrawable(mLauncher, info, lp.width, lp.height, drawable = Utilities.getFullDrawable(mLauncher, info, width, height, false, false, sTmpObjArray); sTmpObjArray); if ((drawable instanceof AdaptiveIconDrawable)) { if (drawable instanceof AdaptiveIconDrawable) { mBadge = getBadge(mLauncher, info, sTmpObjArray[0]); mBadge = getBadge(mLauncher, info, sTmpObjArray[0]); } else { } else { // The drawable we get back is not an adaptive icon, so we need to use the // The drawable we get back is not an adaptive icon, so we need to use the Loading @@ -383,8 +384,8 @@ public class FloatingIconView extends View implements // Similar to DragView, we simply use the BubbleTextView icon here. // Similar to DragView, we simply use the BubbleTextView icon here. drawable = btvIcon; drawable = btvIcon; } else { } else { drawable = Utilities.getFullDrawable(mLauncher, info, lp.width, lp.height, drawable = Utilities.getFullDrawable(mLauncher, info, width, height, false, false, sTmpObjArray); sTmpObjArray); } } } } } } Loading Loading @@ -412,13 +413,6 @@ public class FloatingIconView extends View implements } } mForeground = foreground; mForeground = foreground; if (mForeground instanceof ShiftedBitmapDrawable && v instanceof FolderIcon) { ShiftedBitmapDrawable sbd = (ShiftedBitmapDrawable) mForeground; ((FolderIcon) v).getPreviewBounds(sTmpRect); sbd.setShiftX(sbd.getShiftX() - sTmpRect.left); sbd.setShiftY(sbd.getShiftY() - sTmpRect.top); } final int originalHeight = lp.height; final int originalHeight = lp.height; final int originalWidth = lp.width; final int originalWidth = lp.width; Loading @@ -434,13 +428,25 @@ public class FloatingIconView extends View implements if (mBadge != null) { if (mBadge != null) { mBadge.setBounds(mStartRevealRect); mBadge.setBounds(mStartRevealRect); if (!isOpening) { if (!isOpening && !isFolderIcon) { DRAWABLE_ALPHA.set(mBadge, 0); DRAWABLE_ALPHA.set(mBadge, 0); } } } } if (!isFolderIcon) { if (isFolderIcon) { ((FolderIcon) v).getPreviewBounds(sTmpRect); float bgStroke = ((FolderIcon) v).getBackgroundStrokeWidth(); if (mForeground instanceof ShiftedBitmapDrawable) { ShiftedBitmapDrawable sbd = (ShiftedBitmapDrawable) mForeground; sbd.setShiftX(sbd.getShiftX() - sTmpRect.left - bgStroke); sbd.setShiftY(sbd.getShiftY() - sTmpRect.top - bgStroke); } if (mBadge instanceof ShiftedBitmapDrawable) { ShiftedBitmapDrawable sbd = (ShiftedBitmapDrawable) mBadge; sbd.setShiftX(sbd.getShiftX() - sTmpRect.left - bgStroke); sbd.setShiftY(sbd.getShiftY() - sTmpRect.top - bgStroke); } } else { Utilities.scaleRectAboutCenter(mStartRevealRect, Utilities.scaleRectAboutCenter(mStartRevealRect, IconShape.getNormalizationScale()); IconShape.getNormalizationScale()); } } Loading Loading @@ -665,7 +671,7 @@ public class FloatingIconView extends View implements } } }); }); if (mBadge != null) { if (mBadge != null && !(mOriginalIcon instanceof FolderIcon)) { ObjectAnimator badgeFade = ObjectAnimator.ofInt(mBadge, DRAWABLE_ALPHA, 255); ObjectAnimator badgeFade = ObjectAnimator.ofInt(mBadge, DRAWABLE_ALPHA, 255); badgeFade.addUpdateListener(valueAnimator -> invalidate()); badgeFade.addUpdateListener(valueAnimator -> invalidate()); fade.play(badgeFade); fade.play(badgeFade); Loading @@ -691,7 +697,6 @@ public class FloatingIconView extends View implements @Override @Override public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) { folderIcon.setBackgroundVisible(true); folderIcon.setBackgroundVisible(true); folderIcon.animateBgShadowAndStroke(); if (folderIcon.hasDot()) { if (folderIcon.hasDot()) { folderIcon.animateDotScale(0, 1f); folderIcon.animateDotScale(0, 1f); } } Loading Loading
src/com/android/launcher3/folder/FolderIcon.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -203,6 +203,10 @@ public class FolderIcon extends FrameLayout implements FolderListener { mBackground.getBounds(outBounds); mBackground.getBounds(outBounds); } } public float getBackgroundStrokeWidth() { return mBackground.getStrokeWidth(); } public Folder getFolder() { public Folder getFolder() { return mFolder; return mFolder; } } Loading
src/com/android/launcher3/views/FloatingIconView.java +24 −19 Original line number Original line Diff line number Diff line Loading @@ -259,8 +259,6 @@ public class FloatingIconView extends View implements mFgSpringX.animateToFinalPosition(diffX); mFgSpringX.animateToFinalPosition(diffX); mFgSpringY.animateToFinalPosition(diffY); mFgSpringY.animateToFinalPosition(diffY); } } } } invalidate(); invalidate(); invalidateOutline(); invalidateOutline(); Loading Loading @@ -368,10 +366,13 @@ public class FloatingIconView extends View implements drawable = v.getBackground(); drawable = v.getBackground(); } } } else { } else { boolean isFolderIcon = v instanceof FolderIcon; int width = isFolderIcon ? v.getWidth() : lp.width; int height = isFolderIcon ? v.getHeight() : lp.height; if (supportsAdaptiveIcons) { if (supportsAdaptiveIcons) { drawable = Utilities.getFullDrawable(mLauncher, info, lp.width, lp.height, drawable = Utilities.getFullDrawable(mLauncher, info, width, height, false, false, sTmpObjArray); sTmpObjArray); if ((drawable instanceof AdaptiveIconDrawable)) { if (drawable instanceof AdaptiveIconDrawable) { mBadge = getBadge(mLauncher, info, sTmpObjArray[0]); mBadge = getBadge(mLauncher, info, sTmpObjArray[0]); } else { } else { // The drawable we get back is not an adaptive icon, so we need to use the // The drawable we get back is not an adaptive icon, so we need to use the Loading @@ -383,8 +384,8 @@ public class FloatingIconView extends View implements // Similar to DragView, we simply use the BubbleTextView icon here. // Similar to DragView, we simply use the BubbleTextView icon here. drawable = btvIcon; drawable = btvIcon; } else { } else { drawable = Utilities.getFullDrawable(mLauncher, info, lp.width, lp.height, drawable = Utilities.getFullDrawable(mLauncher, info, width, height, false, false, sTmpObjArray); sTmpObjArray); } } } } } } Loading Loading @@ -412,13 +413,6 @@ public class FloatingIconView extends View implements } } mForeground = foreground; mForeground = foreground; if (mForeground instanceof ShiftedBitmapDrawable && v instanceof FolderIcon) { ShiftedBitmapDrawable sbd = (ShiftedBitmapDrawable) mForeground; ((FolderIcon) v).getPreviewBounds(sTmpRect); sbd.setShiftX(sbd.getShiftX() - sTmpRect.left); sbd.setShiftY(sbd.getShiftY() - sTmpRect.top); } final int originalHeight = lp.height; final int originalHeight = lp.height; final int originalWidth = lp.width; final int originalWidth = lp.width; Loading @@ -434,13 +428,25 @@ public class FloatingIconView extends View implements if (mBadge != null) { if (mBadge != null) { mBadge.setBounds(mStartRevealRect); mBadge.setBounds(mStartRevealRect); if (!isOpening) { if (!isOpening && !isFolderIcon) { DRAWABLE_ALPHA.set(mBadge, 0); DRAWABLE_ALPHA.set(mBadge, 0); } } } } if (!isFolderIcon) { if (isFolderIcon) { ((FolderIcon) v).getPreviewBounds(sTmpRect); float bgStroke = ((FolderIcon) v).getBackgroundStrokeWidth(); if (mForeground instanceof ShiftedBitmapDrawable) { ShiftedBitmapDrawable sbd = (ShiftedBitmapDrawable) mForeground; sbd.setShiftX(sbd.getShiftX() - sTmpRect.left - bgStroke); sbd.setShiftY(sbd.getShiftY() - sTmpRect.top - bgStroke); } if (mBadge instanceof ShiftedBitmapDrawable) { ShiftedBitmapDrawable sbd = (ShiftedBitmapDrawable) mBadge; sbd.setShiftX(sbd.getShiftX() - sTmpRect.left - bgStroke); sbd.setShiftY(sbd.getShiftY() - sTmpRect.top - bgStroke); } } else { Utilities.scaleRectAboutCenter(mStartRevealRect, Utilities.scaleRectAboutCenter(mStartRevealRect, IconShape.getNormalizationScale()); IconShape.getNormalizationScale()); } } Loading Loading @@ -665,7 +671,7 @@ public class FloatingIconView extends View implements } } }); }); if (mBadge != null) { if (mBadge != null && !(mOriginalIcon instanceof FolderIcon)) { ObjectAnimator badgeFade = ObjectAnimator.ofInt(mBadge, DRAWABLE_ALPHA, 255); ObjectAnimator badgeFade = ObjectAnimator.ofInt(mBadge, DRAWABLE_ALPHA, 255); badgeFade.addUpdateListener(valueAnimator -> invalidate()); badgeFade.addUpdateListener(valueAnimator -> invalidate()); fade.play(badgeFade); fade.play(badgeFade); Loading @@ -691,7 +697,6 @@ public class FloatingIconView extends View implements @Override @Override public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) { folderIcon.setBackgroundVisible(true); folderIcon.setBackgroundVisible(true); folderIcon.animateBgShadowAndStroke(); if (folderIcon.hasDot()) { if (folderIcon.hasDot()) { folderIcon.animateDotScale(0, 1f); folderIcon.animateDotScale(0, 1f); } } Loading