cn.sharesdk.framework.PlatformActionListener Java Examples

The following examples show how to use cn.sharesdk.framework.PlatformActionListener. 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: WechatShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareMusic(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Wechat.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setMusicUrl(ResourcesManager.getInstace(MobSDK.getContext()).getMusicUrl());
	shareParams.setShareType(Platform.SHARE_MUSIC);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #2
Source File: PlurkShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform("Plurk");
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #3
Source File: RenrenShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareFeed(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Renren.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setComment(ResourcesManager.getInstace(MobSDK.getContext()).getComment());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitleUrl(ResourcesManager.getInstace(MobSDK.getContext()).getTitleUrl());
	shareParams.setExtInfo(ResourcesManager.EXT_INFO);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #4
Source File: EmailShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Email.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	shareParams.setShareType(Platform.SHARE_VIDEO);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #5
Source File: FacebookShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareWebPage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Facebook.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setShareType(Platform.SHARE_WEBPAGE);
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #6
Source File: VKontakteShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareMessage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(VKontakte.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setFriend(ResourcesManager.IS_FRIEND);
	shareParams.setLatitude(ResourcesManager.latitude);
	shareParams.setLongitude(ResourcesManager.longitude);
	shareParams.setGroupId(" ");
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #7
Source File: QQShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener) {
    Platform platform = ShareSDK.getPlatform(QQ.NAME);
    Platform.ShareParams shareParams = new Platform.ShareParams();
    shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
    shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
    shareParams.setShareType(Platform.SHARE_IMAGE);
    platform.setPlatformActionListener(mListener);
    platform.share(shareParams);
}
 
Example #8
Source File: EvernoteShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(PlatformActionListener mListener) {
	Platform platform = ShareSDK.getPlatform(Evernote.NAME);
	Platform.ShareParams shareParams = new Platform.ShareParams();
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setShareType(Platform.SHARE_VIDEO);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #9
Source File: TumblrShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Tumblr.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	platform.setPlatformActionListener(platformActionListener);
	platform.share(shareParams);
}
 
Example #10
Source File: FourSquareShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener) {
	Platform platform = ShareSDK.getPlatform(FourSquare.NAME);
	Platform.ShareParams shareParams = new Platform.ShareParams();
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setLatitude(ResourcesManager.latitude);
	shareParams.setLongitude(ResourcesManager.longitude);
	shareParams.setVenueName(ResourcesManager.VENUE_NAME);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #11
Source File: OnekeyShare.java    From Mobike with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	ShareSDK.initSDK(context.getApplicationContext());

	// 打开分享菜单的统计
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = R.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	com.sharesdk.onekeyshare.OnekeyShareTheme theme = com.sharesdk.onekeyshare.OnekeyShareTheme.fromValue(iTheme);
	com.sharesdk.onekeyshare.OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((com.sharesdk.onekeyshare.ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context.getApplicationContext());
}
 
Example #12
Source File: DingdingShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Dingding.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImageData(ResourcesManager.getInstace(MobSDK.getContext()).getImageBmp());
	shareParams.setShareType(Platform.SHARE_IMAGE);
	shareParams.setScence(0);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #13
Source File: OnekeyShare.java    From LQRWeChat with MIT License 5 votes vote down vote up
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	MobSDK.init(context.getApplicationContext());
	ShareSDK.initSDK(context);

	// 打开分享菜单的统计
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = ResHelper.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context.getApplicationContext());
}
 
Example #14
Source File: WechatMomentsShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(WechatMoments.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImageData(ResourcesManager.getInstace(MobSDK.getContext()).getImageBmp());
	shareParams.setShareType(Platform.SHARE_IMAGE);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #15
Source File: FacebookShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Facebook.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	shareParams.setShareType(Platform.SHARE_VIDEO);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #16
Source File: OnekeyShare.java    From BaoKanAndroid with MIT License 5 votes vote down vote up
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	ShareSDK.initSDK(context.getApplicationContext());

	// 打开分享菜单的统计
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = ResHelper.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context.getApplicationContext());
}
 
