Conflicts:
	app/src/main/java/com/gh/gamecenter/GameDetailsActivity.java
This commit is contained in:
huangzhuanghua
2016-09-06 18:21:13 +08:00
23 changed files with 444 additions and 104 deletions

View File

@ -21,6 +21,7 @@ import com.gh.common.util.DialogUtils;
import com.gh.common.util.DisplayUtils;
import com.gh.common.util.PackageUtils;
import com.gh.common.util.RunningUtils;
import com.gh.common.util.ShareUtils;
import com.gh.common.util.Utils;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.MainActivity;
@ -30,11 +31,10 @@ import com.gh.gamecenter.manager.SystemBarTintManager;
import com.gh.gamecenter.manager.SystemBarTintManager.SystemBarConfig;
import java.lang.reflect.Field;
import java.util.ArrayList;
import cn.sharesdk.framework.ShareSDK;
import de.greenrobot.event.EventBus;
import onekeyshare.OnekeyShare;
import onekeyshare.themes.classic.PlatformPage;
public class BaseActivity extends Activity {
@ -141,53 +141,30 @@ public class BaseActivity extends Activity {
window.setAttributes(winParams);
}
public void showShare(String url, String title, String icon, String entrance, String type) {
if (isShowShare){
return;
}
//如果是游戏分享newsTitle默认为空
public void showShare(String url, String gameName, String icon, String newsTitle, ArrayList<String> tag, String entrance, String type) {
ShareSDK.initSDK(this);
OnekeyShare oks = new OnekeyShare();
// 关闭sso授权
oks.disableSSOWhenAuthorize();
// 分享时Notification的图标和文字 2.5.9以后的版本不调用此方法
// oks.setNotification(R.drawable.ic_launcher,
// getString(R.string.app_name));
// title标题印象笔记、邮箱、信息、微信、人人网和QQ空间使用
oks.setTitle(title);
// titleUrl是标题的网络链接仅在人人网和QQ空间使用
oks.setTitleUrl(url);
// text是分享文本所有平台都需要这个字段
oks.setText(title + " " + url);
// imagePath是图片的本地路径Linked-In以外的平台都支持此参数
// oks.setImagePath(icon);//确保SDcard下面存在此张图片
oks.setImageUrl(icon);
// url仅在微信包括好友和朋友圈中使用
oks.setUrl(url);
// comment是我对这条分享的评论仅在人人网和QQ空间使用
oks.setComment("精彩尽在" + url);
// site是分享此内容的网站名称仅在QQ空间使用
oks.setSite(this.getString(R.string.app_name));
// siteUrl是分享此内容的网站地址仅在QQ空间使用
oks.setSiteUrl(url);
oks.setOnFinishListener(new PlatformPage.OnFinishListener() {
@Override
public void onFinish() {
Utils.log("onFinish");
isShowShare = false;
//判断是否是官方版
boolean isPlugin = false;
if (tag != null){
for (String s : tag) {
if (!"官方版".equals(s)){
isPlugin = true;
}
}
});
}
// 启动分享GUI
oks.show(this);
DataUtils.onEvent(this, "内容分享", title);
isShowShare = true;
ShareUtils.getInstance(this).showShareWindows(new View(this), url, gameName, icon, newsTitle, isPlugin);
if (newsTitle == null){
DataUtils.onEvent(this, "内容分享", gameName);
}else {
DataUtils.onEvent(this, "内容分享", newsTitle);
}
}
private boolean isShowShare = false;
public void onEventMainThread(final EBShowDialog showDialog) {
if (!isPause && this.getClass().getName().equals(RunningUtils.getTopActivity(this))) {