Do not animate icon if work profile is disabled

Bug: 119884907

Change-Id: I14977581dcb42b5fb2fe21f628a4d91945fdd614
This commit is contained in:
Hyunyoung Song
2019-01-03 01:02:43 -08:00
parent efb8b83666
commit ef468d80d8
3 changed files with 32 additions and 5 deletions

View File

@@ -17,6 +17,7 @@
package com.android.launcher3;
import static com.android.launcher3.anim.Interpolators.ACCEL;
import static com.android.launcher3.anim.Interpolators.DEACCEL;
import android.animation.ObjectAnimator;
import android.graphics.Bitmap;
@@ -221,8 +222,15 @@ public class FastBitmapDrawable extends Drawable {
mScaleAnimation.setInterpolator(ACCEL);
mScaleAnimation.start();
} else {
mScale = 1f;
invalidateSelf();
if (isVisible()) {
mScaleAnimation = ObjectAnimator.ofFloat(this, SCALE, 1f);
mScaleAnimation.setDuration(CLICK_FEEDBACK_DURATION);
mScaleAnimation.setInterpolator(DEACCEL);
mScaleAnimation.start();
} else {
mScale = 1f;
invalidateSelf();
}
}
return true;
}