Example #17
Source File: WechatMomentsShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareWebpager(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(WechatMoments.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setImageData(ResourcesManager.getInstace(MobSDK.getContext()).getImageBmp());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setShareType(Platform.SHARE_WEBPAGE);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #18
Source File: WeiboShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(SinaWeibo.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	if(!DemoUtils.isValidClientSina("com.sina.weibo")){
		shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	}
	shareParams.setLongitude(ResourcesManager.longitude);
	shareParams.setLatitude(ResourcesManager.latitude);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #19
Source File: KaiXinShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(KaiXin.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #20
Source File: OnekeyShare.java    From GithubApp with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public void show(Context context) {
	HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
	shareParamsMap.putAll(params);

	ShareSDK.initSDK(context);

	// 打开分享菜单的统计
	ShareSDK.logDemoEvent(1, null);

	int iTheme = 0;
	try {
		iTheme = R.parseInt(String.valueOf(shareParamsMap.remove("theme")));
	} catch (Throwable t) {}
	OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
	OnekeyShareThemeImpl themeImpl = theme.getImpl();

	themeImpl.setShareParamsMap(shareParamsMap);
	themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
	themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
	themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
	themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
	themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
	themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
	if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
		themeImpl.disableSSO();
	}

	themeImpl.show(context);
}
 
Example #21
Source File: WechatShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Wechat.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImageData(ResourcesManager.getInstace(MobSDK.getContext()).getImageBmp());
	shareParams.setShareType(Platform.SHARE_IMAGE);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #22
Source File: DropboxShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareFile(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Dropbox.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #23
Source File: WechatMomentsShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(WechatMoments.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setShareType(Platform.SHARE_TEXT);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #24
Source File: DoubanShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Douban.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #25
Source File: SohuMicroBlogShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareImage(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform("SohuMicroBlog");
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #26
Source File: AlipayMomentsShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareWebPage(PlatformActionListener mListener) {
	Platform platform = ShareSDK.getPlatform(Alipay.NAME);
	Platform.ShareParams shareParams = new Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setImageData(ResourcesManager.getInstace(MobSDK.getContext()).getImageBmp());
	shareParams.setShareType(Platform.SHARE_WEBPAGE);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #27
Source File: OnekeyShare.java    From HHComicViewer with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public void show(Context context) {
    HashMap<String, Object> shareParamsMap = new HashMap<String, Object>();
    shareParamsMap.putAll(params);

    ShareSDK.initSDK(context.getApplicationContext());

    // 打开分享菜单的统计
    ShareSDK.logDemoEvent(1, null);

    int iTheme = 0;
    try {
        iTheme = R.parseInt(String.valueOf(shareParamsMap.remove("theme")));
    } catch (Throwable t) {
        t.printStackTrace();
    }
    OnekeyShareTheme theme = OnekeyShareTheme.fromValue(iTheme);
    OnekeyShareThemeImpl themeImpl = theme.getImpl();

    themeImpl.setShareParamsMap(shareParamsMap);
    themeImpl.setDialogMode(shareParamsMap.containsKey("dialogMode") ? ((Boolean) shareParamsMap.remove("dialogMode")) : false);
    themeImpl.setSilent(shareParamsMap.containsKey("silent") ? ((Boolean) shareParamsMap.remove("silent")) : false);
    themeImpl.setCustomerLogos((ArrayList<CustomerLogo>) shareParamsMap.remove("customers"));
    themeImpl.setHiddenPlatforms((HashMap<String, String>) shareParamsMap.remove("hiddenPlatforms"));
    themeImpl.setPlatformActionListener((PlatformActionListener) shareParamsMap.remove("callback"));
    themeImpl.setShareContentCustomizeCallback((ShareContentCustomizeCallback) shareParamsMap.remove("customizeCallback"));
    if (shareParamsMap.containsKey("disableSSO") ? ((Boolean) shareParamsMap.remove("disableSSO")) : false) {
        themeImpl.disableSSO();
    }

    themeImpl.show(context.getApplicationContext());
}
 
Example #28
Source File: QQZoneShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareText(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(QZone.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setTitleUrl(ResourcesManager.getInstace(MobSDK.getContext()).getTitleUrl());
	shareParams.setShareType(Platform.SHARE_TEXT);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #29
Source File: TwitterShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareVideo(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(Twitter.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setFilePath(ResourcesManager.getInstace(MobSDK.getContext()).getFilePath());
	shareParams.setShareType(Platform.SHARE_VIDEO);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}
 
Example #30
Source File: WechatMomentsShare.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public void shareMusic(PlatformActionListener mListener){
	Platform platform = ShareSDK.getPlatform(WechatMoments.NAME);
	Platform.ShareParams shareParams = new  Platform.ShareParams();
	shareParams.setText(ResourcesManager.getInstace(MobSDK.getContext()).getText());
	shareParams.setTitle(ResourcesManager.getInstace(MobSDK.getContext()).getTitle());
	shareParams.setImagePath(ResourcesManager.getInstace(MobSDK.getContext()).getImagePath());
	shareParams.setImageUrl(ResourcesManager.getInstace(MobSDK.getContext()).getImageUrl());
	shareParams.setUrl(ResourcesManager.getInstace(MobSDK.getContext()).getUrl());
	shareParams.setMusicUrl(ResourcesManager.getInstace(MobSDK.getContext()).getMusicUrl());
	shareParams.setShareType(Platform.SHARE_MUSIC);
	platform.setPlatformActionListener(mListener);
	platform.share(shareParams);
}