discord-jadx/app/src/main/java/c/a/a/s.java

188 lines
7.9 KiB
Java

package c.a.a;
import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.core.app.NotificationCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentViewModelLazyKt;
import c.a.a.w;
import c.a.e.h0;
import c.a.e.j0;
import c.a.j.s5;
import com.discord.R;
import com.discord.app.AppDialog;
import com.discord.app.AppViewModel;
import com.discord.stores.StoreStream;
import com.discord.utilities.rx.ObservableExtensionsKt;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
import com.discord.views.LoadingButton;
import d0.z.d.a0;
import d0.z.d.k;
import d0.z.d.m;
import d0.z.d.o;
import java.util.Objects;
import kotlin.Lazy;
import kotlin.NoWhenBranchMatchedException;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.reflect.KProperty;
import rx.subjects.PublishSubject;
/* compiled from: WidgetUrgentMessageDialog.kt */
public final class s extends AppDialog {
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.V(s.class, "binding", "getBinding()Lcom/discord/databinding/WidgetUrgentMessageDialogBinding;", 0)};
public static final a j = new a(null);
public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, b.i, null, 2, null);
public final Lazy l;
/* compiled from: WidgetUrgentMessageDialog.kt */
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
}
}
/* compiled from: WidgetUrgentMessageDialog.kt */
public static final /* synthetic */ class b extends k implements Function1<View, s5> {
public static final b i = new b();
public b() {
super(1, s5.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/WidgetUrgentMessageDialogBinding;", 0);
}
/* 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 s5 invoke(View view) {
View view2 = view;
m.checkNotNullParameter(view2, "p1");
int i2 = R.id.view_dialog_confirmation_confirm;
LoadingButton loadingButton = (LoadingButton) view2.findViewById(R.id.view_dialog_confirmation_confirm);
if (loadingButton != null) {
i2 = R.id.view_dialog_confirmation_header;
TextView textView = (TextView) view2.findViewById(R.id.view_dialog_confirmation_header);
if (textView != null) {
i2 = R.id.view_dialog_confirmation_text;
TextView textView2 = (TextView) view2.findViewById(R.id.view_dialog_confirmation_text);
if (textView2 != null) {
return new s5((LinearLayout) view2, loadingButton, textView, textView2);
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
}
}
/* compiled from: WidgetUrgentMessageDialog.kt */
public static final class c extends o implements Function1<w.d, Unit> {
public final /* synthetic */ s this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public c(s sVar) {
super(1);
this.this$0 = sVar;
}
/* 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 Unit invoke(w.d dVar) {
w.d dVar2 = dVar;
m.checkNotNullParameter(dVar2, "viewState");
s sVar = this.this$0;
KProperty[] kPropertyArr = s.i;
TextView textView = sVar.g().f162c;
m.checkNotNullExpressionValue(textView, "binding.viewDialogConfirmationHeader");
textView.setText(sVar.getString(R.string.system_dm_urgent_message_modal_header));
TextView textView2 = sVar.g().d;
m.checkNotNullExpressionValue(textView2, "binding.viewDialogConfirmationText");
textView2.setText(sVar.getString(R.string.system_dm_urgent_message_modal_body));
sVar.g().b.setText(sVar.getString(R.string.okay));
sVar.g().b.setIsLoading(dVar2.b);
sVar.g().b.setOnClickListener(new t(sVar));
return Unit.a;
}
}
/* compiled from: WidgetUrgentMessageDialog.kt */
public static final class d extends o implements Function1<w.b, Unit> {
public final /* synthetic */ s this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public d(s sVar) {
super(1);
this.this$0 = sVar;
}
/* 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 Unit invoke(w.b bVar) {
w.b bVar2 = bVar;
m.checkNotNullParameter(bVar2, NotificationCompat.CATEGORY_EVENT);
s sVar = this.this$0;
KProperty[] kPropertyArr = s.i;
Objects.requireNonNull(sVar);
if (m.areEqual(bVar2, w.b.a.a)) {
sVar.dismiss();
} else if (m.areEqual(bVar2, w.b.C0020b.a)) {
c.a.e.o.g(sVar.getContext(), R.string.internal_server_error, 0, null, 12);
} else {
throw new NoWhenBranchMatchedException();
}
return Unit.a;
}
}
/* compiled from: WidgetUrgentMessageDialog.kt */
public static final class e extends o implements Function0<AppViewModel<w.d>> {
public static final e i = new e();
public e() {
super(0);
}
/* Return type fixed from 'java.lang.Object' to match base method */
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public AppViewModel<w.d> mo1invoke() {
return new w(null, null, null, 7);
}
}
public s() {
super(R.layout.widget_urgent_message_dialog);
e eVar = e.i;
h0 h0Var = new h0(this);
this.l = FragmentViewModelLazyKt.createViewModelLazy(this, a0.getOrCreateKotlinClass(w.class), new m(1, h0Var), new j0(eVar));
}
public final s5 g() {
return (s5) this.k.getValue((Fragment) this, i[0]);
}
public final w h() {
return (w) this.l.getValue();
}
@Override // androidx.fragment.app.Fragment
public void onDestroy() {
StoreStream.Companion.getNotices().markDialogSeen("URGENT_MESSAGE_DIALOG");
super.onDestroy();
}
@Override // com.discord.app.AppDialog
public void onViewBound(View view) {
m.checkNotNullParameter(view, "view");
super.onViewBound(view);
setCancelable(false);
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle(h().observeViewState(), this), s.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new c(this), 62, (Object) null);
PublishSubject<w.b> publishSubject = h().j;
m.checkNotNullExpressionValue(publishSubject, "eventSubject");
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle(publishSubject, this), s.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new d(this), 62, (Object) null);
}
}