From 9b32ac2b435ac61dffb5eddcc18cb5ebf7215846 Mon Sep 17 00:00:00 2001 From: PH2 <1293456824@qq.com> Date: Mon, 7 Sep 2020 14:45:43 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81android=20=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainActivity.java | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java index b2b9bd4..2bde311 100644 --- a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java +++ b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java @@ -1,13 +1,58 @@ package cn.zhios.zhiying_base_widget_example; +import cn.zhios.zhiying_comm.ZhiyingCommPlugin; +import cn.zhios.zhiying_comm.ZhiyingFlutterCommHandler; +import cn.zhios.zhiying_comm.ZhiyingFlutterCommNativable; +import cn.zhios.zhiying_comm.ZhiyingFlutterCommNative; +import cn.zhios.zhiying_comm.ZhiyingFlutterCommNativeResult; + +import java.util.HashMap; +import java.util.Map; + import androidx.annotation.NonNull; + import io.flutter.embedding.android.FlutterActivity; import io.flutter.embedding.engine.FlutterEngine; import io.flutter.plugins.GeneratedPluginRegistrant; -public class MainActivity extends FlutterActivity { +public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommNativable { @Override public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine); + ZhiyingFlutterCommNative.getInstance().regist(this); + } + + + boolean localDebug = false; + + @Override + public void openPage(Map params) { + + } + + @Override + public void openNativePage(Map params) { + + } + + @Override + public Map getSetting() { + Map map = new HashMap(); + map.put("domain", "http://192.168.0.113:5000"); //"http://120.76.175.204:8989"); + map.put("master_id", "123456"); + map.put("secret_key", "123456"); + map.put("token", "123465"); + return map; + } + + @Override + public void invokeMethod(String method, Map params, ZhiyingFlutterCommHandler handler) { + return; + } + + @Override + protected void onDestroy() { + super.onDestroy(); + ZhiyingFlutterCommNative.getInstance().unregist(); } }