mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Prevent NPE in Launcher when an icon cannot be found.
Bug #2509023 Change-Id: I053c7c9a37ed4aeb4d78a9f62dfdeea09a3959aa
This commit is contained in:
@@ -24,9 +24,17 @@ import android.graphics.ColorFilter;
|
||||
|
||||
class FastBitmapDrawable extends Drawable {
|
||||
private Bitmap mBitmap;
|
||||
private int mWidth;
|
||||
private int mHeight;
|
||||
|
||||
FastBitmapDrawable(Bitmap b) {
|
||||
mBitmap = b;
|
||||
if (b != null) {
|
||||
mWidth = mBitmap.getWidth();
|
||||
mHeight = mBitmap.getHeight();
|
||||
} else {
|
||||
mWidth = mHeight = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -49,26 +57,32 @@ class FastBitmapDrawable extends Drawable {
|
||||
|
||||
@Override
|
||||
public int getIntrinsicWidth() {
|
||||
return mBitmap.getWidth();
|
||||
return mWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIntrinsicHeight() {
|
||||
return mBitmap.getHeight();
|
||||
return mHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinimumWidth() {
|
||||
return mBitmap.getWidth();
|
||||
return mWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinimumHeight() {
|
||||
return mBitmap.getHeight();
|
||||
return mHeight;
|
||||
}
|
||||
|
||||
public void setBitmap(Bitmap b) {
|
||||
mBitmap = b;
|
||||
if (b != null) {
|
||||
mWidth = mBitmap.getWidth();
|
||||
mHeight = mBitmap.getHeight();
|
||||
} else {
|
||||
mWidth = mHeight = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public Bitmap getBitmap() {
|
||||
|
||||
Reference in New Issue
Block a user