This commit is contained in:
Jack
2020-03-27 14:51:37 +08:00
parent 6c2dcc7d37
commit 5eae896330
6 changed files with 55 additions and 13 deletions

View File

@ -31,6 +31,7 @@ import com.facebook.imagepipeline.image.CloseableImage;
import com.gh.common.constant.Config;
import com.gh.gamecenter.R;
import com.gh.gamecenter.WeiBoShareActivity;
import com.gh.gamecenter.eventbus.EBShare;
import com.lightgame.utils.Utils;
import com.sina.weibo.sdk.WbSdk;
import com.sina.weibo.sdk.auth.AuthInfo;
@ -53,6 +54,8 @@ import java.util.List;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.greenrobot.eventbus.EventBus;
import static com.gh.common.util.LoginHelper.WEIBO_SCOPE;
/**
@ -97,6 +100,7 @@ public class ShareUtils {
private PopupWindow popupWindow;
private ShareType mShareType;
public static ShareType shareType;//全局保存shareType分享成功后判断分享的类型
private WeakReference<Activity> mActivity;
@ -106,6 +110,7 @@ public class ShareUtils {
@Override
public void onComplete(Object o) {
Utils.toast(mContext, R.string.share_success_hint);
EventBus.getDefault().post(new EBShare(ShareUtils.shareType));
}
@Override
@ -156,6 +161,7 @@ public class ShareUtils {
this.mSummary = shareSummary;
this.mTitle = shareTitle;
this.mShareType = shareType;
ShareUtils.shareType = mShareType;
View contentView = View.inflate(activity, R.layout.share_popup_layout, null);
contentView.setFocusable(true);
@ -181,7 +187,7 @@ public class ShareUtils {
callBack.onCancel();
} else {
if (!"复制链接".equals(arrLabel[position])) {
callBack.onSuccess();
callBack.onSuccess(arrLabel[position]);
}
}
}
@ -647,7 +653,7 @@ public class ShareUtils {
}
public interface ShareCallBack {
void onSuccess();
void onSuccess(String label);
void onCancel();
}