private WXAnimationBean createAnimationBean(String ref, String animation) { try { WXAnimationBean animationBean = JSONObject.parseObject(animation, WXAnimationBean.class); if (animationBean != null && animationBean.styles != null) { WXDomObject domObject = mRegistry.get(ref); int width = (int) domObject.getLayoutWidth(); int height = (int) domObject.getLayoutHeight(); animationBean.styles.init( animationBean.styles.transformOrigin, animationBean.styles.transform, width, height); } return animationBean; } catch (RuntimeException e) { WXLogUtils.e("", e); return null; } }
private WXAnimationBean createAnimationBean(String ref, Map<String, Object> style) { if (style != null) { try { Object transform = style.get(WXDomObject.TRANSFORM); if (transform instanceof String && !TextUtils.isEmpty((String) transform)) { String transformOrigin = (String) style.get(WXDomObject.TRANSFORM_ORIGIN); WXAnimationBean animationBean = new WXAnimationBean(); WXDomObject domObject = mRegistry.get(ref); int width = (int) domObject.getLayoutWidth(); int height = (int) domObject.getLayoutHeight(); animationBean.styles = new WXAnimationBean.Style(); animationBean.styles.init(transformOrigin, (String) transform, width, height); return animationBean; } } catch (RuntimeException e) { WXLogUtils.e("", e); return null; } } return null; }