| | |
| | | import io.flutter.plugin.common.MethodChannel; |
| | | import io.flutter.plugin.common.MethodCodec; |
| | | import io.flutter.plugin.common.StandardMessageCodec; |
| | | import io.flutter.plugin.common.StandardMethodCodec; |
| | | |
| | | public class UIMethodChannel extends MethodChannel { |
| | | public UIMethodChannel(BinaryMessenger messenger, Context context, DataListener dataListener) { |
| | | super(messenger, "com.yeshi.video/ui", (MethodCodec) StandardMessageCodec.INSTANCE); |
| | | super(messenger, "com.yeshi.video/ui", StandardMethodCodec.INSTANCE); |
| | | setMethodCallHandler(new MethodCallHandler() { |
| | | @Override |
| | | public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { |
| | |
| | | StatusBarUtil.setDarkMode(FlutterBoost.instance().currentActivity()); |
| | | } |
| | | break; |
| | | //跳转原生页面 |
| | | case "jumpAppPage": { |
| | | Map<String, Object> params = (Map<String, Object>) call.arguments; |
| | | String type = params.get("type").toString(); |
| | | Map<String, Object> ps = (Map<String, Object>) params.get("params"); |
| | | dataListener.jumpAppPage(type, ps); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | }); |
| | |
| | | public interface DataListener { |
| | | //状态栏是否默认浅色 |
| | | public boolean isStatusBarDefaultLight(); |
| | | |
| | | public void jumpAppPage(String type, Map<String, Object> params); |
| | | |
| | | } |
| | | } |