cn.sharesdk.framework.CustomPlatform Java Examples

The following examples show how to use cn.sharesdk.framework.CustomPlatform. 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: OnekeyShareThemeImpl.java    From POCenter with MIT License 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #2
Source File: OnekeyShareThemeImpl.java    From HHComicViewer with Apache License 2.0 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #3
Source File: PlatformPage.java    From HHComicViewer with Apache License 2.0 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #4
Source File: OnekeyShareThemeImpl.java    From fingerpoetry-android with Apache License 2.0 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #5
Source File: PlatformPage.java    From fingerpoetry-android with Apache License 2.0 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #6
Source File: OnekeyShareThemeImpl.java    From GithubApp with Apache License 2.0 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #7
Source File: PlatformPage.java    From GithubApp with Apache License 2.0 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #8
Source File: OnekeyShareThemeImpl.java    From MyHearts with Apache License 2.0 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #9
Source File: PlatformPage.java    From MyHearts with Apache License 2.0 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #10
Source File: OnekeyShareThemeImpl.java    From BaoKanAndroid with MIT License 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #11
Source File: PlatformPage.java    From BaoKanAndroid with MIT License 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #12
Source File: OnekeyShareThemeImpl.java    From LQRWeChat with MIT License 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #13
Source File: PlatformPage.java    From LQRWeChat with MIT License 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #14
Source File: PlatformPage.java    From LiuAGeAndroid with MIT License 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #15
Source File: PlatformPage.java    From YiZhi with Apache License 2.0 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #16
Source File: OnekeyShareThemeImpl.java    From YiZhi with Apache License 2.0 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #17
Source File: AuthPageAty.java    From Huochexing12306 with Apache License 2.0 6 votes vote down vote up
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);
	}
}
 
Example #18
Source File: PlatformPage.java    From POCenter with MIT License 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #19
Source File: PlatformPage.java    From enjoyshop with Apache License 2.0 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
    beforeFinish = new Runnable() {
        public void run() {
            boolean isSilent = isSilent();
            boolean isCustomPlatform = platform instanceof CustomPlatform;
            boolean isUseClientToShare = isUseClientToShare(platform);
            if (isSilent || isCustomPlatform || isUseClientToShare) {
                shareSilently(platform);
            } else {
                ShareParams sp = formateShareData(platform);
                if (sp != null) {
                    // 编辑分享内容的统计
                    ShareSDK.logDemoEvent(3, null);
                    if (getCustomizeCallback() != null) {
                        getCustomizeCallback().onShare(platform, sp);
                    }
                    impl.showEditPage(activity, platform, sp);
                }
            }
        }
    };
    finish();
}
 
Example #20
Source File: OnekeyShareThemeImpl.java    From enjoyshop with Apache License 2.0 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #21
Source File: OnekeyShareThemeImpl.java    From Mobike with Apache License 2.0 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #22
Source File: OnekeyShareThemeImpl.java    From LiuAGeAndroid with MIT License 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #23
Source File: PlatformPage.java    From Social with Apache License 2.0 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #24
Source File: OnekeyShareThemeImpl.java    From Social with Apache License 2.0 6 votes vote down vote up
public final void show(Context context) {
	this.context = context;

	// 显示方式是由platform和silent两个字段控制的
	// 如果platform设置了,则无须显示九宫格,否则都会显示;
	// 如果silent为true,表示不进入编辑页面,否则会进入。
	if (shareParamsMap.containsKey("platform")) {
		String name = String.valueOf(shareParamsMap.get("platform"));
		Platform platform = ShareSDK.getPlatform(name);
		boolean isCustomPlatform = platform instanceof CustomPlatform;
		boolean isUseClientToShare = isUseClientToShare(platform);
		if (silent || isCustomPlatform || isUseClientToShare) {
			shareSilently(platform);
		} else {
			prepareForEditPage(platform);
		}
	} else {
		showPlatformPage(context);
	}
}
 
