use of com.taobao.weex.dom.ImmutableDomObject in project weex-example by KalicyZhou.
the class WXImage method updateProperties.
@Override
public void updateProperties(Map<String, Object> props) {
super.updateProperties(props);
WXImageView imageView;
ImmutableDomObject imageDom;
if ((imageDom = getDomObject()) != null && getHostView() instanceof WXImageView) {
imageView = (WXImageView) getHostView();
BorderDrawable borderDrawable = WXViewUtils.getBorderDrawable(getHostView());
float[] borderRadius;
if (borderDrawable != null) {
RectF borderBox = new RectF(0, 0, WXDomUtils.getContentWidth(imageDom), WXDomUtils.getContentHeight(imageDom));
borderRadius = borderDrawable.getBorderRadius(borderBox);
} else {
borderRadius = new float[] { 0, 0, 0, 0, 0, 0, 0, 0 };
}
imageView.setBorderRadius(borderRadius);
if (imageView.getDrawable() instanceof ImageDrawable) {
ImageDrawable imageDrawable = (ImageDrawable) imageView.getDrawable();
float[] previousRadius = imageDrawable.getCornerRadii();
if (!Arrays.equals(previousRadius, borderRadius)) {
imageDrawable.setCornerRadii(borderRadius);
}
}
readyToRender();
}
}
Aggregations