mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:38:21 +00:00
Fix bugs related to swipe up to home animation.
- Added ConstantState support for FolderAdaptiveIcon and ShiftedBitmapDrawable. - Quick fix for NPE in Workspace#mapOverCellLayout while I investigate further. Bug: 128460496 Change-Id: I5ec02e25dcf9f17aeb37928e675a033bdc8819ae
This commit is contained in:
committed by
Jonathan Miranda
parent
29cde586f9
commit
0c3692d5ef
@@ -32,10 +32,14 @@ public class ShiftedBitmapDrawable extends Drawable {
|
||||
private float mShiftX;
|
||||
private float mShiftY;
|
||||
|
||||
private final ConstantState mConstantState;
|
||||
|
||||
public ShiftedBitmapDrawable(Bitmap bitmap, float shiftX, float shiftY) {
|
||||
mBitmap = bitmap;
|
||||
mShiftX = shiftX;
|
||||
mShiftY = shiftY;
|
||||
|
||||
mConstantState = new MyConstantState(mBitmap, mShiftX, mShiftY);
|
||||
}
|
||||
|
||||
public float getShiftX() {
|
||||
@@ -71,4 +75,31 @@ public class ShiftedBitmapDrawable extends Drawable {
|
||||
public int getOpacity() {
|
||||
return PixelFormat.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstantState getConstantState() {
|
||||
return mConstantState;
|
||||
}
|
||||
|
||||
private static class MyConstantState extends ConstantState {
|
||||
private final Bitmap mBitmap;
|
||||
private float mShiftX;
|
||||
private float mShiftY;
|
||||
|
||||
MyConstantState(Bitmap bitmap, float shiftX, float shiftY) {
|
||||
mBitmap = bitmap;
|
||||
mShiftX = shiftX;
|
||||
mShiftY = shiftY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Drawable newDrawable() {
|
||||
return new ShiftedBitmapDrawable(mBitmap, mShiftX, mShiftY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChangingConfigurations() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user