mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Animate the long press icon scale for task menu to match task view
Use scale listeners to track each other's icon scale to match them. Test: go to recents and long press icon Fixes: 110789415 Change-Id: I9bba3130ecf1d099db9708c84e709d16f5906c36
This commit is contained in:
@@ -109,7 +109,7 @@ public class FastBitmapDrawable extends Drawable {
|
||||
|
||||
@Override
|
||||
public final void draw(Canvas canvas) {
|
||||
if (mScaleAnimation != null) {
|
||||
if (mScale != 1f) {
|
||||
int count = canvas.save();
|
||||
Rect bounds = getBounds();
|
||||
canvas.scale(mScale, mScale, bounds.exactCenterX(), bounds.exactCenterY());
|
||||
@@ -150,10 +150,23 @@ public class FastBitmapDrawable extends Drawable {
|
||||
return mAlpha;
|
||||
}
|
||||
|
||||
public void setScale(float scale) {
|
||||
if (mScaleAnimation != null) {
|
||||
mScaleAnimation.cancel();
|
||||
mScaleAnimation = null;
|
||||
}
|
||||
mScale = scale;
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
public float getAnimatedScale() {
|
||||
return mScaleAnimation == null ? 1 : mScale;
|
||||
}
|
||||
|
||||
public float getScale() {
|
||||
return mScale;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntrinsicWidth() {
|
||||
return mBitmap.getWidth();
|
||||
|
||||
Reference in New Issue
Block a user