109 lines
4.8 KiB
Java
109 lines
4.8 KiB
Java
package com.discord.views;
|
|
|
|
import android.widget.TextView;
|
|
import c.a.i.o0;
|
|
import com.discord.api.auth.OAuthScope;
|
|
import com.discord.utilities.views.SimpleRecyclerAdapter;
|
|
import d0.z.d.m;
|
|
import kotlin.NoWhenBranchMatchedException;
|
|
/* compiled from: OAuthPermissionViews.kt */
|
|
public final class OAuthPermissionViews {
|
|
|
|
/* compiled from: OAuthPermissionViews.kt */
|
|
public static final class InvalidScopeException extends IllegalArgumentException {
|
|
private final String scope;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public InvalidScopeException(String str) {
|
|
super("invalid scope: " + str);
|
|
m.checkNotNullParameter(str, "scope");
|
|
this.scope = str;
|
|
}
|
|
|
|
public final String a() {
|
|
return this.scope;
|
|
}
|
|
}
|
|
|
|
/* compiled from: OAuthPermissionViews.kt */
|
|
public static final class a extends SimpleRecyclerAdapter.ViewHolder<OAuthScope> {
|
|
public final o0 a;
|
|
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
|
public a(o0 o0Var) {
|
|
super(r0);
|
|
m.checkNotNullParameter(o0Var, "binding");
|
|
TextView textView = o0Var.a;
|
|
m.checkNotNullExpressionValue(textView, "binding.root");
|
|
this.a = o0Var;
|
|
}
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
@Override // com.discord.utilities.views.SimpleRecyclerAdapter.ViewHolder
|
|
public void bind(OAuthScope oAuthScope) {
|
|
OAuthScope oAuthScope2 = oAuthScope;
|
|
m.checkNotNullParameter(oAuthScope2, "data");
|
|
TextView textView = this.a.a;
|
|
m.checkNotNullExpressionValue(textView, "binding.root");
|
|
OAuthPermissionViews.a(textView, oAuthScope2);
|
|
}
|
|
}
|
|
|
|
public static final void a(TextView textView, OAuthScope oAuthScope) throws InvalidScopeException {
|
|
int i;
|
|
m.checkNotNullParameter(textView, "$this$setScopePermissionText");
|
|
m.checkNotNullParameter(oAuthScope, "scope");
|
|
if (m.areEqual(oAuthScope, OAuthScope.Identify.INSTANCE)) {
|
|
i = 2131893087;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Email.INSTANCE)) {
|
|
i = 2131893079;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Connections.INSTANCE)) {
|
|
i = 2131893077;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Guilds.INSTANCE)) {
|
|
i = 2131893083;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.GuildsJoin.INSTANCE)) {
|
|
i = 2131893085;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.GdmJoin.INSTANCE)) {
|
|
i = 2131893081;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Bot.INSTANCE)) {
|
|
i = 2131893074;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.WebhookIncoming.INSTANCE)) {
|
|
i = 2131893101;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Rpc.INSTANCE)) {
|
|
i = 2131893092;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcNotificationsRead.INSTANCE)) {
|
|
i = 2131893095;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcVoiceRead.INSTANCE)) {
|
|
i = 2131893097;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcVoiceWrite.INSTANCE)) {
|
|
i = 2131893098;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcActivitiesWrite.INSTANCE)) {
|
|
i = 2131893093;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.MessagesRead.INSTANCE)) {
|
|
i = 2131893088;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsBuildsUpload.INSTANCE)) {
|
|
i = 2131893064;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsBuildsRead.INSTANCE)) {
|
|
i = 2131893062;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsCommands.INSTANCE)) {
|
|
i = 2131893066;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsCommandsUpdate.INSTANCE)) {
|
|
i = 2131893068;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsStoreUpdate.INSTANCE)) {
|
|
i = 2131893072;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsEntitlements.INSTANCE)) {
|
|
i = 2131893070;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ActivitiesRead.INSTANCE)) {
|
|
i = 2131893058;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ActivitiesWrite.INSTANCE)) {
|
|
i = 2131893060;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RelationshipsRead.INSTANCE)) {
|
|
i = 2131893090;
|
|
} else if (oAuthScope instanceof OAuthScope.Invalid) {
|
|
throw new InvalidScopeException(((OAuthScope.Invalid) oAuthScope).b());
|
|
} else {
|
|
throw new NoWhenBranchMatchedException();
|
|
}
|
|
textView.setText(i);
|
|
}
|
|
}
|