debugging status timing
This commit is contained in:
parent
30f61eb47c
commit
aa02bd3e8e
@ -7,18 +7,16 @@ import pub.doric.DoricNativeDriver;
|
||||
public class DoricContextDebuggable {
|
||||
private DoricContext doricContext;
|
||||
private DoricDebugDriver doricDebugDriver;
|
||||
public boolean isDebugging = false;
|
||||
public static boolean isDebugging = false;
|
||||
|
||||
public DoricContextDebuggable(String contextId) {
|
||||
this.doricContext = DoricContextManager.getContext(contextId);
|
||||
}
|
||||
|
||||
public void startDebug() {
|
||||
|
||||
doricDebugDriver = new DoricDebugDriver(new IStatusCallback() {
|
||||
@Override
|
||||
public void start() {
|
||||
isDebugging = true;
|
||||
doricContext.setDriver(doricDebugDriver);
|
||||
doricContext.reInit();
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import com.google.gson.JsonObject;
|
||||
|
||||
import pub.doric.DoricContext;
|
||||
import pub.doric.DoricContextManager;
|
||||
import pub.doric.devkit.DoricContextDebuggable;
|
||||
import pub.doric.devkit.DoricDev;
|
||||
import pub.doric.devkit.IDevKit;
|
||||
import pub.doric.devkit.R;
|
||||
@ -68,6 +69,7 @@ public class DebugContextPanel extends DialogFragment {
|
||||
cell.findViewById(R.id.debug_text_view).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DoricContextDebuggable.isDebugging = true;
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("contextId", doricContext.getContextId());
|
||||
jsonObject.addProperty("source", doricContext.getSource().replace(".js", ".ts"));
|
||||
|
@ -85,7 +85,7 @@ public class DemoDebugActivity extends DoricActivity {
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onReloadEvent(ReloadEvent reloadEvent) {
|
||||
if (doricContextDebuggable != null && doricContextDebuggable.isDebugging) {
|
||||
if (DoricContextDebuggable.isDebugging) {
|
||||
System.out.println("is debugging");
|
||||
} else {
|
||||
for (DoricContext context : DoricContextManager.aliveContexts()) {
|
||||
|
Reference in New Issue
Block a user