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 = 2131893165;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Email.INSTANCE)) {
|
|
i = 2131893157;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Connections.INSTANCE)) {
|
|
i = 2131893155;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Guilds.INSTANCE)) {
|
|
i = 2131893161;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.GuildsJoin.INSTANCE)) {
|
|
i = 2131893163;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.GdmJoin.INSTANCE)) {
|
|
i = 2131893159;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Bot.INSTANCE)) {
|
|
i = 2131893152;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.WebhookIncoming.INSTANCE)) {
|
|
i = 2131893179;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.Rpc.INSTANCE)) {
|
|
i = 2131893170;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcNotificationsRead.INSTANCE)) {
|
|
i = 2131893173;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcVoiceRead.INSTANCE)) {
|
|
i = 2131893175;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcVoiceWrite.INSTANCE)) {
|
|
i = 2131893176;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RpcActivitiesWrite.INSTANCE)) {
|
|
i = 2131893171;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.MessagesRead.INSTANCE)) {
|
|
i = 2131893166;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsBuildsUpload.INSTANCE)) {
|
|
i = 2131893142;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsBuildsRead.INSTANCE)) {
|
|
i = 2131893140;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsCommands.INSTANCE)) {
|
|
i = 2131893144;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsCommandsUpdate.INSTANCE)) {
|
|
i = 2131893146;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsStoreUpdate.INSTANCE)) {
|
|
i = 2131893150;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ApplicationsEntitlements.INSTANCE)) {
|
|
i = 2131893148;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ActivitiesRead.INSTANCE)) {
|
|
i = 2131893136;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.ActivitiesWrite.INSTANCE)) {
|
|
i = 2131893138;
|
|
} else if (m.areEqual(oAuthScope, OAuthScope.RelationshipsRead.INSTANCE)) {
|
|
i = 2131893168;
|
|
} else if (oAuthScope instanceof OAuthScope.Invalid) {
|
|
throw new InvalidScopeException(((OAuthScope.Invalid) oAuthScope).b());
|
|
} else {
|
|
throw new NoWhenBranchMatchedException();
|
|
}
|
|
textView.setText(i);
|
|
}
|
|
}
|