|
@@ -81,10 +81,12 @@ import com.tencent.mm.opensdk.modelpay.PayReq;
|
|
|
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
|
|
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
|
|
import com.umeng.socialize.ShareAction;
|
|
|
+import com.umeng.socialize.ShareContent;
|
|
|
import com.umeng.socialize.UMShareAPI;
|
|
|
import com.umeng.socialize.UMShareListener;
|
|
|
import com.umeng.socialize.bean.SHARE_MEDIA;
|
|
|
import com.umeng.socialize.media.UMImage;
|
|
|
+import com.umeng.socialize.media.UMWeb;
|
|
|
import com.umeng.socialize.shareboard.SnsPlatform;
|
|
|
import com.umeng.socialize.utils.ShareBoardlistener;
|
|
|
|
|
@@ -425,12 +427,10 @@ public class HtmlHorizontalScreenActivity extends BaseActivity<ActivityHtml1Bind
|
|
|
JSONObject content = null;
|
|
|
try {
|
|
|
content = jsonObject.getJSONObject("content");
|
|
|
-
|
|
|
String shareTitle = content.getString("title");
|
|
|
String shareDesc = content.getString("desc");
|
|
|
-
|
|
|
- if ("image".equals(content.getString("type"))) {
|
|
|
- String imageBase64 = content.getString("image");
|
|
|
+ if ("image".equals(content.optString("type"))) {
|
|
|
+ String imageBase64 = content.optString("image");
|
|
|
/*增加自定义按钮的分享面板*/
|
|
|
mShareAction = new ShareAction(HtmlHorizontalScreenActivity.this).setDisplayList(
|
|
|
SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE, SHARE_MEDIA.SINA)
|
|
@@ -448,9 +448,28 @@ public class HtmlHorizontalScreenActivity extends BaseActivity<ActivityHtml1Bind
|
|
|
}
|
|
|
});
|
|
|
mShareAction.open();
|
|
|
+ } else if ("video".equals(content.optString("type"))) {
|
|
|
+ String videoUrl = content.optString("video");
|
|
|
+ /*增加自定义按钮的分享面板*/
|
|
|
+ mShareAction = new ShareAction(this).setDisplayList(
|
|
|
+ SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE, SHARE_MEDIA.SINA)
|
|
|
+ .setShareboardclickCallback(new ShareBoardlistener() {
|
|
|
+ @Override
|
|
|
+ public void onclick(SnsPlatform snsPlatform, SHARE_MEDIA share_media) {
|
|
|
+ UMWeb video = new UMWeb(videoUrl);
|
|
|
+ video.setTitle(shareTitle);
|
|
|
+ video.setDescription(shareDesc.isEmpty() ? shareTitle : shareDesc);
|
|
|
+ new ShareAction(HtmlHorizontalScreenActivity.this).withMedia(video)
|
|
|
+ .setPlatform(share_media)
|
|
|
+ .setCallback(mShareListener)
|
|
|
+ .share();
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ mShareAction.open();
|
|
|
}
|
|
|
} catch (JSONException e) {
|
|
|
-
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|