本文整理匯總了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);
}
}
}
示例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);
}
示例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."));
}
示例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."));
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}