From 0cc9417cb65c0f85d92475c2c0b4e03cc42f0426 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Mon, 19 Jul 2021 16:58:01 +0800 Subject: [PATCH] feat:fix android show node tree --- .../java/pub/doric/devkit/ui/DoricDevActivity.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doric-android/devkit/src/main/java/pub/doric/devkit/ui/DoricDevActivity.java b/doric-android/devkit/src/main/java/pub/doric/devkit/ui/DoricDevActivity.java index d75a3bff..b023ded5 100644 --- a/doric-android/devkit/src/main/java/pub/doric/devkit/ui/DoricDevActivity.java +++ b/doric-android/devkit/src/main/java/pub/doric/devkit/ui/DoricDevActivity.java @@ -364,9 +364,6 @@ public class DoricDevActivity extends AppCompatActivity implements DoricDev.Stat builder.show(); } }); - ArrayList list = new ArrayList<>(); - list.add("View source"); - list.add("Show node tree"); if (DoricDev.getInstance().isInDevMode()) { if (context.getDriver() instanceof DoricDebugDriver) { actionMap.put("Stop debugging", new DialogInterface.OnClickListener() { @@ -408,6 +405,15 @@ public class DoricDevActivity extends AppCompatActivity implements DoricDev.Stat } }); } + + actionMap.put("Show node tree", new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Intent intent = new Intent(holder.itemView.getContext(), DoricShowNodeTreeActivity.class); + intent.putExtra(DORIC_CONTEXT_ID_KEY, context.getContextId()); + v.getContext().startActivity(intent); + } + }); final String[] items = actionMap.keySet().toArray(new String[0]); AlertDialog.Builder builder = new AlertDialog.Builder(holder.itemView.getContext(), R.style.Theme_Doric_Modal); builder.setTitle(String.format("%s %s", context.getContextId(), context.getSource()));