接口修改

master
kangxuyao 2021-02-07 18:29:17 +08:00
parent d490c0a271
commit cd998489cb
1 changed files with 6 additions and 5 deletions

View File

@ -55,14 +55,14 @@ public class AppletHandlerModule extends BaseApi {
@Override @Override
public void shareAppMessage(@NotNull String s, @Nullable Bitmap bitmap, @NotNull IAppletCallback iAppletCallback) { public void shareAppMessage(@NotNull String s, @Nullable Bitmap bitmap, @NotNull IAppletCallback iAppletCallback) {
Log.d("MopPlugin", "shareAppMessage:" + s+" bitmap:"+bitmap); Log.d("MopPlugin", "shareAppMessage:" + s + " bitmap:" + bitmap);
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("appletInfo", GsonUtil.gson.fromJson(s, new TypeToken<Map<String, Object>>() { params.put("appletInfo", GsonUtil.gson.fromJson(s, new TypeToken<Map<String, Object>>() {
}.getType())); }.getType()));
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] data = baos.toByteArray(); byte[] data = baos.toByteArray();
params.put("bitmap",data); params.put("bitmap", data);
handler.post(() -> { handler.post(() -> {
channel.invokeMethod("extensionApi:forwardApplet", params, new MethodChannel.Result() { channel.invokeMethod("extensionApi:forwardApplet", params, new MethodChannel.Result() {
@Override @Override
@ -159,10 +159,11 @@ public class AppletHandlerModule extends BaseApi {
} }
@Override @Override
public void onRegisteredMoreMenuItemClicked(@NotNull String s,String path, int i) { public void onRegisteredMoreMenuItemClicked(@NotNull String appId, @NotNull String path, @NotNull String menuItemId, @Nullable String appInfo, @Nullable Bitmap bitmap, @NotNull IAppletCallback iAppletCallback) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("appId", s); params.put("appId", appId);
params.put("menuId", i); params.put("menuId", menuItemId);
handler.post(() -> { handler.post(() -> {
channel.invokeMethod("extensionApi:onCustomMenuClick", params); channel.invokeMethod("extensionApi:onCustomMenuClick", params);
}); });