Example #25
Source File: PlatformPage.java    From Mobike with Apache License 2.0 6 votes vote down vote up
public final void showEditPage(final Platform platform) {
	beforeFinish = new Runnable() {
		public void run() {
			boolean isSilent = isSilent();
			boolean isCustomPlatform = platform instanceof CustomPlatform;
			boolean isUseClientToShare = isUseClientToShare(platform);
			if (isSilent || isCustomPlatform || isUseClientToShare) {
				shareSilently(platform);
			} else {
				ShareParams sp = formateShareData(platform);
				if (sp != null) {
					// 编辑分享内容的统计
					ShareSDK.logDemoEvent(3, null);
					if (getCustomizeCallback() != null) {
						getCustomizeCallback().onShare(platform, sp);
					}
					impl.showEditPage(activity, platform, sp);
				}
			}
		}
	};
	finish();
}
 
Example #26
Source File: ShareContentCustomizeDemo.java    From BigApp_Discuz_Android with Apache License 2.0 5 votes vote down vote up
public void onShare(Platform platform, Platform.ShareParams paramsToShare) {
        if (platform instanceof CustomPlatform) {
            return;
        }
//		int id = ShareSDK.platformNameToId(platform.getName());
//		if (MainActivity.TEST_TEXT != null && MainActivity.TEST_TEXT.containsKey(id)) {
//			String text = MainActivity.TEST_TEXT.get(id);
//			paramsToShare.setText(text);
//		} else if ("Twitter".equals(platform.getName())) {
//			// 改写twitter分享内容中的text字段,否则会超长,
//			// 因为twitter会将图片地址当作文本的一部分去计算长度
//
//			String text = platform.getContext().getString(R.string.share_content_short);
//			paramsToShare.setText(text);
//		}

        Log.e("APP", "platform.getName():" + platform.getName());

        int id = ShareSDK.platformNameToId(platform.getName());
        if (SinaWeibo.NAME.equals(platform.getName())) {
            // 改写twitter分享内容中的text字段,否则会超长,
            // 因为twitter会将图片地址当作文本的一部分去计算长度

            String title = paramsToShare.getTitle();
            String titleUrl = paramsToShare.getTitleUrl();

//            if(title!=null&&title.length())


            String text = title + " " + titleUrl + ((weiboAt != null && weiboAt.length() > 0) ? " @" + weiboAt : "");
            paramsToShare.setText(text);
            paramsToShare.setImageUrl(null);
        }
    }
 
Example #27
Source File: EditPage.java    From AndroidLinkup with GNU General Public License v2.0 4 votes vote down vote up
public void onCreate() {
	if (reqData == null) {
		finish();
		return;
	}

	genBackground();
	activity.setContentView(getPageView());
	onTextChanged(etContent.getText(), 0, etContent.length(), 0);
	showThumb();

	// 获取平台列表并过滤微信等使用客户端分享的平台
	new Thread(){
		public void run() {
			platformList = ShareSDK.getPlatformList();
			if (platformList == null) {
				return;
			}

			ArrayList<Platform> list = new ArrayList<Platform>();
			for (Platform plat : platformList) {
				String name = plat.getName();
				if ((plat instanceof CustomPlatform)
						|| ShareCore.isUseClientToShare(name)) {
					continue;
				}
				list.add(plat);
			}
			platformList = new Platform[list.size()];
			for (int i = 0; i < platformList.length; i++) {
				platformList[i] = list.get(i);
			}

			UIHandler.sendEmptyMessage(1, new Callback() {
				public boolean handleMessage(Message msg) {
					afterPlatformListGot();
					return false;
				}
			});
		}
	}.start();
}
 
