From 7bf1deeb5d43917b9e614c8ddf9e318a2544b592 Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Thu, 4 Mar 2021 16:45:47 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=B8=8D=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E6=8E=A5=E6=94=B6=E6=9B=B4=E5=A4=9A=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mop/api/mop/AppletHandlerModule.java | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java b/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java index 831e7ab..168373e 100644 --- a/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java +++ b/android/src/main/java/com/finogeeks/mop/api/mop/AppletHandlerModule.java @@ -133,7 +133,7 @@ public class AppletHandlerModule extends BaseApi { @Override public void success(Object result) { List> ret = (List>) result; - FinAppTrace.d(TAG, "getRegisteredMoreMenuItems success : " + ret + " size : " + ret.size()); + FinAppTrace.d(TAG, "getCustomMenus success : " + ret + " size : " + ret.size()); if (ret != null) { for (Map map : ret) { String type = (String) map.get("type"); @@ -151,13 +151,13 @@ public class AppletHandlerModule extends BaseApi { @Override public void error(String errorCode, String errorMessage, Object errorDetails) { - FinAppTrace.e(TAG, "getRegisteredMoreMenuItems errorCode : " + errorCode + " errorMessage : " + errorMessage); + FinAppTrace.e(TAG, "getCustomMenus errorCode : " + errorCode + " errorMessage : " + errorMessage); latch.countDown(); } @Override public void notImplemented() { - FinAppTrace.d(TAG, "getRegisteredMoreMenuItems notImplemented"); + FinAppTrace.d(TAG, "getCustomMenus notImplemented"); latch.countDown(); } }); @@ -173,14 +173,31 @@ public class AppletHandlerModule extends BaseApi { @Override public void onRegisteredMoreMenuItemClicked(@NotNull String appId, @NotNull String path, @NotNull String menuItemId, @Nullable String appInfo, @Nullable Bitmap bitmap, @NotNull IAppletCallback iAppletCallback) { - Map params = new HashMap<>(); params.put("appId", appId); params.put("path", path); params.put("menuId", menuItemId); params.put("appInfo", appInfo); handler.post(() -> { - channel.invokeMethod("extensionApi:onCustomMenuClick", params); + channel.invokeMethod("extensionApi:onCustomMenuClick", params, new MethodChannel.Result() { + @Override + public void success(Object result) { + FinAppTrace.d(TAG, "onCustomMenuClick success"); + iAppletCallback.onSuccess(null); + } + + @Override + public void error(String errorCode, String errorMessage, Object errorDetails) { + FinAppTrace.e(TAG, "onCustomMenuClick errorCode : " + errorCode + " errorMessage : " + errorMessage); + iAppletCallback.onFailure(); + } + + @Override + public void notImplemented() { + FinAppTrace.d(TAG, "onCustomMenuClick notImplemented"); + iAppletCallback.onFailure(); + } + }); }); }