Normalizing icons in recents view
Change-Id: I1d95c1abf158044ca5666473f976b49f7997ca27
This commit is contained in:
1 parent
a12bd507d1
commit
338d15d232
4 files changed
+127
-1
No files matched your search
@@ -29,6 +29,8 @@ import android.graphics.PixelFormat;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.Property;
|
||||
import android.util.SparseArray;
|
||||
|
||||
@@ -304,4 +306,30 @@ public class FastBitmapDrawable extends Drawable {
|
||||
}
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConstantState getConstantState() {
|
||||
return new MyConstantState(mBitmap, mIconColor);
|
||||
}
|
||||
|
||||
private static class MyConstantState extends ConstantState {
|
||||
private final Bitmap mBitmap;
|
||||
private final int mIconColor;
|
||||
|
||||
|
||||
public MyConstantState(Bitmap bitmap, int color) {
|
||||
mBitmap = bitmap;
|
||||
mIconColor = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Drawable newDrawable() {
|
||||
return new FastBitmapDrawable(mBitmap, mIconColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChangingConfigurations() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user