Example #28
Source File: PlatformMananger.java    From ShareSDK-for-Android with MIT License 4 votes vote down vote up
private void afterPlatformsGot(Platform[] platforms) {
		ShareListItemInEntity entity = null;
		PlatformEntity normalEntity = null;
		for (Platform platform : platforms) {
			String name = platform.getName();
			//客户端分享的情况
//			if (DemoUtils.isUseClientToShare(name)) {
//				continue;
//			}
			if (platform instanceof CustomPlatform) {
				continue;
			}
			//#if def{lang} == cn
			// 处理左边按钮和右边按钮
			//#elif def{lang} == en
			// initiate buttons
			//#endif
			entity = new ShareListItemInEntity();
			entity.setPlatform(platform);
			normalEntity = new PlatformEntity();
			normalEntity.setmPlatform(platform);
			entity.setType(SharePlatformType.FOREIGN_SHARE_PLAT);
			int platNameRes = ResHelper.getStringRes(context, "ssdk_" + name.toLowerCase());
			String resName = "ssdk_oks_classic_" + name;
			int resId = ResourcesUtils.getBitmapRes(context, resName.toLowerCase());
			if (resId > 0) {
				entity.setIcon(resId);
				normalEntity.setmIcon(resId);
			}

			if (platNameRes > 0) {
				String platName = context.getString(platNameRes);
				entity.setName(platName);
				normalEntity.setName(platName);
				String text = context.getString(R.string.share_to_format, platName);
			}
			if (Arrays.asList(china).contains(name) ) {
				if((!name.equals("Cmcc")) && (!name.equals("Telecom"))){
					chinaList.add(entity);
				}
				if (AuthorizationUserInfoUtils.canAuthorize(name)) {
					chinaListNormal.add(normalEntity);
				}
				if (AuthorizationUserInfoUtils.canGetUserInfo(name)) {
					chinaListNormalUserInfo.add(normalEntity);
				}
			} else {
				if (Arrays.asList(system).contains(name)) {
					systemList.add(entity);
					if (AuthorizationUserInfoUtils.canAuthorize(name)) {
						systemListNormal.add(normalEntity);
					}
					if (AuthorizationUserInfoUtils.canGetUserInfo(name)) {
						systemListNormal.add(normalEntity);
					}
				} else {
					if ((!name.equals("Accountkit")) && (!name.equals("GooglePlus"))){
						lists.add(entity);
					}
					if (AuthorizationUserInfoUtils.canAuthorize(name)) {
						normalList.add(normalEntity);
					}
					if (AuthorizationUserInfoUtils.canGetUserInfo(name)) {
						normalListUserInfo.add(normalEntity);
					}
				}

			}

		}
	}
 
Example #29
Source File: EditPage.java    From ShareSDKShareDifMsgDemo-Android with MIT License 4 votes vote down vote up
public void onCreate() {
	if (reqData == null) {
		finish();
		return;
	}

	genBackground();
	activity.setContentView(getPageView());
	onTextChanged(etContent.getText(), 0, etContent.length(), 0);
	showThumb();

	// 获取平台列表并过滤微信等使用客户端分享的平台
	new Thread(){
		public void run() {
			platformList = ShareSDK.getPlatformList();
			if (platformList == null) {
				return;
			}

			ArrayList<Platform> list = new ArrayList<Platform>();
			for (Platform plat : platformList) {
				String name = plat.getName();
				if ((plat instanceof CustomPlatform)
						|| ShareCore.isUseClientToShare(name)) {
					continue;
				}
				list.add(plat);
			}
			platformList = new Platform[list.size()];
			for (int i = 0; i < platformList.length; i++) {
				platformList[i] = list.get(i);
			}

			UIHandler.sendEmptyMessage(1, new Callback() {
				public boolean handleMessage(Message msg) {
					afterPlatformListGot();
					return false;
				}
			});
		}
	}.start();
}
 
Example #30
Source File: EditPage.java    From WeCenterMobile-Android with GNU General Public License v2.0 4 votes vote down vote up
public void onCreate() {
	if (reqData == null) {
		finish();
		return;
	}

	genBackground();
	activity.setContentView(getPageView());
	onTextChanged(etContent.getText(), 0, etContent.length(), 0);
	showThumb();

	// 获取平台列表并过滤微信等使用客户端分享的平台
	new Thread(){
		public void run() {
			platformList = ShareSDK.getPlatformList();
			if (platformList == null) {
				return;
			}

			ArrayList<Platform> list = new ArrayList<Platform>();
			for (Platform plat : platformList) {
				String name = plat.getName();
				if ((plat instanceof CustomPlatform)
						|| ShareCore.isUseClientToShare(name)) {
					continue;
				}
				list.add(plat);
			}
			platformList = new Platform[list.size()];
			for (int i = 0; i < platformList.length; i++) {
				platformList[i] = list.get(i);
			}

			UIHandler.sendEmptyMessage(1, new Callback() {
				public boolean handleMessage(Message msg) {
					afterPlatformListGot();
					return false;
				}
			});
		}
	}.start();
}