本地版本
parent
abb51a0364
commit
68069af2b6
|
@ -91,6 +91,6 @@ kapt {
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation 'com.finogeeks.lib:finapplet:2.38.10-alpha20221207v05'
|
implementation 'com.finogeeks.lib:finapplet:2.38.10-alpha20221209v01'
|
||||||
implementation 'com.finogeeks.mop:plugins:2.38.10-alpha20221207v05'
|
implementation 'com.finogeeks.mop:plugins:2.38.10-alpha20221209v01'
|
||||||
}
|
}
|
|
@ -1,38 +1,29 @@
|
||||||
package com.finogeeks.mop.utils;
|
package com.finogeeks.mop.utils;
|
||||||
|
|
||||||
import android.app.PendingIntent;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
import com.finogeeks.lib.applet.client.FinAppClient;
|
import com.finogeeks.lib.applet.client.FinAppClient;
|
||||||
|
import com.finogeeks.lib.applet.client.FinAppProcessClient;
|
||||||
|
import com.finogeeks.lib.applet.main.FinAppHomeActivity;
|
||||||
import com.finogeeks.mop.interfaces.ICallback;
|
import com.finogeeks.mop.interfaces.ICallback;
|
||||||
|
|
||||||
public class AppletUtils {
|
public class AppletUtils {
|
||||||
public static void moveCurrentAppletToFront(Context context, ICallback<Object> callback) {
|
public static void moveCurrentAppletToFront(Context context, ICallback<Object> callback) {
|
||||||
try {
|
try {
|
||||||
String currentAppletId = FinAppClient.INSTANCE.getAppletApiManager().getCurrentAppletId();
|
if (FinAppClient.INSTANCE.isFinAppProcess(context)) {
|
||||||
if (currentAppletId == null || TextUtils.isEmpty(currentAppletId)) {
|
FinAppHomeActivity activity = (FinAppHomeActivity) FinAppProcessClient.INSTANCE.getAppletProcessActivity();
|
||||||
if (callback != null) {
|
if (activity != null) {
|
||||||
callback.onFail(null);
|
activity.moveTaskToFront();
|
||||||
}
|
}
|
||||||
return;
|
} else {
|
||||||
}
|
String currentAppletId = FinAppClient.INSTANCE.getAppletApiManager().getCurrentAppletId();
|
||||||
String activityName = FinAppClient.INSTANCE.getAppletApiManager().getAppletActivityName(currentAppletId);
|
if (currentAppletId != null) {
|
||||||
if (activityName == null) {
|
FinAppClient.INSTANCE.getAppletApiManager().moveTaskToFront(currentAppletId);
|
||||||
if (callback != null) {
|
|
||||||
callback.onFail(null);
|
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (activityName.contains("@")) {
|
if (callback != null) {
|
||||||
activityName = activityName.substring(0, activityName.indexOf("@"));
|
callback.onSuccess(null);
|
||||||
}
|
}
|
||||||
Intent intent = new Intent(context, Class.forName(activityName));
|
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivities(context, 0, new Intent[]{intent}, 0);
|
|
||||||
pendingIntent.send();
|
|
||||||
callback.onSuccess(null);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
|
|
Loading…
Reference in New Issue