feat:Image support animated image

This commit is contained in:
pengfei.zhou
2019-11-27 19:15:57 +08:00
parent ea8ea4a8ff
commit 8b1ed0acc8
6 changed files with 31 additions and 34 deletions

View File

@@ -34,6 +34,7 @@ import com.bumptech.glide.request.target.Target;
import pub.doric.DoricContext;
import pub.doric.extension.bridge.DoricPlugin;
import pub.doric.utils.DoricUtils;
import com.github.pengfeizhou.jscore.JSONBuilder;
import com.github.pengfeizhou.jscore.JSValue;
@@ -77,8 +78,8 @@ public class ImageNode extends ViewNode<ImageView> {
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
if (!TextUtils.isEmpty(loadCallbackId)) {
callJSResponse(loadCallbackId, new JSONBuilder()
.put("width", resource.getIntrinsicWidth())
.put("height", resource.getIntrinsicHeight())
.put("width", DoricUtils.px2dp(resource.getIntrinsicWidth()))
.put("height", DoricUtils.px2dp(resource.getIntrinsicHeight()))
.toJSONObject());
}
return false;