本文整理汇总了Java中com.umeng.socialize.controller.UMServiceFactory类的典型用法代码示例。如果您正苦于以下问题:Java UMServiceFactory类的具体用法?Java UMServiceFactory怎么用?Java UMServiceFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UMServiceFactory类属于com.umeng.socialize.controller包,在下文中一共展示了UMServiceFactory类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
private void init() {
mController = UMServiceFactory.getUMSocialService("com.umeng.share");
if (mListener != null) {
mController.unregisterListener(mListener);
}
mListener = new MSnsPostListener();
mController.registerListener(mListener);
new UMWXHandler(mActivity, WX_APPID, WX_APPKEY).addToSocialSDK();
new UMWXHandler(mActivity, WX_APPID, WX_APPKEY).setToCircle(true).addToSocialSDK();
new QZoneSsoHandler(mActivity, "100530867", "d32ea174315e9c42bfbd481ac3b3fef6")
.addToSocialSDK();
new UMQQSsoHandler(mActivity, "100530867", "d32ea174315e9c42bfbd481ac3b3fef6")
.addToSocialSDK();
mController.getConfig().removePlatform(new SHARE_MEDIA[]{SHARE_MEDIA.TENCENT, SHARE_MEDIA
.RENREN, SHARE_MEDIA.DOUBAN});
mController.getConfig().setPlatformOrder(new SHARE_MEDIA[]{SHARE_MEDIA.SINA, SHARE_MEDIA
.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE, SHARE_MEDIA.QZONE, SHARE_MEDIA.QQ});
}
示例2: sendAnalytic
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
public static void sendAnalytic(Context context, String str, String str2, UMediaObject
uMediaObject, String str3) {
UMSocialService uMSocialService = UMServiceFactory.getUMSocialService(str, RequestType
.ANALYTICS);
UMShareMsg uMShareMsg = new UMShareMsg();
Log.i(TAG, "send analytic report , the entity name is " + uMSocialService.getEntity()
.mDescriptor);
if (uMediaObject instanceof BaseMediaObject) {
uMShareMsg.setMediaData(uMediaObject);
} else if (uMediaObject instanceof BaseShareContent) {
uMShareMsg.setMediaData(((BaseShareContent) uMediaObject).getShareMedia());
}
uMSocialService.getEntity().setFireCallback(false);
uMShareMsg.mText = str2;
uMSocialService.postShareByCustomPlatform(context, null, str3, uMShareMsg, null);
}
示例3: openShare
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
public void openShare(Activity activity, SnsPostListener snsPostListener) {
a();
if (e(activity)) {
a(activity);
this.a.addStatisticsData(activity, SHARE_MEDIA.GENERIC, 1);
this.f = null;
b bVar = new b(activity);
bVar.setLayoutParams(new LayoutParams(-1, -1));
this.f = new aj(activity, bVar, UMServiceFactory.getUMSocialService(this.a
.mDescriptor));
this.f.setFocusable(true);
this.f.setBackgroundDrawable(new BitmapDrawable());
this.f.a(this.i);
bVar.a(new n(this));
if (snsPostListener != null) {
this.c.registerListener(snsPostListener);
}
if (this.g) {
d(activity);
} else {
this.f.showAtLocation(activity.getWindow().getDecorView(), 80, 0, 0);
}
}
}
示例4: initAcitonBar
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
protected static UMSocialService initAcitonBar(Context context) {
UMSocialService controller = UMServiceFactory.getUMSocialService(name_S, /** 相对于为事件ID,事件名字**/
RequestType.SOCIAL);
if (!controller.getEntity().initialized) { //判断是否初始化
controller.setShareContent("我非常喜欢" +name_S +",协会招新之际, 大家也来支持一下《番职通》,全面为你介绍所有协会的情况。http://blog.sina.com.cn/steven2947"); //设置默认分享内容
controller.setShareMedia(new UMImage(context, Img));
controller.initEntity(context, new SocializeClientListener() {
@Override
public void onStart() {
}
@Override
public void onComplete(int status, SocializeEntity entity) {
matchEntity(entity);
}
});
} else {
matchEntity( controller.getEntity());
}
return controller;
}
示例5: init
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
private void init() {
this.mController = UMServiceFactory.getUMSocialService("com.umeng.login");
this.actionType = getIntent().getIntExtra(LAU_KEY, -1);
setUpUi();
this.mUploadSNSInfoListener = new UploadSNSInfoListener(this);
this.mSNSLogin = new SNSLogin(this, this.mController, this.mUploadSNSInfoListener);
}
示例6: onCreate
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
public void onCreate(Bundle outState) {
super.onCreate(outState);
setContentView(R.layout.a6);
setTitle(R.string.am);
this.mController = UMServiceFactory.getUMSocialService("com.umeng.login");
initAccountSetting();
}
示例7: LoginAgent
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
public LoginAgent(Context context, String str, LoginListener loginListener) {
this.b = context;
this.f = loginListener;
this.c = UMServiceFactory.getUMSocialService(str);
this.d = SocialSNSHelper.getSupprotCloudPlatforms(context, this.c.getConfig());
a aVar = new a(this, context, context);
Set<SnsPlatform> keySet = this.e.keySet();
if (keySet == null || keySet.size() == 0) {
aVar.a(8);
} else {
for (SnsPlatform snsPlatform : keySet) {
aVar.a((View) this.e.get(snsPlatform), null);
}
}
aVar.a(context.getResources().getString(ResContainer.getResourceId(context, ResType
.STRING, "umeng_socialize_text_choose_account")));
aVar.b(0);
aVar.b("");
b bVar = new b(context);
bVar.a(ResContainer.getResourceId(context, ResType.DRAWABLE,
"umeng_socialize_default_avatar"));
bVar.a(context.getResources().getString(ResContainer.getResourceId(context, ResType
.STRING, "umeng_socialize_text_visitor")));
bVar.a(new c(this));
aVar.b(bVar.a(), null);
if (SocializeUtils.isFloatWindowStyle(context)) {
int[] floatWindowSize = SocializeUtils.getFloatWindowSize(context);
aVar.a(floatWindowSize[0], floatWindowSize[1]);
}
this.a = aVar.a();
if (context instanceof Activity) {
this.a.setOwnerActivity((Activity) context);
}
this.a.a(new d(this));
}
示例8: j
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
public j(Activity activity, SocializeEntity socializeEntity, SHARE_MEDIA share_media,
UMAuthListener uMAuthListener) {
super(activity, ResContainer.getResourceId(activity.getApplicationContext(), ResType
.STYLE, "umeng_socialize_popup_dialog"));
this.k = activity.getApplicationContext();
this.l = activity;
this.c = uMAuthListener;
this.m = share_media;
this.i = UMServiceFactory.getUMSocialService(socializeEntity.mDescriptor);
SocializeConfig config = this.i.getConfig();
this.n = config.getFollowFids(share_media);
this.o = config.getOauthDialogFollowListener();
switch (s.a[share_media.ordinal()]) {
case 1:
this.j = p;
break;
case 2:
this.j = q;
break;
case 3:
this.j = r;
break;
case 4:
this.j = s;
break;
}
LayoutInflater layoutInflater = (LayoutInflater) this.l.getSystemService("layout_inflater");
int resourceId = ResContainer.getResourceId(this.k, ResType.LAYOUT,
"umeng_socialize_oauth_dialog");
int resourceId2 = ResContainer.getResourceId(this.k, ResType.ID, "umeng_socialize_follow");
int resourceId3 = ResContainer.getResourceId(this.k, ResType.ID,
"umeng_socialize_follow_check");
this.d = layoutInflater.inflate(resourceId, null);
View findViewById = this.d.findViewById(resourceId2);
this.f = (CheckBox) this.d.findViewById(resourceId3);
Object obj = (this.n == null || this.n.size() <= 0) ? null : 1;
Object obj2 = (share_media == SHARE_MEDIA.SINA || share_media == SHARE_MEDIA.TENCENT) ? 1
: null;
if (obj == null || obj2 == null) {
findViewById.setVisibility(8);
} else {
findViewById.setVisibility(0);
}
int resourceId4 = ResContainer.getResourceId(this.k, ResType.ID, "progress_bar_parent");
resourceId = ResContainer.getResourceId(this.k, ResType.ID,
"umeng_socialize_title_bar_leftBt");
resourceId2 = ResContainer.getResourceId(this.k, ResType.ID,
"umeng_socialize_title_bar_rightBt");
resourceId3 = ResContainer.getResourceId(this.k, ResType.ID,
"umeng_socialize_title_bar_middleTv");
int resourceId5 = ResContainer.getResourceId(this.k, ResType.ID,
"umeng_socialize_titlebar");
this.e = this.d.findViewById(resourceId4);
this.e.setVisibility(0);
((Button) this.d.findViewById(resourceId)).setOnClickListener(new l(this));
this.d.findViewById(resourceId2).setVisibility(8);
((TextView) this.d.findViewById(resourceId3)).setText("授权" + SocialSNSHelper.getShowWord
(this.k, share_media));
b();
View mVar = new m(this, this.k, findViewById, this.d.findViewById(resourceId5),
SocializeUtils.dip2Px(this.k, 200.0f));
mVar.addView(this.d, -1, -1);
setContentView(mVar);
LayoutParams attributes = getWindow().getAttributes();
if (SocializeUtils.isFloatWindowStyle(this.k)) {
int[] floatWindowSize = SocializeUtils.getFloatWindowSize(this.k);
attributes.width = floatWindowSize[0];
attributes.height = floatWindowSize[1];
resourceId4 = ResContainer.getResourceId(getContext(), ResType.STYLE,
"umeng_socialize_dialog_anim_fade");
} else {
attributes.height = -1;
attributes.width = -1;
resourceId4 = ResContainer.getResourceId(getContext(), ResType.STYLE,
"umeng_socialize_dialog_animations");
}
attributes.gravity = 17;
getWindow().getAttributes().windowAnimations = resourceId4;
}
示例9: onCreate
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.almanac_activity);
calendar = Calendar.getInstance(Locale.CHINA);
initView();
updateView();
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(this);
mController = UMServiceFactory.getUMSocialService("com.umeng.share",
RequestType.SOCIAL);
mController.getConfig().setSsoHandler(new SinaSsoHandler());
String appID = "wx4f7f32d56bb3ddb6";
String contentUrl = "http://www.wandoujia.com/apps/com.nozomi.almanac";
mController.getConfig().supportWXPlatform(this, appID, contentUrl);
mController.getConfig()
.supportWXCirclePlatform(this, appID, contentUrl);
mShakeController = UMShakeServiceFactory
.getShakeService("com.umeng.share");
mShakeController.setShareContent("#Acfun黄历#");
platforms.add(SHARE_MEDIA.SINA);
platforms.add(SHARE_MEDIA.WEIXIN);
platforms.add(SHARE_MEDIA.WEIXIN_CIRCLE);
appAdapter = new UMAppAdapter(AlmanacActivity.this);
}
示例10: onCreate
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.setting_activity);
sp = getSharedPreferences("acfun_almanac", Context.MODE_PRIVATE);
editor = sp.edit();
mController = UMServiceFactory.getUMSocialService("com.umeng.share",
RequestType.SOCIAL);
mController.getConfig().setSsoHandler(new SinaSsoHandler());
initView();
}
示例11: onCreate
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
protected void onCreate(Bundle bundle) {
this.B = SocializeUtils.isFloatWindowStyle(this);
if (!this.B) {
setTheme(ResContainer.getResourceId(this, ResType.STYLE, "Theme.UMDefault"));
}
super.onCreate(bundle);
this.t = this;
setContentView(ResContainer.getResourceId(this, ResType.LAYOUT,
"umeng_socialize_post_share"));
LayoutParams attributes = getWindow().getAttributes();
attributes.softInputMode = 16;
if (this.B) {
int[] floatWindowSize = SocializeUtils.getFloatWindowSize(this.t);
attributes.width = floatWindowSize[0];
attributes.height = floatWindowSize[1];
}
getWindow().setAttributes(attributes);
this.o = (KeyboardListenRelativeLayout) findViewById(ResContainer.getResourceId(this,
ResType.ID, "umeng_socialize_share_root"));
this.o.setOnKeyboardStateChangedListener(new t(this));
this.w = getIntent().getStringExtra(SocializeProtocolConstants.PROTOCOL_KEY_DESCRIPTOR);
this.x = SHARE_MEDIA.convertToEmun(getIntent().getStringExtra("sns"));
if (this.x == null) {
Toast.makeText(this, "出错啦!", 0).show();
a();
}
if (TextUtils.isEmpty(this.w)) {
Log.e(b, "####No EntityPool key..............");
a();
}
this.v = UMServiceFactory.getUMSocialService(this.w);
this.q = this.v.getEntity();
this.D = this.q.getMedia();
if (this.D instanceof SimpleShareContent) {
if (this.D instanceof BaseShareContent) {
this.D = ((BaseShareContent) this.D).getShareMedia();
} else {
this.D = ((SimpleShareContent) this.D).getShareImage();
}
}
this.q.addStatisticsData(this, this.x, 15);
if (this.x == SHARE_MEDIA.QQ) {
this.D = this.E.getSsoHandler(SHARE_MEDIA.QQ.getReqCode()).mShareMedia;
}
}
示例12: a
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
private final void a() {
if (this.b == null && this.a != null) {
this.b = UMServiceFactory.getUMSocialService(this.a.mDescriptor);
}
}
示例13: onClick
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
public void onClick(Context context, SocializeEntity socializeEntity, SnsPostListener
snsPostListener) {
UMServiceFactory.getUMSocialService(socializeEntity.mDescriptor).postShare(context, this
.a.mPlatform, snsPostListener);
}
示例14: onShareItemSelected
import com.umeng.socialize.controller.UMServiceFactory; //导入依赖的package包/类
public void onShareItemSelected() {
final UMSocialService socialService = UMServiceFactory.getUMSocialService("com.umeng.share");
// Remove Tencent Weibo and QZone from share panel.
socialService.getConfig().removePlatform(SHARE_MEDIA.TENCENT);
socialService.getConfig().removePlatform(SHARE_MEDIA.QZONE);
String webLink = this.topicInfo.getLinks().getWebURL();
String shareContent = this.topicInfo.getTitle() + " " + webLink;
String title = getString(R.string.share_topic, this.topicInfo.getUser().getData().getName());
socialService.setShareContent(shareContent);
if (!BuildConfig.QQ_APPID.isEmpty() && !BuildConfig.QQ_APPKEY.isEmpty()) {
// Add QQ
UMQQSsoHandler qqSsoHandler = new UMQQSsoHandler(this, BuildConfig.QQ_APPID, BuildConfig.QQ_APPKEY);
qqSsoHandler.addToSocialSDK();
QQShareContent qqShareContent = new QQShareContent();
qqShareContent.setShareContent(shareContent);
qqShareContent.setTitle(title);
qqShareContent.setTargetUrl(this.topicInfo.getLinks().getWebURL());
socialService.setShareMedia(qqShareContent);
} else {
socialService.getConfig().removePlatform(SHARE_MEDIA.QQ);
}
if (!BuildConfig.WX_APPID.isEmpty() && !BuildConfig.WX_SECRET.isEmpty()) {
// Add WeiChat
UMWXHandler wxHandler = new UMWXHandler(this, BuildConfig.WX_APPID, BuildConfig.WX_SECRET);
wxHandler.addToSocialSDK();
// Add WeChat Circle
UMWXHandler wxCircleHandler = new UMWXHandler(this, BuildConfig.WX_APPID, BuildConfig.WX_SECRET);
wxCircleHandler.setToCircle(true);
wxCircleHandler.addToSocialSDK();
//设置微信分享内容
WeiXinShareContent weixinContent = new WeiXinShareContent();
weixinContent.setShareContent(shareContent);
weixinContent.setTitle(title);
weixinContent.setTargetUrl(this.topicInfo.getLinks().getWebURL());
weixinContent.setShareImage(new UMImage(this, topicInfo.getUser().getData().getAvatar()));
socialService.setShareMedia(weixinContent);
Logger.d(topicInfo.getUser().getData().getAvatar());
//设置微信朋友圈分享内容
CircleShareContent circleMedia = new CircleShareContent();
circleMedia.setShareContent(shareContent);
circleMedia.setTitle(title);
circleMedia.setTargetUrl(this.topicInfo.getLinks().getWebURL());
circleMedia.setShareImage(new UMImage(this, topicInfo.getUser().getData().getAvatar()));
socialService.setShareMedia(circleMedia);
}else{
socialService.getConfig().removePlatform(SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE);
}
socialService.openShare(this, false);
}