From 90c5dd28b4d289f80c9f327317199faa066f36f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Thu, 31 Oct 2019 19:10:07 +0800 Subject: [PATCH 1/2] return corresponding js decoder on sync --- .../src/main/java/pub/doric/engine/remote/RemoteJSExecutor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Android/doric/src/main/java/pub/doric/engine/remote/RemoteJSExecutor.java b/Android/doric/src/main/java/pub/doric/engine/remote/RemoteJSExecutor.java index 9917c60d..b8ff35f0 100644 --- a/Android/doric/src/main/java/pub/doric/engine/remote/RemoteJSExecutor.java +++ b/Android/doric/src/main/java/pub/doric/engine/remote/RemoteJSExecutor.java @@ -166,7 +166,7 @@ public class RemoteJSExecutor { webSocket.send(gson.toJson(jo)); LockSupport.park(Thread.currentThread()); - return null; + return temp; } public void destroy() { From ff457ca7c742f8c7c211b657296d677d98a5a3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Thu, 31 Oct 2019 20:22:00 +0800 Subject: [PATCH 2/2] add debug bottom sheet --- .../java/pub/doric/demo/MainActivity.java | 20 ++++++++--- .../app/src/main/res/layout/activity_main.xml | 2 +- Android/doric/build.gradle | 4 ++- .../src/main/java/pub/doric/DevPanel.java | 28 +++++++++++++++ .../java/pub/doric/engine/DoricJSEngine.java | 4 +-- .../doric/src/main/res/layout/layout_dev.xml | 34 +++++++++++++++++++ 6 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 Android/doric/src/main/java/pub/doric/DevPanel.java create mode 100644 Android/doric/src/main/res/layout/layout_dev.xml diff --git a/Android/app/src/main/java/pub/doric/demo/MainActivity.java b/Android/app/src/main/java/pub/doric/demo/MainActivity.java index 9a9a6b8a..5be44d29 100644 --- a/Android/app/src/main/java/pub/doric/demo/MainActivity.java +++ b/Android/app/src/main/java/pub/doric/demo/MainActivity.java @@ -15,22 +15,26 @@ */ package pub.doric.demo; -import androidx.appcompat.app.AppCompatActivity; - import android.os.Bundle; +import android.view.KeyEvent; import android.view.ViewGroup; import android.widget.FrameLayout; +import androidx.appcompat.app.AppCompatActivity; + +import java.io.IOException; + +import pub.doric.DevPanel; import pub.doric.Doric; import pub.doric.DoricContext; import pub.doric.dev.LocalServer; import pub.doric.utils.DoricUtils; -import java.io.IOException; - public class MainActivity extends AppCompatActivity { + private DevPanel mDevPanel = new DevPanel(); + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -47,4 +51,12 @@ public class MainActivity extends AppCompatActivity { e.printStackTrace(); } } + + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) { + if (KeyEvent.KEYCODE_MENU == event.getKeyCode()) { + mDevPanel.show(getSupportFragmentManager(), "DevPanel"); + } + return super.onKeyDown(keyCode, event); + } } diff --git a/Android/app/src/main/res/layout/activity_main.xml b/Android/app/src/main/res/layout/activity_main.xml index 1b859062..8e62fba9 100644 --- a/Android/app/src/main/res/layout/activity_main.xml +++ b/Android/app/src/main/res/layout/activity_main.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="com.github.penfeizhou.doricdemo.pub.doric.demo.MainActivity"> + tools:context=".MainActivity"> + + + + + + + + \ No newline at end of file