From e9197ec1737a47679c40a82412697829e60d7f07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Thu, 27 Feb 2020 17:08:40 +0800 Subject: [PATCH] remove reInit method --- .../pub/doric/devkit/DoricContextDebuggable.java | 11 +++++++++-- .../doric/src/main/java/pub/doric/DoricContext.java | 13 +++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/doric-android/devkit/src/main/java/pub/doric/devkit/DoricContextDebuggable.java b/doric-android/devkit/src/main/java/pub/doric/devkit/DoricContextDebuggable.java index b98ef9ab..98f50fb4 100644 --- a/doric-android/devkit/src/main/java/pub/doric/devkit/DoricContextDebuggable.java +++ b/doric-android/devkit/src/main/java/pub/doric/devkit/DoricContextDebuggable.java @@ -3,6 +3,7 @@ package pub.doric.devkit; import pub.doric.DoricContext; import pub.doric.DoricContextManager; import pub.doric.DoricNativeDriver; +import pub.doric.utils.DoricConstant; public class DoricContextDebuggable { private DoricContext doricContext; @@ -19,7 +20,10 @@ public class DoricContextDebuggable { @Override public void start() { doricContext.setDriver(doricDebugDriver); - doricContext.reInit(); + + doricContext.getRootNode().setId(""); + doricContext.callEntity(DoricConstant.DORIC_ENTITY_INIT, doricContext.getInitParams(), doricContext.getExtra()); + doricContext.callEntity(DoricConstant.DORIC_ENTITY_CREATE); } }); } @@ -28,7 +32,10 @@ public class DoricContextDebuggable { isDebugging = false; doricDebugDriver.destroy(); doricContext.setDriver(DoricNativeDriver.getInstance()); - doricContext.reInit(); + + doricContext.getRootNode().setId(""); + doricContext.callEntity(DoricConstant.DORIC_ENTITY_INIT, doricContext.getInitParams(), doricContext.getExtra()); + doricContext.callEntity(DoricConstant.DORIC_ENTITY_CREATE); } public DoricContext getContext() { diff --git a/doric-android/doric/src/main/java/pub/doric/DoricContext.java b/doric-android/doric/src/main/java/pub/doric/DoricContext.java index dcbe4d31..7b5d571a 100644 --- a/doric-android/doric/src/main/java/pub/doric/DoricContext.java +++ b/doric-android/doric/src/main/java/pub/doric/DoricContext.java @@ -127,12 +127,6 @@ public class DoricContext { callEntity(DoricConstant.DORIC_ENTITY_CREATE); } - public void reInit() { - this.mRootNode.setId(""); - callEntity(DoricConstant.DORIC_ENTITY_INIT, this.initParams, extra); - callEntity(DoricConstant.DORIC_ENTITY_CREATE); - } - public AsyncResult callEntity(String methodName, Object... args) { return getDriver().invokeContextEntityMethod(mContextId, methodName, args); } @@ -234,4 +228,11 @@ public class DoricContext { return this.animatorSet; } + public JSONObject getInitParams() { + return initParams; + } + + public String getExtra() { + return extra; + } }