Java Code Examples for cn.sharesdk.framework.Platform#SHARE_MUSIC

The following examples show how to use cn.sharesdk.framework.Platform#SHARE_MUSIC . 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: PlatformUITypeManager.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public static int getPlatformIcon(int share_type) {
	switch (share_type) {
		case Platform.SHARE_VIDEO: {
			return R.mipmap.base_video;
		}
		case Platform.SHARE_TEXT: {
			return R.mipmap.share_text;
		}
		case Platform.SHARE_IMAGE: {
			return R.mipmap.share_multimages;
		}
		case Platform.SHARE_APPS: {
			return R.mipmap.share_app;
		}
		case Platform.SHARE_FILE: {
			return R.mipmap.base_file;
		}
		case Platform.SHARE_EMOJI: {
			return R.mipmap.share_icon;
		}
		case Platform.SHARE_WXMINIPROGRAM: {
			return R.mipmap.share_mini_program;
		}
		case Platform.SHARE_MUSIC: {
			return R.mipmap.share_url_music;
		}
		case Platform.SHARE_LINKCARD: {
			return R.mipmap.share_url_music;
		}
		default: {
			return R.mipmap.share_webpage;
		}
	}
}
 
Example 2
Source File: PlatformUITypeManager.java    From ShareSDK-for-Android with MIT License 5 votes vote down vote up
public static int getPlatformName(int share_type) {
	switch (share_type) {
		case Platform.SHARE_VIDEO: {
			return R.string.platform_share_video;
		}
		case Platform.SHARE_TEXT: {
			return R.string.platform_share_text;
		}
		case Platform.SHARE_IMAGE: {
			return R.string.platform_share_image;
		}
		case Platform.SHARE_APPS: {
			return R.string.platform_share_app;
		}
		case Platform.SHARE_FILE: {
			return R.string.platform_share_file;
		}
		case Platform.SHARE_EMOJI: {
			return R.string.platform_share_emoji;
		}
		case Platform.SHARE_WXMINIPROGRAM: {
			return R.string.platform_share_mini_app;
		}
		case Platform.SHARE_WEBPAGE: {
			return R.string.platform_share_webpage;
		}
		case Platform.SHARE_MUSIC: {
			return R.string.platform_share_music;
		}
		case Platform.SHARE_LINKCARD: {
			return R.string.platform_share_linkcard;
		}
		case Platform.QQ_MINI_PROGRAM: {
			return R.string.platform_share_qqmini;
		}
		default: {
			return R.string.platform_share_webpage;
		}
	}
}
 
Example 3
Source File: ShareTypeManager.java    From ShareSDK-for-Android with MIT License 4 votes vote down vote up
public void shareShow(int platform, Activity activity) {
    switch (platform) {
        case Platform.SHARE_TEXT: {
            shareText();
        } break;
        case Platform.SHARE_VIDEO: {
            shareVideo(activity);
        } break;
        case Platform.SHARE_IMAGE: {
            shareImage(activity);
        } break;
        case Platform.SHARE_APPS: {
            shareApp();
        } break;
        case Platform.SHARE_FILE: {
            shareFiles(activity);
        } break;
        case Platform.SHARE_EMOJI: {
            shareEmoji();
        } break;
        case Platform.SHARE_WXMINIPROGRAM: {
            shareMiniProgram();
        } break;
        case Platform.SHARE_WEBPAGE: {
            shareWebPage(activity);
        } break;
        case Platform.SHARE_MUSIC: {
            shareMusic();
        } break;

        case Platform.SHARE_LINKCARD: {
            shareLinkCard();
        } break;

        case Platform.QQ_MINI_PROGRAM: {
            shareQQMiniProgram(activity);
        } break;


    }
}
 
