对接工具箱接口,工具箱详情增加分享功能

This commit is contained in:
kehaoyuan
2017-05-27 16:46:02 +08:00
parent e81bbf5195
commit 8c5265f9b5
16 changed files with 318 additions and 63 deletions

View File

@ -60,7 +60,8 @@ public class ShareUtils {
private String shareIcon;
private String shareNewsTitle; // shareNewsTitle不为空就是新闻分享否则是游戏分享
private boolean isPlugin = false;
private Boolean ispopupWindow;
private boolean ispopupWindow;
private boolean isToolsBox;
private int[] arrLogo = {
R.drawable.share_wechat_logo,
@ -133,13 +134,14 @@ public class ShareUtils {
* @param ispopupWindow 判断是否是 PopupWindow false可直接嵌套进布局分享光环view是父控件
*/
public void showShareWindows(View view, String url, String gameName, String icon, String newsTitle,
boolean isPlugin, boolean ispopupWindow) {
boolean isPlugin, boolean ispopupWindow, boolean isToolsBox) {
this.shareIcon = icon;
this.shareGameName = gameName;
this.shareUrl = url;
this.shareNewsTitle = newsTitle;
this.isPlugin = isPlugin;
this.ispopupWindow = ispopupWindow;
this.isToolsBox = isToolsBox;
View contentView = View.inflate(mContext, R.layout.share_popup_layout, null);
contentView.setFocusable(true);
@ -208,7 +210,10 @@ public class ShareUtils {
String title;
String summary;
if (ispopupWindow) {
if (isToolsBox) {
title = shareNewsTitle;
summary = shareGameName;
} else if (ispopupWindow) {
if (shareNewsTitle != null) {
title = shareNewsTitle;
summary = "来自光环助手(最强卡牌神器)";
@ -249,12 +254,15 @@ public class ShareUtils {
String title;
String summary;
if (ispopupWindow) {
if (isToolsBox) {
title = shareNewsTitle;
summary = shareGameName;
} else if (ispopupWindow) {
if (shareNewsTitle != null) {
title = shareNewsTitle;
summary = "来自光环助手(最强卡牌神器)";
} else {
title = "向你推荐";
title = "向你推荐";
if (isPlugin) {
summary = shareGameName + "(光环加速版)";
} else {
@ -356,7 +364,10 @@ public class ShareUtils {
String title;
String summary = null;
if (ispopupWindow) {
if (isToolsBox) {
title = shareNewsTitle;
summary = shareGameName;
} else if (ispopupWindow) {
if (shareNewsTitle != null) {
title = shareNewsTitle;
} else {
@ -401,7 +412,9 @@ public class ShareUtils {
String title;
if (ispopupWindow) {
if (isToolsBox) {
title = shareNewsTitle;
} else if (ispopupWindow) {
if (shareNewsTitle != null) {
title = shareNewsTitle;
} else {
@ -431,7 +444,7 @@ public class ShareUtils {
//新浪微博分享
private void sinaWeiboSahre() {
Intent intent = WeiBoShareActivity.getWeiboshareIntent(mContext,
shareNewsTitle, shareIcon, shareGameName, shareUrl, isPlugin, ispopupWindow);
shareNewsTitle, shareIcon, shareGameName, shareUrl, isPlugin, ispopupWindow, isToolsBox);
mContext.startActivity(intent);
if (ispopupWindow) {
@ -442,7 +455,9 @@ public class ShareUtils {
//短信分享
private void shortMessageSahre() {
String smsBody;
if (ispopupWindow) {
if (isToolsBox) {
smsBody = shareNewsTitle + shareUrl;
} else if (ispopupWindow) {
if (shareNewsTitle != null) {
smsBody = shareNewsTitle + shareUrl;
} else {
@ -473,7 +488,7 @@ public class ShareUtils {
private void copyLink(String copyContent) {
ClipboardManager cmb = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
cmb.setText(copyContent);
if (ispopupWindow != null && ispopupWindow) {
if (ispopupWindow) {
Utils.toast(mContext, "复制成功");
popupWindow.dismiss();
} else {