android:fix DoricPanel cannot build automaticaly

This commit is contained in:
pengfei.zhou 2020-04-01 14:12:55 +08:00 committed by osborn
parent 3bbf671420
commit 9c520e1dc5

View File

@ -66,7 +66,7 @@ public class DoricPanel extends FrameLayout implements LifecycleObserver {
public void config(DoricContext doricContext) { public void config(DoricContext doricContext) {
mDoricContext = doricContext; mDoricContext = doricContext;
mDoricContext.getRootNode().setRootView(this); mDoricContext.getRootNode().setRootView(this);
if (getMeasuredWidth() != 0 && getMeasuredHeight() != 0) { if (getMeasuredWidth() != 0 || getMeasuredHeight() != 0) {
mDoricContext.build(DoricUtils.px2dp(getMeasuredWidth()), DoricUtils.px2dp(getMeasuredHeight())); mDoricContext.build(DoricUtils.px2dp(getMeasuredWidth()), DoricUtils.px2dp(getMeasuredHeight()));
} }
} }