Example 4
Source File: PlatformShareConstant.java    From ShareSDK-for-Android with MIT License 4 votes vote down vote up
private PlatformShareConstant(){
	douyin = new Integer[]{Platform.SHARE_VIDEO, Platform.SHARE_IMAGE};
	sinaWeibo = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_VIDEO, Platform.SHARE_LINKCARD};
	tencentWeibo = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT};
	qzone = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT,Platform.SHARE_WEBPAGE, Platform.SHARE_VIDEO};
	wechat = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_FILE, Platform.SHARE_WEBPAGE, Platform.SHARE_MUSIC, 
			Platform.SHARE_VIDEO, Platform.SHARE_EMOJI, Platform.SHARE_WXMINIPROGRAM};
	wechatMoments = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_WEBPAGE, Platform.SHARE_MUSIC, Platform.SHARE_VIDEO};
	wechatFavorite = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_FILE, Platform.SHARE_WEBPAGE, 
			Platform.SHARE_MUSIC, Platform.SHARE_VIDEO};
	qq = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_WEBPAGE, Platform.SHARE_MUSIC};
	facebook = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_WEBPAGE, Platform.SHARE_VIDEO};
	twitter = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_VIDEO};
	renren = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT};
	kaiXin = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT};
	email = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_VIDEO};
	shortMessage = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_VIDEO};
	douban = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT};
	youDao = new Integer[]{Platform.SHARE_TEXT, Platform.SHARE_IMAGE};
	evernote = new Integer[]{Platform.SHARE_IMAGE,Platform.SHARE_TEXT, Platform.SHARE_VIDEO};
	linkedIn = new Integer[]{Platform.SHARE_TEXT, Platform.SHARE_WEBPAGE};
	fourSquare = new Integer[]{Platform.SHARE_IMAGE};
	pinterest = new Integer[]{Platform.SHARE_IMAGE};
	flickr = new Integer[]{Platform.SHARE_IMAGE};
	tumblr = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT};
	dropbox = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_FILE, Platform.SHARE_VIDEO};
	vkontakte = new Integer[]{Platform.SHARE_IMAGE};
	instagram = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_VIDEO, Platform.SHARE_TEXT};
	yixin = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_MUSIC,Platform.SHARE_VIDEO,Platform.SHARE_WEBPAGE};
	yixinMoments = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_MUSIC,Platform.SHARE_VIDEO,Platform.SHARE_WEBPAGE};
	mingdao = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT};
	line = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT	};
	kakaoTalk = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT};
	kakaoStory = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_VIDEO};
	whatsApp = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_VIDEO};
	bluetooth = new Integer[]{Platform.SHARE_FILE};
	pocket = new Integer[]{Platform.SHARE_WEBPAGE};
	instapaper = new Integer[]{Platform.SHARE_TEXT, Platform.SHARE_WEBPAGE	};
	facebookMessenger = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_WEBPAGE};
	alipay = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_WEBPAGE};
	alipayMoments = new Integer[]{Platform.SHARE_WEBPAGE};
	dingding = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_TEXT, Platform.SHARE_WEBPAGE};
	youtube = new Integer[]{Platform.SHARE_VIDEO};
	meipai = new Integer[]{Platform.SHARE_IMAGE, Platform.SHARE_VIDEO};
	telegram = new Integer[]{Platform.SHARE_TEXT, Platform.SHARE_IMAGE};
	reddit = new Integer[]{Platform.SHARE_TEXT, Platform.SHARE_WEBPAGE};
	wework = new Integer[]{Platform.SHARE_TEXT, Platform.SHARE_IMAGE, Platform.SHARE_FILE,
							Platform.SHARE_VIDEO, Platform.SHARE_WEBPAGE};
}
 
Example 5
Source File: MainActivity.java    From -Android_ShareSDK_Example_Wechat with MIT License 4 votes vote down vote up
/**微信朋友圈分享参数
 * 
 * WechatMoment share params
 * */
private ShareParams getWechatMomentsShareParams(View v) {
	WechatMoments.ShareParams sp = new WechatMoments.ShareParams();
	//任何分享类型都需要title和text, the two params of title and text are required in every share type
	sp.title = "ShareSDK wechatmoment title";
	sp.text = "ShareSDK wechatmoment text";
	sp.shareType = Platform.SHARE_TEXT;
	switch (v.getId()) {
		case R.id.btnUpload: {//分享sdcard中的图片, share the sdcard's picture
			sp.shareType = Platform.SHARE_IMAGE;
			sp.imagePath = MainActivity.TEST_IMAGE;
		}
		break;
		case R.id.btnUploadBm: {//分享drawable中的图片,share the picture on the drawable
			sp.shareType = Platform.SHARE_IMAGE;
			sp.imageData = BitmapFactory.decodeResource(v.getResources(), R.drawable.ic_launcher);
		}
		break;
		case R.id.btnUploadUrl: {//分享网络图片,share the picture from the web
			sp.shareType = Platform.SHARE_IMAGE;
			sp.imageUrl = "http://img.appgo.cn/imgs/sharesdk/content/2013/07/16/1373959974649.png";
		}
		break;
		case R.id.btnMusic: {//分享网络音乐, share music
			sp.shareType = Platform.SHARE_MUSIC;
			sp.musicUrl = "http://staff2.ustc.edu.cn/~wdw/softdown/index.asp/0042515_05.ANDY.mp3";
			sp.url = "http://sharesdk.cn";
			sp.imagePath = MainActivity.TEST_IMAGE;
		}
		break;
		case R.id.btnVideo: {//分享网络视频,share video
			sp.shareType = Platform.SHARE_VIDEO;
			sp.url = "http://t.cn/zT7cZAo";
			sp.imagePath = MainActivity.TEST_IMAGE;
		}
		break;
		case R.id.btnWebpage: {//图文分享,网页形式,sdcard中的图片,share webpage with a picture from the sdcard
			sp.shareType = Platform.SHARE_WEBPAGE;
			sp.url = "http://t.cn/zT7cZAo";
			sp.imagePath = MainActivity.TEST_IMAGE;
		}
		break;
		case R.id.btnWebpageBm: {//图文分享,网页形式,drawable中的图片,share webpage with a picture from the drawable
			sp.shareType = Platform.SHARE_WEBPAGE;
			sp.url = "http://t.cn/zT7cZAo";
			sp.imageData = BitmapFactory.decodeResource(v.getResources(), R.drawable.ic_launcher);
		}
		break;
		case R.id.btnWebpageUrl: {//图文分享,网页形式,网页图片,share webpage with a picture from web
			sp.shareType = Platform.SHARE_WEBPAGE;
			sp.url = "http://t.cn/zT7cZAo";
			sp.imageUrl = "http://img.appgo.cn/imgs/sharesdk/content/2013/07/16/1373959974649.png";
		}
		break;
	}
	return sp;
}