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