|
@@ -1,7 +1,9 @@
|
|
|
package com.fq.channel.sdk.api;
|
|
|
|
|
|
import android.app.Activity;
|
|
|
-import android.support.annotation.NonNull;
|
|
|
+import android.content.Context;
|
|
|
+
|
|
|
+import androidx.annotation.NonNull;
|
|
|
|
|
|
import com.fq.channel.sdk.base.bean.LoginInfo;
|
|
|
import com.fq.channel.sdk.base.bean.PaymentInfo;
|
|
@@ -96,7 +98,7 @@ public class FqGameHander {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- public static void login(@NonNull Activity activity, final IResult<LoginInfo> resultLoginInfo) {
|
|
|
+ public static void login(@NonNull Activity activity, final IResult<LoginInfo> iResult) {
|
|
|
JointManager.getInstance().login(activity, new PluginResultHandler() {
|
|
|
@Override
|
|
|
public void onHandlePluginResult(PluginResult result) {
|
|
@@ -107,15 +109,15 @@ public class FqGameHander {
|
|
|
Object res_msg = result.getRawMessage();
|
|
|
JSONObject jo = (JSONObject) res_msg;
|
|
|
try {
|
|
|
- resultLoginInfo.onSuccess(new LoginInfo(jo.get("uid").toString(), jo.get("token").toString()));
|
|
|
+ iResult.onSuccess(new LoginInfo(jo.get("uid").toString(), jo.get("token").toString()));
|
|
|
} catch (JSONException e) {
|
|
|
- resultLoginInfo.onFail("JSONException");
|
|
|
+ iResult.onFail("JSONException");
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
} else if (PluginResult.Status.CANCEL == mStatus) {
|
|
|
- resultLoginInfo.onFail(result.getMessage());
|
|
|
+ iResult.onFail(result.getMessage());
|
|
|
} else if (PluginResult.Status.ERROR == mStatus) {
|
|
|
- resultLoginInfo.onFail(result.getMessage());
|
|
|
+ iResult.onFail(result.getMessage());
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -163,19 +165,23 @@ public class FqGameHander {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- public static void logout(Activity activity, final ILogout exit) {
|
|
|
+ public static void logout(Activity activity, final ILogout logout) {
|
|
|
JointManager.getInstance().logout(activity, new PluginResultHandler() {
|
|
|
@Override
|
|
|
public void onHandlePluginResult(PluginResult result) {
|
|
|
PluginResult.Status mStatus = result.getStatus();
|
|
|
FqLog.i(TAG, "logout mStatus :" + mStatus);
|
|
|
if (PluginResult.Status.OK == mStatus) {
|
|
|
- exit.onLogout();
|
|
|
+ logout.onLogout();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ public static void changeAccount(Activity activity) {
|
|
|
+ JointManager.getInstance().changeAccount(activity);
|
|
|
+ }
|
|
|
+
|
|
|
protected static void onRequestPermissionsResult(int requestCode,
|
|
|
String[] permissions, int[] grantResults) {
|
|
|
PermissionManager.getInstance().onRequestPermissionsResult(requestCode, permissions, grantResults);
|