當前位置: 首頁>>代碼示例>>Java>>正文


Java Platform.share方法代碼示例

本文整理匯總了Java中cn.sharesdk.framework.Platform.share方法的典型用法代碼示例。如果您正苦於以下問題:Java Platform.share方法的具體用法?Java Platform.share怎麽用?Java Platform.share使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cn.sharesdk.framework.Platform的用法示例。


在下文中一共展示了Platform.share方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: shareSilently

import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
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);
		}
	}
}
 
開發者ID:gaolhjy,項目名稱:cniao5,代碼行數:17,代碼來源:OnekeyShareThemeImpl.java

示例2: share

import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
public static void share(String title, String titleurl
			, String text, String imagedir, String imageUrl, String url, String platformName, PlatformActionListener listener) {
//		QQ.NAME;
//		Wechat.NAME
//		SinaWeibo.NAMENAME;
		Platform p = ShareSDK.getPlatform(platformName);
		if (p != null) {
			p.setPlatformActionListener(listener);
		}
		Platform.ShareParams sp = new Platform.ShareParams();
		if (TextUtils.isEmpty(imagedir)) {
			sp.setImageUrl(imageUrl);
		} else {
			sp.setImagePath(imagedir);
		}
		sp.setTitle(title);
		sp.setTitleUrl(titleurl);
		sp.setText(text);
		sp.setUrl(url);
		p.share(sp);
	}
 
開發者ID:MobClub,項目名稱:BBSSDK-for-Android,代碼行數:22,代碼來源:ShareUtils.java

示例3: a

import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
public static void a(Context context, b bVar) {
    ShareParams shareParams = new ShareParams();
    shareParams.setShareType(4);
    Bitmap bitmap = null;
    if (!TextUtils.isEmpty(bVar.c())) {
        bitmap = BitmapFactory.decodeFile(bVar.c());
    }
    if (bitmap != null) {
        bitmap = Bitmap.createScaledBitmap(bitmap, 150, 150, true);
    } else {
        bitmap = Bitmap.createScaledBitmap(Bitmap.createBitmap(150, 150, Config.ARGB_8888),
                150, 150, true);
    }
    shareParams.setImageData(bitmap);
    shareParams.setTitle(bVar.a());
    shareParams.setText(bVar.b());
    shareParams.setUrl(bVar.e());
    Platform platform = ShareSDK.getPlatform(Wechat.NAME);
    if (platform.isClientValid()) {
        platform.share(shareParams);
        return;
    }
    Toast.makeText(context, o.a("未安裝微信或者微信版本過低。", "There is no WeChat or the version is too " +
            "low."), 0).show();
    c.d(o.a("未安裝微信或者微信版本過低。", "There is no WeChat or the version is too low."));
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:27,代碼來源:a.java

示例4: b

import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
public static void b(Context context, b bVar) {
    ShareParams shareParams = new ShareParams();
    shareParams.setShareType(4);
    Bitmap bitmap = null;
    if (!TextUtils.isEmpty(bVar.c())) {
        bitmap = BitmapFactory.decodeFile(bVar.c());
    }
    if (bitmap != null) {
        bitmap = Bitmap.createScaledBitmap(bitmap, 150, 150, true);
    } else {
        bitmap = Bitmap.createScaledBitmap(Bitmap.createBitmap(150, 150, Config.ARGB_8888),
                150, 150, true);
    }
    shareParams.setImageData(bitmap);
    shareParams.setTitle(bVar.a());
    shareParams.setText(bVar.b());
    shareParams.setUrl(bVar.e());
    Platform platform = ShareSDK.getPlatform(WechatMoments.NAME);
    if (platform.isClientValid()) {
        platform.share(shareParams);
        return;
    }
    Toast.makeText(context, o.a("未安裝微信或者微信版本過低。", "There is no WeChat or the version is too " +
            "low."), 0).show();
    c.d(o.a("未安裝微信或者微信版本過低。", "There is no WeChat or the version is too low."));
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:27,代碼來源:a.java

示例5: share

import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
public boolean share(Platform plat, HashMap<String, Object> data) {
    if (plat == null || data == null) {
        return false;
    }
    try {
        Bitmap viewToShare = (Bitmap) data.get("viewToShare");
        if (!(!TextUtils.isEmpty((String) data.get("imagePath")) || viewToShare == null || viewToShare.isRecycled())) {
            File ss = new File(R.getCachePath(plat.getContext(), "screenshot"), 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());
        }
        ShareParams sp = new ShareParams((HashMap) data);
        if (this.customizeCallback != null) {
            this.customizeCallback.onShare(plat, sp);
        }
        plat.share(sp);
        return true;
    } catch (Throwable t) {
        t.printStackTrace();
        return false;
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:26,代碼來源:ShareCore.java

示例6: shareImage

import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
public static void shareImage(Bitmap bitmap) {
    Platform.ShareParams shareParams = new Platform.ShareParams();
    shareParams.setShareType(Platform.SHARE_EMOJI);
    shareParams.setImageData(bitmap);

    Platform platform = ShareSDK.getPlatform(Wechat.NAME);
    platform.share(shareParams);
}
 
開發者ID:auv1107,項目名稱:TextEmoji,代碼行數:9,代碼來源:WeixinShareUtils.java

示例7: shareImageUrl

import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
public static void shareImageUrl(String url) {
    Platform.ShareParams shareParams = new Platform.ShareParams();
    shareParams.setShareType(Platform.SHARE_EMOJI);
    shareParams.setImageUrl(url);

    Platform platform = ShareSDK.getPlatform(Wechat.NAME);
    platform.share(shareParams);
}
 
開發者ID:auv1107,項目名稱:TextEmoji,代碼行數:9,代碼來源:WeixinShareUtils.java

示例8: shareImageToQQ

import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
public static void shareImageToQQ(String path, boolean isBitmap) {
    Platform.ShareParams shareParams = new Platform.ShareParams();
    shareParams.setShareType(isBitmap ? Platform.SHARE_IMAGE : Platform.SHARE_EMOJI);
    shareParams.setImagePath(path);

    Platform platform = ShareSDK.getPlatform(QQ.NAME);
    platform.share(shareParams);
}
 
開發者ID:auv1107,項目名稱:TextEmoji,代碼行數:9,代碼來源:WeixinShareUtils.java


注:本文中的cn.sharesdk.framework.Platform.share方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。