diff --git a/doric-android/doric/src/main/java/pub/doric/shader/SuperNode.java b/doric-android/doric/src/main/java/pub/doric/shader/SuperNode.java index b03d55aa..0bfa6f4c 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/SuperNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/SuperNode.java @@ -105,6 +105,7 @@ public abstract class SuperNode extends ViewNode { layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT; break; default: + layoutParams.width = Math.max(0, layoutParams.width); break; } } @@ -117,6 +118,7 @@ public abstract class SuperNode extends ViewNode { layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT; break; default: + layoutParams.height = Math.max(0, layoutParams.height); break; } } diff --git a/doric-android/doric/src/main/java/pub/doric/shader/ViewNode.java b/doric-android/doric/src/main/java/pub/doric/shader/ViewNode.java index ac72bef1..2c642446 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/ViewNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/ViewNode.java @@ -117,6 +117,10 @@ public abstract class ViewNode extends DoricContextHolder { public void blend(JSObject jsObject) { if (jsObject != null) { + JSValue value = jsObject.getProperty("layoutConfig"); + if (value.isObject()) { + setLayoutConfig(value.asObject()); + } for (String prop : jsObject.propertySet()) { blend(mView, prop, jsObject.getProperty(prop)); } @@ -252,9 +256,6 @@ public abstract class ViewNode extends DoricContextHolder { } }); break; - case "layoutConfig": - setLayoutConfig(prop.asObject()); - break; case "border": if (prop.isObject()) { requireDoricLayer().setBorder(DoricUtils.dp2px(prop.asObject().getProperty("width").asNumber().toFloat()),