debug switch to native
This commit is contained in:
@@ -33,6 +33,8 @@ import pub.doric.DoricDriver;
|
||||
import pub.doric.dev.DevPanel;
|
||||
import pub.doric.dev.LocalServer;
|
||||
import pub.doric.dev.event.EnterDebugEvent;
|
||||
import pub.doric.dev.event.QuitDebugEvent;
|
||||
import pub.doric.engine.ChangeEngineCallback;
|
||||
import pub.doric.utils.DoricUtils;
|
||||
|
||||
|
||||
@@ -76,8 +78,32 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onEnterDebugEvent(EnterDebugEvent enterDebugEvent) {
|
||||
DoricDriver.getInstance().changeJSEngine(false);
|
||||
doricContext.init(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
DoricDriver.getInstance().changeJSEngine(false, new ChangeEngineCallback() {
|
||||
@Override
|
||||
public void changed() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
doricContext.init(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onQuitDebugEvent(QuitDebugEvent quitDebugEvent) {
|
||||
DoricDriver.getInstance().changeJSEngine(true, new ChangeEngineCallback() {
|
||||
@Override
|
||||
public void changed() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
doricContext.init(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user