cn.sharesdk.framework.Platform.ShareParams Java Examples
The following examples show how to use
cn.sharesdk.framework.Platform.ShareParams.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PlatformPage.java From BaoKanAndroid with MIT License | 6 votes |
public final void showEditPage(final Platform platform) { beforeFinish = new Runnable() { public void run() { boolean isSilent = isSilent(); boolean isCustomPlatform = platform instanceof CustomPlatform; boolean isUseClientToShare = isUseClientToShare(platform); if (isSilent || isCustomPlatform || isUseClientToShare) { shareSilently(platform); } else { ShareParams sp = formateShareData(platform); if (sp != null) { // 编辑分享内容的统计 ShareSDK.logDemoEvent(3, null); if (getCustomizeCallback() != null) { getCustomizeCallback().onShare(platform, sp); } impl.showEditPage(activity, platform, sp); } } } }; finish(); }
Example #2
Source File: PlatformPage.java From POCenter with MIT License | 6 votes |
public final void showEditPage(final Platform platform) { beforeFinish = new Runnable() { public void run() { boolean isSilent = isSilent(); boolean isCustomPlatform = platform instanceof CustomPlatform; boolean isUseClientToShare = isUseClientToShare(platform); if (isSilent || isCustomPlatform || isUseClientToShare) { shareSilently(platform); } else { ShareParams sp = formateShareData(platform); if (sp != null) { // 编辑分享内容的统计 ShareSDK.logDemoEvent(3, null); if (getCustomizeCallback() != null) { getCustomizeCallback().onShare(platform, sp); } impl.showEditPage(activity, platform, sp); } } } }; finish(); }
Example #3
Source File: OnekeyShareThemeImpl.java From MyHearts with Apache License 2.0 | 6 votes |
final void shareSilently(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { toast("ssdk_oks_sharing"); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } if (disableSSO) { platform.SSOSetting(disableSSO); } platform.setPlatformActionListener(callback); platform.share(sp); } } }
Example #4
Source File: PlatformPage.java From HHComicViewer with Apache License 2.0 | 6 votes |
public final void showEditPage(final Platform platform) { beforeFinish = new Runnable() { public void run() { boolean isSilent = isSilent(); boolean isCustomPlatform = platform instanceof CustomPlatform; boolean isUseClientToShare = isUseClientToShare(platform); if (isSilent || isCustomPlatform || isUseClientToShare) { shareSilently(platform); } else { ShareParams sp = formateShareData(platform); if (sp != null) { // 编辑分享内容的统计 ShareSDK.logDemoEvent(3, null); if (getCustomizeCallback() != null) { getCustomizeCallback().onShare(platform, sp); } impl.showEditPage(activity, platform, sp); } } } }; finish(); }
Example #5
Source File: OnekeyShareThemeImpl.java From YiZhi with Apache License 2.0 | 6 votes |
final ShareParams shareDataToShareParams(Platform plat) { if (plat == null || shareParamsMap == null) { toast("ssdk_oks_share_failed"); return null; } try { String imagePath = ResHelper.forceCast(shareParamsMap.get("imagePath")); Bitmap viewToShare = ResHelper.forceCast(shareParamsMap.get("viewToShare")); if (TextUtils.isEmpty(imagePath) && viewToShare != null && !viewToShare.isRecycled()) { String path = ResHelper.getCachePath(MobSDK.getContext(), "screenshot"); File ss = new File(path, String.valueOf(System.currentTimeMillis()) + ".jpg"); FileOutputStream fos = new FileOutputStream(ss); viewToShare.compress(CompressFormat.JPEG, 100, fos); fos.flush(); fos.close(); shareParamsMap.put("imagePath", ss.getAbsolutePath()); } } catch (Throwable t) { t.printStackTrace(); toast("ssdk_oks_share_failed"); return null; } return new ShareParams(shareParamsMap); }
Example #6
Source File: OnekeyShareThemeImpl.java From MyHearts with Apache License 2.0 | 6 votes |
final ShareParams shareDataToShareParams(Platform plat) { if (plat == null || shareParamsMap == null) { toast("ssdk_oks_share_failed"); return null; } try { String imagePath = R.forceCast(shareParamsMap.get("imagePath")); Bitmap viewToShare = R.forceCast(shareParamsMap.get("viewToShare")); if (TextUtils.isEmpty(imagePath) && viewToShare != null && !viewToShare.isRecycled()) { String path = R.getCachePath(plat.getContext(), "screenshot"); File ss = new File(path, String.valueOf(System.currentTimeMillis()) + ".jpg"); FileOutputStream fos = new FileOutputStream(ss); viewToShare.compress(CompressFormat.JPEG, 100, fos); fos.flush(); fos.close(); shareParamsMap.put("imagePath", ss.getAbsolutePath()); } } catch (Throwable t) { t.printStackTrace(); toast("ssdk_oks_share_failed"); return null; } return new ShareParams(shareParamsMap); }
Example #7
Source File: OnekeyShareThemeImpl.java From YiZhi with Apache License 2.0 | 6 votes |
final void shareSilently(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { toast("ssdk_oks_sharing"); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } if (disableSSO) { platform.SSOSetting(disableSSO); } platform.setPlatformActionListener(callback); platform.share(sp); } } }
Example #8
Source File: PlatformPage.java From YiZhi with Apache License 2.0 | 6 votes |
public final void showEditPage(final Platform platform) { beforeFinish = new Runnable() { public void run() { boolean isSilent = isSilent(); boolean isCustomPlatform = platform instanceof CustomPlatform; boolean isUseClientToShare = isUseClientToShare(platform); if (isSilent || isCustomPlatform || isUseClientToShare) { shareSilently(platform); } else { ShareParams sp = formateShareData(platform); if (sp != null) { // 编辑分享内容的统计 ShareSDK.logDemoEvent(3, null); if (getCustomizeCallback() != null) { getCustomizeCallback().onShare(platform, sp); } impl.showEditPage(activity, platform, sp); } } } }; finish(); }
Example #9
Source File: PlatformPage.java From fingerpoetry-android with Apache License 2.0 | 6 votes |
public final void showEditPage(final Platform platform) { beforeFinish = new Runnable() { public void run() { boolean isSilent = isSilent(); boolean isCustomPlatform = platform instanceof CustomPlatform; boolean isUseClientToShare = isUseClientToShare(platform); if (isSilent || isCustomPlatform || isUseClientToShare) { shareSilently(platform); } else { ShareParams sp = formateShareData(platform); if (sp != null) { // 编辑分享内容的统计 ShareSDK.logDemoEvent(3, null); if (getCustomizeCallback() != null) { getCustomizeCallback().onShare(platform, sp); } impl.showEditPage(activity, platform, sp); } } } }; finish(); }
Example #10
Source File: OnekeyShareThemeImpl.java From enjoyshop with Apache License 2.0 | 6 votes |
final ShareParams shareDataToShareParams(Platform plat) { if (plat == null || shareParamsMap == null) { toast("ssdk_oks_share_failed"); return null; } try { String imagePath = ResHelper.forceCast(shareParamsMap.get("imagePath")); Bitmap viewToShare = ResHelper.forceCast(shareParamsMap.get("viewToShare")); if (TextUtils.isEmpty(imagePath) && viewToShare != null && !viewToShare.isRecycled()) { String path = ResHelper.getCachePath(MobSDK.getContext(), "screenshot"); File ss = new File(path, String.valueOf(System.currentTimeMillis()) + ".jpg"); FileOutputStream fos = new FileOutputStream(ss); viewToShare.compress(CompressFormat.JPEG, 100, fos); fos.flush(); fos.close(); shareParamsMap.put("imagePath", ss.getAbsolutePath()); } } catch (Throwable t) { t.printStackTrace(); toast("ssdk_oks_share_failed"); return null; } return new ShareParams(shareParamsMap); }
Example #11
Source File: PlatformPage.java From LiuAGeAndroid with MIT License | 6 votes |
public final void showEditPage(final Platform platform) { beforeFinish = new Runnable() { public void run() { boolean isSilent = isSilent(); boolean isCustomPlatform = platform instanceof CustomPlatform; boolean isUseClientToShare = isUseClientToShare(platform); if (isSilent || isCustomPlatform || isUseClientToShare) { shareSilently(platform); } else { ShareParams sp = formateShareData(platform); if (sp != null) { // 编辑分享内容的统计 ShareSDK.logDemoEvent(3, null); if (getCustomizeCallback() != null) { getCustomizeCallback().onShare(platform, sp); } impl.showEditPage(activity, platform, sp); } } } }; finish(); }
Example #12
Source File: OnekeyShareThemeImpl.java From LiuAGeAndroid with MIT License | 6 votes |
final void shareSilently(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { toast("ssdk_oks_sharing"); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } if (disableSSO) { platform.SSOSetting(disableSSO); } platform.setPlatformActionListener(callback); platform.share(sp); } } }
Example #13
Source File: OnekeyShareThemeImpl.java From LiuAGeAndroid with MIT License | 6 votes |
final ShareParams shareDataToShareParams(Platform plat) { if (plat == null || shareParamsMap == null) { toast("ssdk_oks_share_failed"); return null; } try { String imagePath = ResHelper.forceCast(shareParamsMap.get("imagePath")); Bitmap viewToShare = ResHelper.forceCast(shareParamsMap.get("viewToShare")); if (TextUtils.isEmpty(imagePath) && viewToShare != null && !viewToShare.isRecycled()) { String path = ResHelper.getCachePath(plat.getContext(), "screenshot"); File ss = new File(path, String.valueOf(System.currentTimeMillis()) + ".jpg"); FileOutputStream fos = new FileOutputStream(ss); viewToShare.compress(CompressFormat.JPEG, 100, fos); fos.flush(); fos.close(); shareParamsMap.put("imagePath", ss.getAbsolutePath()); } } catch (Throwable t) { t.printStackTrace(); toast("ssdk_oks_share_failed"); return null; } return new ShareParams(shareParamsMap); }
Example #14
Source File: PlatformPage.java From GithubApp with Apache License 2.0 | 6 votes |
public final void showEditPage(final Platform platform) { beforeFinish = new Runnable() { public void run() { boolean isSilent = isSilent(); boolean isCustomPlatform = platform instanceof CustomPlatform; boolean isUseClientToShare = isUseClientToShare(platform); if (isSilent || isCustomPlatform || isUseClientToShare) { shareSilently(platform); } else { ShareParams sp = formateShareData(platform); if (sp != null) { // 编辑分享内容的统计 ShareSDK.logDemoEvent(3, null); if (getCustomizeCallback() != null) { getCustomizeCallback().onShare(platform, sp); } impl.showEditPage(activity, platform, sp); } } } }; finish(); }
Example #15
Source File: OnekeyShareThemeImpl.java From GithubApp with Apache License 2.0 | 6 votes |
final void shareSilently(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { toast("ssdk_oks_sharing"); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } if (disableSSO) { platform.SSOSetting(disableSSO); } platform.setPlatformActionListener(callback); platform.share(sp); } } }
Example #16
Source File: OnekeyShareThemeImpl.java From BaoKanAndroid with MIT License | 6 votes |
final void shareSilently(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { toast("ssdk_oks_sharing"); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } if (disableSSO) { platform.SSOSetting(disableSSO); } platform.setPlatformActionListener(callback); platform.share(sp); } } }
Example #17
Source File: ShareContentCustomizeDemo.java From ShareSDKShareDifMsgDemo-Android with MIT License | 6 votes |
public void onShare(Platform platform, ShareParams paramsToShare) { String text = platform.getContext().getString(R.string.share_title); if ("WechatMoments".equals(platform.getName())) { // 改写twitter分享内容中的text字段,否则会超长, // 因为twitter会将图片地址当作文本的一部分去计算长度 text += platform.getContext().getString(R.string.share_to_wechatmoment); paramsToShare.setText(text); }else if("SinaWeibo".equals(platform.getName())){ text += platform.getContext().getString(R.string.share_to_sina); paramsToShare.setText(text); }else if("TencentWeibo".equals(platform.getName())){ text += platform.getContext().getString(R.string.share_to_tencent); paramsToShare.setText(text); }else if("ShortMessage".equals(platform.getName())){ text += platform.getContext().getString(R.string.share_to_sms); paramsToShare.setText(text); } }
Example #18
Source File: OnekeyShareThemeImpl.java From LQRWeChat with MIT License | 6 votes |
final ShareParams shareDataToShareParams(Platform plat) { if (plat == null || shareParamsMap == null) { toast("ssdk_oks_share_failed"); return null; } try { String imagePath = ResHelper.forceCast(shareParamsMap.get("imagePath")); Bitmap viewToShare = ResHelper.forceCast(shareParamsMap.get("viewToShare")); if (TextUtils.isEmpty(imagePath) && viewToShare != null && !viewToShare.isRecycled()) { String path = ResHelper.getCachePath(plat.getContext(), "screenshot"); File ss = new File(path, String.valueOf(System.currentTimeMillis()) + ".jpg"); FileOutputStream fos = new FileOutputStream(ss); viewToShare.compress(CompressFormat.JPEG, 100, fos); fos.flush(); fos.close(); shareParamsMap.put("imagePath", ss.getAbsolutePath()); } } catch (Throwable t) { t.printStackTrace(); toast("ssdk_oks_share_failed"); return null; } return new ShareParams(shareParamsMap); }
Example #19
Source File: OnekeyShareThemeImpl.java From HHComicViewer with Apache License 2.0 | 6 votes |
final void shareSilently(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { toast("ssdk_oks_sharing"); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } if (disableSSO) { platform.SSOSetting(disableSSO); } platform.setPlatformActionListener(callback); platform.share(sp); } } }
Example #20
Source File: OnekeyShareThemeImpl.java From fingerpoetry-android with Apache License 2.0 | 6 votes |
final void shareSilently(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { toast("ssdk_oks_sharing"); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } if (disableSSO) { platform.SSOSetting(disableSSO); } platform.setPlatformActionListener(callback); platform.share(sp); } } }
Example #21
Source File: OnekeyShareThemeImpl.java From BaoKanAndroid with MIT License | 6 votes |
final ShareParams shareDataToShareParams(Platform plat) { if (plat == null || shareParamsMap == null) { toast("ssdk_oks_share_failed"); return null; } try { String imagePath = ResHelper.forceCast(shareParamsMap.get("imagePath")); Bitmap viewToShare = ResHelper.forceCast(shareParamsMap.get("viewToShare")); if (TextUtils.isEmpty(imagePath) && viewToShare != null && !viewToShare.isRecycled()) { String path = ResHelper.getCachePath(plat.getContext(), "screenshot"); File ss = new File(path, String.valueOf(System.currentTimeMillis()) + ".jpg"); FileOutputStream fos = new FileOutputStream(ss); viewToShare.compress(CompressFormat.JPEG, 100, fos); fos.flush(); fos.close(); shareParamsMap.put("imagePath", ss.getAbsolutePath()); } } catch (Throwable t) { t.printStackTrace(); toast("ssdk_oks_share_failed"); return null; } return new ShareParams(shareParamsMap); }
Example #22
Source File: OnekeyShareThemeImpl.java From HHComicViewer with Apache License 2.0 | 6 votes |
final ShareParams shareDataToShareParams(Platform plat) { if (plat == null || shareParamsMap == null) { toast("ssdk_oks_share_failed"); return null; } try { String imagePath = R.forceCast(shareParamsMap.get("imagePath")); Bitmap viewToShare = R.forceCast(shareParamsMap.get("viewToShare")); if (TextUtils.isEmpty(imagePath) && viewToShare != null && !viewToShare.isRecycled()) { String path = R.getCachePath(plat.getContext(), "screenshot"); File ss = new File(path, String.valueOf(System.currentTimeMillis()) + ".jpg"); FileOutputStream fos = new FileOutputStream(ss); viewToShare.compress(CompressFormat.JPEG, 100, fos); fos.flush(); fos.close(); shareParamsMap.put("imagePath", ss.getAbsolutePath()); } } catch (Throwable t) { t.printStackTrace(); toast("ssdk_oks_share_failed"); return null; } return new ShareParams(shareParamsMap); }
Example #23
Source File: OnekeyShareThemeImpl.java From Mobike with Apache License 2.0 | 6 votes |
final void shareSilently(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { toast("ssdk_oks_sharing"); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } if (disableSSO) { platform.SSOSetting(disableSSO); } platform.setPlatformActionListener(callback); platform.share(sp); } } }
Example #24
Source File: SharePopupWindow.java From BigApp_Discuz_Android with Apache License 2.0 | 6 votes |
/** * 初始化分享参数 * * @param shareModel */ public static SharePopupWindow init(Context context, ArrayList<ShareItem> shareItems, ShareModel shareModel) { SharePopupWindow sharePopupWindow = new SharePopupWindow(context); sharePopupWindow.context = context; sharePopupWindow.shareItems = shareItems; if (shareModel != null) { ShareParams sp = new ShareParams(); sp.setShareType(Platform.SHARE_TEXT); sp.setShareType(Platform.SHARE_WEBPAGE); sp.setTitle(shareModel.getTitle()); sp.setText(shareModel.getText()); sp.setUrl(shareModel.getUrl()); sp.setImageUrl(shareModel.getImageUrl()); sharePopupWindow.shareParams = sp; } sharePopupWindow.make(); return sharePopupWindow; }
Example #25
Source File: OnekeyShareThemeImpl.java From Social with Apache License 2.0 | 6 votes |
final void shareSilently(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { toast("ssdk_oks_sharing"); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } if (disableSSO) { platform.SSOSetting(disableSSO); } platform.setPlatformActionListener(callback); platform.share(sp); } } }
Example #26
Source File: PlatformPage.java From MyHearts with Apache License 2.0 | 6 votes |
public final void showEditPage(final Platform platform) { beforeFinish = new Runnable() { public void run() { boolean isSilent = isSilent(); boolean isCustomPlatform = platform instanceof CustomPlatform; boolean isUseClientToShare = isUseClientToShare(platform); if (isSilent || isCustomPlatform || isUseClientToShare) { shareSilently(platform); } else { ShareParams sp = formateShareData(platform); if (sp != null) { // 编辑分享内容的统计 ShareSDK.logDemoEvent(3, null); if (getCustomizeCallback() != null) { getCustomizeCallback().onShare(platform, sp); } impl.showEditPage(activity, platform, sp); } } } }; finish(); }
Example #27
Source File: OnekeyShareThemeImpl.java From YiZhi with Apache License 2.0 | 5 votes |
private void prepareForEditPage(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { // 编辑分享内容的统计 ShareSDK.logDemoEvent(3, null); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } showEditPage(context, platform, sp); } } }
Example #28
Source File: OnekeyShareThemeImpl.java From Social with Apache License 2.0 | 5 votes |
private void prepareForEditPage(Platform platform) { if (formateShareData(platform)) { ShareParams sp = shareDataToShareParams(platform); if (sp != null) { // 编辑分享内容的统计 ShareSDK.logDemoEvent(3, null); if (customizeCallback != null) { customizeCallback.onShare(platform, sp); } showEditPage(context, platform, sp); } } }
Example #29
Source File: ReflectableShareContentCustomizeCallback.java From BigApp_Discuz_Android with Apache License 2.0 | 5 votes |
@Override public void onShare(Platform platform, ShareParams paramsToShare) { if (onShareCallback != null) { Message msg = new Message(); msg.what = onShareWhat; msg.obj = new Object[] {platform, paramsToShare}; UIHandler.sendMessage(msg, onShareCallback); } }
Example #30
Source File: ShareCore.java From Huochexing12306 with Apache License 2.0 | 5 votes |
/** * 向指定平台分享内容 * <p> * <b>注意:</b><br> * 参数data的键值需要严格按照{@link ShareParams}不同子类具体字段来命名, *否则无法反射此字段,也无法设置其值。 */ public boolean share(Platform plat, HashMap<String, Object> data) { if (plat == null || data == null) { return false; } try { String imagePath = (String) data.get("imagePath"); Bitmap viewToShare = (Bitmap) data.get("viewToShare"); if (TextUtils.isEmpty(imagePath) && viewToShare != null && !viewToShare.isRecycled()) { String path = R.getCachePath(plat.getContext(), "screenshot"); File ss = new File(path, String.valueOf(System.currentTimeMillis()) + ".jpg"); FileOutputStream fos = new FileOutputStream(ss); viewToShare.compress(CompressFormat.JPEG, 100, fos); fos.flush(); fos.close(); data.put("imagePath", ss.getAbsolutePath()); } } catch (Throwable t) { t.printStackTrace(); return false; } ShareParams sp = new ShareParams(data); if (customizeCallback != null) { customizeCallback.onShare(plat, sp); } String[] flags = new String[] { "OnekeyShare", plat.getContext().getPackageName(), String.valueOf(ShareSDK.getSDKVersionCode()) }; sp.setCustomFlag(flags); plat.share(sp); return true; }