feat: Image loadCallback add animated prop

This commit is contained in:
pengfei.zhou
2021-09-23 18:15:55 +08:00
committed by osborn
parent c452ebffda
commit 3fd8405e0b
10 changed files with 6638 additions and 6912 deletions

View File

@@ -23,6 +23,7 @@ import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
@@ -284,11 +285,13 @@ public class ImageNode extends ViewNode<ImageView> {
callJSResponse(loadCallbackId, new JSONBuilder()
.put("width", DoricUtils.px2dp(bitmap.getWidth()))
.put("height", DoricUtils.px2dp(bitmap.getHeight()))
.put("animated", resource instanceof Animatable)
.toJSONObject());
} else {
callJSResponse(loadCallbackId, new JSONBuilder()
.put("width", DoricUtils.px2dp(resource.getIntrinsicWidth()))
.put("height", DoricUtils.px2dp(resource.getIntrinsicHeight()))
.put("animated", resource instanceof Animatable)
.toJSONObject());
}
}