closeApplet接口实现及closeAllApplets接口行为统一

master
kangxuyao 2022-02-17 17:17:56 +08:00
parent 2a37f6a14a
commit d8acdb989d
1 changed files with 10 additions and 2 deletions

View File

@ -30,7 +30,7 @@ public class AppletManageModule extends BaseApi {
@Override
public String[] apis() {
return new String[]{"currentApplet", "closeAllApplets", "clearApplets", "removeUsedApplet",
return new String[]{"currentApplet", "closeAllApplets", "clearApplets", "removeUsedApplet", "closeApplet",
"setActivityTransitionAnim", "sendCustomEvent", "callJS"};
}
@ -56,8 +56,16 @@ public class AppletManageModule extends BaseApi {
callback.onSuccess(null);
}
} else if (event.equals("closeAllApplets")) {
FinAppClient.INSTANCE.getAppletApiManager().finishAllRunningApplets();
FinAppClient.INSTANCE.getAppletApiManager().closeApplets();
callback.onSuccess(null);
} else if (event.equals("closeApplet")) {
if (param.containsKey("appId") && param.get("appId") instanceof String) {
String appId = (String) param.get("appId");
FinAppClient.INSTANCE.getAppletApiManager().closeApplet(appId);
callback.onSuccess(null);
} else {
callback.onFail(null);
}
} else if (event.equals("clearApplets")) {
FinAppClient.INSTANCE.getAppletApiManager().clearApplets();
callback.onSuccess(null);