106 lines
3.3 KiB
Java
106 lines
3.3 KiB
Java
package com.ubtrobot.ubtlib.social;
|
|
|
|
import android.app.Activity;
|
|
import android.content.Intent;
|
|
import com.ubtrobot.ubtlib.share.ShareBuilder;
|
|
import com.ubtrobot.ubtlib.share.UbtSocialShareListener;
|
|
import java.text.MessageFormat;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class UbtSocial implements IUbtSocial {
|
|
private static IUbtSocial a;
|
|
private static UbtSocial b;
|
|
|
|
/* renamed from: com.ubtrobot.ubtlib.social.UbtSocial$1, reason: invalid class name */
|
|
static /* synthetic */ class AnonymousClass1 {
|
|
static final /* synthetic */ int[] a = new int[UbtSocialType.values().length];
|
|
|
|
static {
|
|
try {
|
|
a[UbtSocialType.QQ.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
a[UbtSocialType.WECHAT.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
a[UbtSocialType.TWITTER.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
a[UbtSocialType.FACEBOOK.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
}
|
|
}
|
|
|
|
private UbtSocial() {
|
|
}
|
|
|
|
public static synchronized UbtSocial a(Activity activity, UbtSocialType ubtSocialType) {
|
|
IUbtSocial tencentUbtSocialImpl;
|
|
UbtSocial ubtSocial;
|
|
synchronized (UbtSocial.class) {
|
|
if (b == null) {
|
|
b = new UbtSocial();
|
|
}
|
|
int i = AnonymousClass1.a[ubtSocialType.ordinal()];
|
|
if (i == 1) {
|
|
tencentUbtSocialImpl = new TencentUbtSocialImpl();
|
|
tencentUbtSocialImpl.a(activity);
|
|
} else if (i == 2) {
|
|
tencentUbtSocialImpl = new WechatUbtSocialImpl();
|
|
tencentUbtSocialImpl.a(activity);
|
|
} else if (i == 3) {
|
|
tencentUbtSocialImpl = new TwitterUbtSocialImpl();
|
|
tencentUbtSocialImpl.a(activity);
|
|
} else {
|
|
if (i != 4) {
|
|
throw new RuntimeException(MessageFormat.format("social type : {0} not support", ubtSocialType.toString()));
|
|
}
|
|
tencentUbtSocialImpl = new FacebookUbtSocialImpl();
|
|
tencentUbtSocialImpl.a(activity);
|
|
}
|
|
a = tencentUbtSocialImpl;
|
|
ubtSocial = b;
|
|
}
|
|
return ubtSocial;
|
|
}
|
|
|
|
@Override // com.ubtrobot.ubtlib.social.IUbtSocial
|
|
public boolean b() {
|
|
return a.b();
|
|
}
|
|
|
|
@Override // com.ubtrobot.ubtlib.social.IUbtSocial
|
|
public void a(ShareBuilder shareBuilder) {
|
|
a.a(shareBuilder);
|
|
}
|
|
|
|
@Override // com.ubtrobot.ubtlib.social.IUbtSocial
|
|
public void a(UbtSocialShareListener ubtSocialShareListener) {
|
|
a.a(ubtSocialShareListener);
|
|
}
|
|
|
|
@Override // com.ubtrobot.ubtlib.social.IUbtSocial
|
|
public void a() {
|
|
a.a();
|
|
}
|
|
|
|
@Override // com.ubtrobot.ubtlib.social.IUbtSocial
|
|
public void a(UbtSocialAuthListener ubtSocialAuthListener) {
|
|
a.a(ubtSocialAuthListener);
|
|
}
|
|
|
|
@Override // com.ubtrobot.ubtlib.social.IUbtSocial
|
|
public void a(Activity activity) {
|
|
a.a(activity);
|
|
}
|
|
|
|
@Override // com.ubtrobot.ubtlib.social.IUbtSocial
|
|
public void a(int i, int i2, Intent intent) {
|
|
a.a(i, i2, intent);
|
|
}
|
|
}
|