2021-12-17 21:59:34 +00:00
|
|
|
package b.a.a;
|
2021-07-24 02:37:17 +00:00
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.view.View;
|
2021-08-03 07:33:18 +00:00
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import androidx.fragment.app.FragmentViewModelLazyKt;
|
2021-12-17 21:59:34 +00:00
|
|
|
import b.a.a.w;
|
|
|
|
import b.a.d.f0;
|
|
|
|
import b.a.d.h0;
|
2022-01-27 07:52:47 +00:00
|
|
|
import b.a.i.z5;
|
2021-08-09 22:51:56 +00:00
|
|
|
import com.discord.R;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.app.AppDialog;
|
|
|
|
import com.discord.app.AppViewModel;
|
|
|
|
import com.discord.stores.StoreStream;
|
2021-07-24 02:37:17 +00:00
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
|
|
import com.discord.views.LoadingButton;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.z.d.a0;
|
|
|
|
import d0.z.d.k;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
2021-07-24 02:37:17 +00:00
|
|
|
import java.util.Objects;
|
2021-08-03 07:33:18 +00:00
|
|
|
import kotlin.Lazy;
|
|
|
|
import kotlin.NoWhenBranchMatchedException;
|
|
|
|
import kotlin.Unit;
|
2021-07-24 02:37:17 +00:00
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
2021-08-03 07:33:18 +00:00
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
2021-07-24 02:37:17 +00:00
|
|
|
import kotlin.reflect.KProperty;
|
2021-08-03 07:33:18 +00:00
|
|
|
import rx.subjects.PublishSubject;
|
2021-07-24 02:37:17 +00:00
|
|
|
/* compiled from: WidgetUrgentMessageDialog.kt */
|
2021-08-03 07:33:18 +00:00
|
|
|
public final class s extends AppDialog {
|
2021-12-17 21:59:34 +00:00
|
|
|
public static final /* synthetic */ KProperty[] j = {b.d.b.a.a.b0(s.class, "binding", "getBinding()Lcom/discord/databinding/WidgetUrgentMessageDialogBinding;", 0)};
|
2021-12-02 18:53:44 +00:00
|
|
|
public static final a k = new a(null);
|
|
|
|
public final FragmentViewBindingDelegate l = FragmentViewBindingDelegateKt.viewBinding$default(this, b.j, null, 2, null);
|
|
|
|
public final Lazy m;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
|
|
|
/* compiled from: WidgetUrgentMessageDialog.kt */
|
|
|
|
public static final class a {
|
|
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetUrgentMessageDialog.kt */
|
2022-01-27 07:52:47 +00:00
|
|
|
public static final /* synthetic */ class b extends k implements Function1<View, z5> {
|
2021-12-02 18:53:44 +00:00
|
|
|
public static final b j = new b();
|
2021-08-03 07:33:18 +00:00
|
|
|
|
|
|
|
public b() {
|
2022-01-27 07:52:47 +00:00
|
|
|
super(1, z5.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/WidgetUrgentMessageDialogBinding;", 0);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 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
|
2022-01-27 07:52:47 +00:00
|
|
|
public z5 invoke(View view) {
|
2021-08-03 07:33:18 +00:00
|
|
|
View view2 = view;
|
|
|
|
m.checkNotNullParameter(view2, "p1");
|
2021-12-02 18:53:44 +00:00
|
|
|
int i = R.id.view_dialog_confirmation_confirm;
|
2021-08-09 22:51:56 +00:00
|
|
|
LoadingButton loadingButton = (LoadingButton) view2.findViewById(R.id.view_dialog_confirmation_confirm);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (loadingButton != null) {
|
2021-12-02 18:53:44 +00:00
|
|
|
i = R.id.view_dialog_confirmation_header;
|
2021-08-09 22:51:56 +00:00
|
|
|
TextView textView = (TextView) view2.findViewById(R.id.view_dialog_confirmation_header);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (textView != null) {
|
2021-12-02 18:53:44 +00:00
|
|
|
i = R.id.view_dialog_confirmation_text;
|
2021-08-09 22:51:56 +00:00
|
|
|
TextView textView2 = (TextView) view2.findViewById(R.id.view_dialog_confirmation_text);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (textView2 != null) {
|
2022-01-27 07:52:47 +00:00
|
|
|
return new z5((LinearLayout) view2, loadingButton, textView, textView2);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-12-02 18:53:44 +00:00
|
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i)));
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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;
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
2021-08-03 07:33:18 +00:00
|
|
|
|
|
|
|
/* 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;
|
2021-12-02 18:53:44 +00:00
|
|
|
KProperty[] kPropertyArr = s.j;
|
2021-12-17 21:59:34 +00:00
|
|
|
TextView textView = sVar.g().c;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(textView, "binding.viewDialogConfirmationHeader");
|
2021-08-09 22:51:56 +00:00
|
|
|
textView.setText(sVar.getString(R.string.system_dm_urgent_message_modal_header));
|
2021-08-03 07:33:18 +00:00
|
|
|
TextView textView2 = sVar.g().d;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.viewDialogConfirmationText");
|
2021-08-09 22:51:56 +00:00
|
|
|
textView2.setText(sVar.getString(R.string.system_dm_urgent_message_modal_body));
|
2022-01-27 07:52:47 +00:00
|
|
|
sVar.g().f239b.setText(sVar.getString(R.string.okay));
|
|
|
|
sVar.g().f239b.setIsLoading(dVar2.f49b);
|
|
|
|
sVar.g().f239b.setOnClickListener(new t(sVar));
|
2021-08-03 07:33:18 +00:00
|
|
|
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;
|
2021-08-20 02:22:46 +00:00
|
|
|
m.checkNotNullParameter(bVar2, "event");
|
2021-08-03 07:33:18 +00:00
|
|
|
s sVar = this.this$0;
|
2021-12-02 18:53:44 +00:00
|
|
|
KProperty[] kPropertyArr = s.j;
|
2021-08-03 07:33:18 +00:00
|
|
|
Objects.requireNonNull(sVar);
|
|
|
|
if (m.areEqual(bVar2, w.b.a.a)) {
|
|
|
|
sVar.dismiss();
|
2022-02-02 08:50:56 +00:00
|
|
|
} else if (m.areEqual(bVar2, w.b.C0017b.a)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
b.a.d.m.g(sVar.getContext(), R.string.internal_server_error, 0, null, 12);
|
2021-08-03 07:33:18 +00:00
|
|
|
} else {
|
|
|
|
throw new NoWhenBranchMatchedException();
|
|
|
|
}
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetUrgentMessageDialog.kt */
|
|
|
|
public static final class e extends o implements Function0<AppViewModel<w.d>> {
|
2021-12-02 18:53:44 +00:00
|
|
|
public static final e j = new e();
|
2021-08-03 07:33:18 +00:00
|
|
|
|
|
|
|
public e() {
|
|
|
|
super(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
|
|
/* renamed from: invoke */
|
2021-11-02 06:38:17 +00:00
|
|
|
public AppViewModel<w.d> mo1invoke() {
|
2021-08-03 07:33:18 +00:00
|
|
|
return new w(null, null, null, 7);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public s() {
|
2021-08-09 22:51:56 +00:00
|
|
|
super(R.layout.widget_urgent_message_dialog);
|
2021-12-02 18:53:44 +00:00
|
|
|
e eVar = e.j;
|
2021-08-13 06:23:11 +00:00
|
|
|
f0 f0Var = new f0(this);
|
2021-12-17 21:59:34 +00:00
|
|
|
this.m = FragmentViewModelLazyKt.createViewModelLazy(this, a0.getOrCreateKotlinClass(w.class), new k(1, f0Var), new h0(eVar));
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
2022-01-27 07:52:47 +00:00
|
|
|
public final z5 g() {
|
|
|
|
return (z5) this.l.getValue((Fragment) this, j[0]);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final w h() {
|
2021-12-02 18:53:44 +00:00
|
|
|
return (w) this.m.getValue();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@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);
|
2021-08-27 06:37:59 +00:00
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle$default(h().observeViewState(), this, null, 2, null), s.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new c(this), 62, (Object) null);
|
2021-12-02 18:53:44 +00:00
|
|
|
PublishSubject<w.b> publishSubject = h().k;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(publishSubject, "eventSubject");
|
2021-08-27 06:37:59 +00:00
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle$default(publishSubject, this, null, 2, null), s.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new d(this), 62, (Object) null);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|