mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 18:06:48 +00:00
Merge "Animate badge after folder closes" into ub-launcher3-dorval-polish
This commit is contained in:
@@ -38,8 +38,6 @@ import android.graphics.drawable.Drawable;
|
||||
import android.os.Parcelable;
|
||||
import android.support.v4.graphics.ColorUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.util.Property;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
@@ -421,13 +419,21 @@ public class FolderIcon extends FrameLayout implements FolderListener {
|
||||
float newBadgeScale = isBadged ? 1f : 0f;
|
||||
// Animate when a badge is first added or when it is removed.
|
||||
if ((wasBadged ^ isBadged) && isShown()) {
|
||||
ObjectAnimator.ofFloat(this, BADGE_SCALE_PROPERTY, newBadgeScale).start();
|
||||
createBadgeScaleAnimator(newBadgeScale).start();
|
||||
} else {
|
||||
mBadgeScale = newBadgeScale;
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public Animator createBadgeScaleAnimator(float... badgeScales) {
|
||||
return ObjectAnimator.ofFloat(this, BADGE_SCALE_PROPERTY, badgeScales);
|
||||
}
|
||||
|
||||
public boolean hasBadge() {
|
||||
return mBadgeInfo != null && mBadgeInfo.hasBadge();
|
||||
}
|
||||
|
||||
static class PreviewItemDrawingParams {
|
||||
PreviewItemDrawingParams(float transX, float transY, float scale, float overlayAlpha) {
|
||||
this.transX = transX;
|
||||
|
||||
Reference in New Issue
Block a user