重新整理ShareUtils,增加社区相关分享

This commit is contained in:
kehaoyuan
2018-01-05 18:17:39 +08:00
parent 4a7384d371
commit d118f54bd3
17 changed files with 335 additions and 257 deletions

View File

@ -24,7 +24,6 @@ import org.json.JSONException;
import org.json.JSONObject;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import butterknife.ButterKnife;
@ -90,26 +89,14 @@ public abstract class BaseActivity extends BaseToolBarActivity implements EasyPe
toast(getString(msg));
}
//如果是游戏分享newsTitle默认为空
public void showShare(String url, String gameName, String icon, String newsTitle, ArrayList<String> tagList, boolean isToolsBox) {
public void showShare(String url, String icon, String shareTitle, String shareSummary, ShareUtils.ShareType shareType) {
//判断是否是官方版
boolean isPlugin = false;
// tagList.contains("官方版")???
if (tagList != null) {
for (String s : tagList) {
if (!"官方版".equals(s)) {
isPlugin = true;
}
}
}
ShareUtils.getInstance(this).showShareWindows(getWindow().getDecorView(), url, icon, shareTitle, shareSummary, shareType);
ShareUtils.getInstance(this).showShareWindows(getWindow().getDecorView(), url, gameName, icon, newsTitle, isPlugin, true, isToolsBox);
if (newsTitle == null) {
DataUtils.onEvent(this, "内容分享", gameName);
if (shareType == ShareUtils.ShareType.game || shareType == ShareUtils.ShareType.plugin) {
DataUtils.onEvent(this, "内容分享", shareTitle + shareSummary);
} else {
DataUtils.onEvent(this, "内容分享", newsTitle);
DataUtils.onEvent(this, "内容分享", shareTitle);
}
}