remove unused code

androidx
Zhanty 5 years ago
parent 61a61412f5
commit e926991c60
  1. 34
      lib_social/src/main/java/com/android/sdk/social/wechat/WeChatManager.java

@ -31,7 +31,6 @@ public class WeChatManager {
private static String sAppId; private static String sAppId;
private static String sAppSecret; private static String sAppSecret;
private static WeChatShareCallback sWeChatShareCallback;
/** /**
* @param context 上下文 * @param context 上下文
@ -302,8 +301,7 @@ public class WeChatManager {
// 分享 // 分享
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
public boolean share(WeChatShareInfo.ShareContent content, WeChatShareCallback shareCallback) { public boolean share(WeChatShareInfo.ShareContent content) {
sWeChatShareCallback = shareCallback;
try { try {
SendMessageToWX.Req baseReq = WeChatShareInfo.buildReq(content); SendMessageToWX.Req baseReq = WeChatShareInfo.buildReq(content);
mWxApi.sendReq(baseReq); mWxApi.sendReq(baseReq);
@ -314,46 +312,22 @@ public class WeChatManager {
} }
} }
/**
* 微信分享回调
*
* @param baseResp
*/
private static void handleSendMessageResp(BaseResp baseResp) { private static void handleSendMessageResp(BaseResp baseResp) {
switch (baseResp.errCode) { switch (baseResp.errCode) {
case BaseResp.ErrCode.ERR_OK: case BaseResp.ErrCode.ERR_OK:
if (sWeChatShareCallback != null) { //todo success
sWeChatShareCallback.onSuccess();
}
break; break;
case BaseResp.ErrCode.ERR_USER_CANCEL: case BaseResp.ErrCode.ERR_USER_CANCEL:
if (sWeChatShareCallback != null) { //todo canceled
sWeChatShareCallback.onCancel();
}
break; break;
case BaseResp.ErrCode.ERR_AUTH_DENIED: case BaseResp.ErrCode.ERR_AUTH_DENIED:
case BaseResp.ErrCode.ERR_SENT_FAILED: case BaseResp.ErrCode.ERR_SENT_FAILED:
case BaseResp.ErrCode.ERR_UNSUPPORT: case BaseResp.ErrCode.ERR_UNSUPPORT:
case BaseResp.ErrCode.ERR_COMM: case BaseResp.ErrCode.ERR_COMM:
case BaseResp.ErrCode.ERR_BAN: case BaseResp.ErrCode.ERR_BAN:
if (sWeChatShareCallback != null) { //todo error
sWeChatShareCallback.onFailed(baseResp);
}
break; break;
} }
} }
public interface WeChatShareCallback {
void onSuccess();
void onCancel();
void onFailed(BaseResp baseResp);
}
public static void destroyShareCallback() {
if (sWeChatShareCallback != null)
sWeChatShareCallback = null;
}
} }
Loading…
Cancel
Save