debug via vscode done
This commit is contained in:
parent
6ba6995d10
commit
0b2d447e2a
@ -75,10 +75,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
public void onEnterDebugEvent(EnterDebugEvent enterDebugEvent) {
|
public void onEnterDebugEvent(EnterDebugEvent enterDebugEvent) {
|
||||||
((FrameLayout) findViewById(R.id.root)).removeAllViews();
|
|
||||||
DoricDriver.getInstance().changeJSEngine(false);
|
DoricDriver.getInstance().changeJSEngine(false);
|
||||||
doricContext.init(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
doricContext.init(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||||
doricContext.getRootNode().setRootView((FrameLayout) findViewById(R.id.root));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -211,7 +211,10 @@ public class DoricJSEngine implements Handler.Callback, DoricTimerExtension.Time
|
|||||||
return mDoricRegistry;
|
return mDoricRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeJSEngine(boolean isNative) {
|
public void changeJSEngine(final boolean isNative) {
|
||||||
|
mJSHandler.post(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
mDoricJSE.teardown();
|
mDoricJSE.teardown();
|
||||||
if (isNative) {
|
if (isNative) {
|
||||||
mDoricJSE = new DoricNativeJSExecutor();
|
mDoricJSE = new DoricNativeJSExecutor();
|
||||||
@ -220,4 +223,6 @@ public class DoricJSEngine implements Handler.Callback, DoricTimerExtension.Time
|
|||||||
}
|
}
|
||||||
injectGlobal();
|
injectGlobal();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user