android: fix when reuse image'drawable may cause crash in some devices
This commit is contained in:
parent
34b759bb82
commit
6efd008841
@ -297,6 +297,11 @@ public class ImageNode extends ViewNode<ImageView> {
|
|||||||
Drawable placeHolderDrawable = null;
|
Drawable placeHolderDrawable = null;
|
||||||
if (mView.getDrawable() != null) {
|
if (mView.getDrawable() != null) {
|
||||||
placeHolderDrawable = mView.getDrawable();
|
placeHolderDrawable = mView.getDrawable();
|
||||||
|
if (placeHolderDrawable instanceof BitmapDrawable) {
|
||||||
|
Bitmap bitmap = ((BitmapDrawable) placeHolderDrawable).getBitmap();
|
||||||
|
Bitmap newBitmap = bitmap.copy(Bitmap.Config.ARGB_8888, false);
|
||||||
|
placeHolderDrawable = new BitmapDrawable(newBitmap);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
placeHolderDrawable = getPlaceHolderDrawable();
|
placeHolderDrawable = getPlaceHolderDrawable();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user