87 lines
4 KiB
Java
87 lines
4 KiB
Java
package com.discord.widgets.user;
|
|
|
|
import android.content.Context;
|
|
import android.view.View;
|
|
import c.a.l.b;
|
|
import com.discord.restapi.RestAPIParams;
|
|
import com.discord.utilities.rest.RestAPI;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
import com.discord.views.CheckedSetting;
|
|
import com.discord.views.RadioManager;
|
|
import com.google.android.material.textfield.TextInputLayout;
|
|
import d0.g0.t;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
import java.util.List;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
/* compiled from: WidgetBanUser.kt */
|
|
public final class WidgetBanUser$onViewBound$3 implements View.OnClickListener {
|
|
public final /* synthetic */ long $guildId;
|
|
public final /* synthetic */ long $userId;
|
|
public final /* synthetic */ String $userName;
|
|
public final /* synthetic */ WidgetBanUser this$0;
|
|
|
|
/* compiled from: WidgetBanUser.kt */
|
|
/* renamed from: com.discord.widgets.user.WidgetBanUser$onViewBound$3$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends o implements Function1<Void, Unit> {
|
|
public final /* synthetic */ WidgetBanUser$onViewBound$3 this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass1(WidgetBanUser$onViewBound$3 widgetBanUser$onViewBound$3) {
|
|
super(1);
|
|
this.this$0 = widgetBanUser$onViewBound$3;
|
|
}
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Unit invoke(Void r1) {
|
|
invoke(r1);
|
|
return Unit.a;
|
|
}
|
|
|
|
public final void invoke(Void r7) {
|
|
Context context = this.this$0.this$0.getContext();
|
|
Context context2 = this.this$0.this$0.getContext();
|
|
c.a.d.o.h(context, context2 != null ? b.g(context2, 2131886820, new Object[]{this.this$0.$userName}, null, 4) : null, 0, null, 12);
|
|
this.this$0.this$0.dismiss();
|
|
}
|
|
}
|
|
|
|
public WidgetBanUser$onViewBound$3(WidgetBanUser widgetBanUser, long j, long j2, String str) {
|
|
this.this$0 = widgetBanUser;
|
|
this.$guildId = j;
|
|
this.$userId = j2;
|
|
this.$userName = str;
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
int i;
|
|
List access$getHistoryRadios$p = WidgetBanUser.access$getHistoryRadios$p(this.this$0);
|
|
RadioManager access$getDeleteHistoryRadioManager$p = WidgetBanUser.access$getDeleteHistoryRadioManager$p(this.this$0);
|
|
switch (((CheckedSetting) access$getHistoryRadios$p.get(access$getDeleteHistoryRadioManager$p != null ? access$getDeleteHistoryRadioManager$p.b() : 0)).getId()) {
|
|
case 2131362092:
|
|
i = 1;
|
|
break;
|
|
case 2131362093:
|
|
i = 7;
|
|
break;
|
|
case 2131362094:
|
|
default:
|
|
i = 0;
|
|
break;
|
|
}
|
|
TextInputLayout textInputLayout = WidgetBanUser.access$getBinding$p(this.this$0).h;
|
|
m.checkNotNullExpressionValue(textInputLayout, "binding.banUserReason");
|
|
String textOrEmpty = ViewExtensions.getTextOrEmpty(textInputLayout);
|
|
if (!(!t.isBlank(textOrEmpty))) {
|
|
textOrEmpty = null;
|
|
}
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().banGuildMember(this.$guildId, this.$userId, new RestAPIParams.BanGuildMember(Integer.valueOf(i), textOrEmpty)), false, 1, null), this.this$0, null, 2, null), this.this$0.getClass(), this.this$0.getContext(), (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(this), 60, (Object) null);
|
|
}
|
|
}
|