分享模块,下载合集微调

This commit is contained in:
khy
2016-09-05 11:14:24 +08:00
parent 87b47a9c31
commit bfd31516ba
17 changed files with 379 additions and 86 deletions

View File

@ -22,6 +22,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.gamecenter.MainActivity;
import com.gh.gamecenter.R;
@ -33,8 +34,6 @@ import java.lang.reflect.Field;
import cn.sharesdk.framework.ShareSDK;
import de.greenrobot.event.EventBus;
import onekeyshare.OnekeyShare;
import onekeyshare.themes.classic.PlatformPage;
public class BaseActivity extends Activity {
private String LOG = this.getClass().getName();
@ -149,51 +148,51 @@ public class BaseActivity extends Activity {
public void showShare(String url, String title, String icon, String entrance, String type) {
if (isShowShare){
return;
}
// if (isShowShare){
// return;
// }
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;
}
});
// 启动分享GUI
oks.show(this);
ShareUtils.getInstance(this).showShareWindows(new View(this), url, title, icon);
// 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;
// }
// });
//
// // 启动分享GUI
// oks.show(this);
DataUtils.onEvent(this, "内容分享", title);
isShowShare = true;
// isShowShare = true;
}
private boolean isShowShare = false;
// private boolean isShowShare = false;
public void onEventMainThread(final EBShowDialog showDialog) {
if (!isPause && this.getClass().getName().equals(RunningUtils.getTopActivity(this))) {