本文整理匯總了Java中cn.sharesdk.framework.Platform.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java Platform.getName方法的具體用法?Java Platform.getName怎麽用?Java Platform.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cn.sharesdk.framework.Platform
的用法示例。
在下文中一共展示了Platform.getName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isUseClientToShare
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
/** 判斷指定平台是否隻能使用客戶端分享 */
final boolean isUseClientToShare(Platform platform) {
String name = platform.getName();
if ("Wechat".equals(name) || "WechatMoments".equals(name)
|| "WechatFavorite".equals(name) || "ShortMessage".equals(name)
|| "Email".equals(name) || "GooglePlus".equals(name)
|| "QQ".equals(name) || "Pinterest".equals(name)
|| "Instagram".equals(name) || "Yixin".equals(name)
|| "YixinMoments".equals(name) || "QZone".equals(name)
|| "Mingdao".equals(name) || "Line".equals(name)
|| "KakaoStory".equals(name) || "KakaoTalk".equals(name)
|| "Bluetooth".equals(name) || "WhatsApp".equals(name)
|| "BaiduTieba".equals(name) || "Laiwang".equals(name)
|| "LaiwangMoments".equals(name) || "Alipay".equals(name)
|| "FacebookMessenger".equals(name)
) {
return true;
} else if ("Evernote".equals(name)) {
if ("true".equals(platform.getDevinfo("ShareByAppClient"))) {
return true;
}
} else if ("SinaWeibo".equals(name)) {
if ("true".equals(platform.getDevinfo("ShareByAppClient"))) {
Intent test = new Intent(Intent.ACTION_SEND);
test.setPackage("com.sina.weibo");
test.setType("image/*");
ResolveInfo ri = platform.getContext().getPackageManager().resolveActivity(test, 0);
return (ri != null);
}
}
return false;
}
示例2: getName
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private String getName(Platform plat) {
if (plat == null) {
return "";
}
String name = plat.getName();
if (name == null) {
return "";
}
int resId = com.mob.tools.utils.R.getStringRes(context, plat.getName());
if (resId > 0) {
return context.getString(resId);
}
return null;
}
示例3: getName
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private String getName(Platform plat) {
if (plat == null) {
return "";
}
String name = plat.getName();
if (name == null) {
return "";
}
int resId = com.mob.tools.utils.R.getStringRes(getContext(), plat.getName().toLowerCase());
if (resId > 0) {
return getContext().getString(resId);
}
return null;
}
示例4: getPlatLogo
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private Bitmap getPlatLogo(Platform plat) {
if (plat == null) {
return null;
}
String name = plat.getName();
if (name == null) {
return null;
}
String resName = "logo_" + plat.getName();
int resId = getBitmapRes(activity, resName.toLowerCase());
if(resId > 0) {
return BitmapFactory.decodeResource(activity.getResources(), resId);
}
return null;
}
示例5: AuthAdapter
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
public AuthAdapter(Context context) {
this.context = context;
// 獲取平台列表
Platform[] tmp = ShareSDK.getPlatformList();
platforms = new ArrayList<Platform>();
if (tmp == null) {
return;
}
for (Platform p : tmp) {
String name = p.getName();
if ((p instanceof CustomPlatform)
|| !ShareCore.canAuthorize(p.getContext(), name)) {
continue;
}
if (p.getName().equals(Wechat.NAME)){
continue;
}
platforms.add(p);
}
}
示例6: getName
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private String getName(Platform plat) {
if (plat == null) {
return "";
}
String name = plat.getName();
if (name == null) {
return "";
}
int resId = cn.sharesdk.framework.utils.R.getStringRes(getContext(), plat.getName());
if (resId > 0) {
return getContext().getString(resId);
}
return null;
}
示例7: getPlatLogo
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private Bitmap getPlatLogo(Platform plat) {
if (plat == null) {
return null;
}
String name = plat.getName();
if (name == null) {
return null;
}
String resName = "logo_" + plat.getName();
int resId = getBitmapRes(activity, resName);
if(resId > 0) {
return BitmapFactory.decodeResource(activity.getResources(), resId);
}
return null;
}
示例8: initAtUserView
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private void initAtUserView() {
LinearLayout atLayout = (LinearLayout) findViewByResName("atLayout");
for (Platform platform : this.platforms) {
String platformName = platform.getName();
if (isShowAtUserLayout(platformName)) {
View view = LayoutInflater.from(this.activity).inflate(R.getLayoutRes(this.activity, "skyblue_editpage_at_layout"), null);
TextView atDescTextView = (TextView) view.findViewById(R.getIdRes(this.activity, "atDescTextView"));
TextView atTextView = (TextView) view.findViewById(R.getIdRes(this.activity, "atTextView"));
OnClickListener atBtnClickListener = new OnClickListener() {
public void onClick(View v) {
FollowListPage subPage = new FollowListPage();
subPage.setPlatform((Platform) v.getTag());
subPage.showForResult(EditPage.this.activity, null, EditPage.this);
}
};
atTextView.setTag(platform);
atTextView.setOnClickListener(atBtnClickListener);
atDescTextView.setTag(platform);
atDescTextView.setOnClickListener(atBtnClickListener);
atTextView.setText(getAtUserButtonText(platformName));
atDescTextView.setText(getContext().getString(R.getStringRes(this.activity, "list_friends"), new Object[]{getLogoName(platformName)}));
atLayout.addView(view);
}
}
}
示例9: initAtUserView
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private void initAtUserView() {
LinearLayout atLayout = (LinearLayout) findViewByResName("atLayout");
for(Platform platform : platforms) {
String platformName = platform.getName();
if (isShowAtUserLayout(platformName)) {
View view = LayoutInflater.from(activity).inflate(getLayoutRes(activity, "skyblue_editpage_at_layout"), null);
TextView atDescTextView = (TextView) view.findViewById(getIdRes(activity, "atDescTextView"));
TextView atTextView = (TextView) view.findViewById(getIdRes(activity, "atTextView"));
OnClickListener atBtnClickListener = new OnClickListener() {
public void onClick(View v) {
FollowListPage subPage = new FollowListPage();
subPage.setPlatform((Platform) v.getTag());
subPage.showForResult(activity, null, EditPage.this);
}
};
atTextView.setTag(platform);
atTextView.setOnClickListener(atBtnClickListener);
atDescTextView.setTag(platform);
atDescTextView.setOnClickListener(atBtnClickListener);
atTextView.setText(getAtUserButtonText(platformName));
atDescTextView.setText(getContext().getString(getStringRes(activity, "list_friends"), getLogoName(platformName)));
atLayout.addView(view);
}
}
}
示例10: getIcon
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private Bitmap getIcon(Platform plat) {
if (plat == null) {
return null;
}
String name = plat.getName();
if (name == null) {
return null;
}
String resName = "logo_" + plat.getName();
int resId = getBitmapRes(getContext(), resName.toLowerCase());
return BitmapFactory.decodeResource(getResources(), resId);
}
示例11: getIcon
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private Bitmap getIcon(Platform plat) {
if (plat == null) {
return null;
}
String name = plat.getName();
if (name == null) {
return null;
}
String resName = "logo_" + plat.getName();
int resId = cn.sharesdk.framework.utils.R.getResId(R.drawable.class, resName);
return BitmapFactory.decodeResource(context.getResources(), resId);
}
示例12: getName
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private String getName(Platform plat) {
if (plat == null) {
return "";
}
String name = plat.getName();
if (name == null) {
return "";
}
int resId = cn.sharesdk.framework.utils.R.getStringRes(context, plat.getName());
return context.getString(resId);
}
示例13: getIcon
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private Bitmap getIcon(Platform plat) {
if (plat == null) {
return null;
}
String name = plat.getName();
if (name == null) {
return null;
}
String resName = "logo_" + plat.getName();
int resId = getBitmapRes(getContext(), resName);
return BitmapFactory.decodeResource(getResources(), resId);
}
示例14: onShareButtonClick
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
protected void onShareButtonClick(View v, List<Object> checkedPlatforms) {
if (this.onShareButtonClickListener != null) {
this.onShareButtonClickListener.onClick(v, checkedPlatforms);
}
HashMap<Platform, HashMap<String, Object>> silentShareData = new HashMap();
List<Platform> supportEditPagePlatforms = new ArrayList();
for (CustomerLogo item : checkedPlatforms) {
if (item instanceof CustomerLogo) {
item.listener.onClick(v);
} else {
Platform plat = (Platform) item;
String name = plat.getName();
if (this.silent || ShareCore.isDirectShare(plat)) {
HashMap<String, Object> shareParam = new HashMap(this.shareParamsMap);
shareParam.put("platform", name);
silentShareData.put(plat, shareParam);
} else {
supportEditPagePlatforms.add(plat);
}
}
}
if (silentShareData.size() > 0) {
this.themeShareCallback.doShare(silentShareData);
}
if (supportEditPagePlatforms.size() > 0) {
showEditPage(supportEditPagePlatforms);
}
finish();
}
示例15: getName
import cn.sharesdk.framework.Platform; //導入方法依賴的package包/類
private String getName(Platform plat) {
if (plat == null) {
return "";
}
if (plat.getName() == null) {
return "";
}
int resId = R.getStringRes(this.context, plat.getName());
if (resId > 0) {
return this.context.getString(resId);
}
return null;
}