177 lines
7.0 KiB
Java
177 lines
7.0 KiB
Java
package b.a.a;
|
|
|
|
import android.content.Context;
|
|
import android.view.View;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.TextView;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.FragmentViewModelLazyKt;
|
|
import b.a.a.x;
|
|
import b.a.d.f0;
|
|
import b.a.d.h0;
|
|
import b.a.i.a6;
|
|
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 */
|
|
/* loaded from: classes.dex */
|
|
public final class t extends AppDialog {
|
|
public static final /* synthetic */ KProperty[] j = {b.d.b.a.a.b0(t.class, "binding", "getBinding()Lcom/discord/databinding/WidgetUrgentMessageDialogBinding;", 0)};
|
|
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;
|
|
|
|
/* compiled from: WidgetUrgentMessageDialog.kt */
|
|
/* loaded from: classes.dex */
|
|
public static final class a {
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetUrgentMessageDialog.kt */
|
|
/* loaded from: classes.dex */
|
|
public static final /* synthetic */ class b extends k implements Function1<View, a6> {
|
|
public static final b j = new b();
|
|
|
|
public b() {
|
|
super(1, a6.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/WidgetUrgentMessageDialogBinding;", 0);
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public a6 invoke(View view) {
|
|
View view2 = view;
|
|
m.checkNotNullParameter(view2, "p1");
|
|
int i = R.id.view_dialog_confirmation_confirm;
|
|
LoadingButton loadingButton = (LoadingButton) view2.findViewById(R.id.view_dialog_confirmation_confirm);
|
|
if (loadingButton != null) {
|
|
i = R.id.view_dialog_confirmation_header;
|
|
TextView textView = (TextView) view2.findViewById(R.id.view_dialog_confirmation_header);
|
|
if (textView != null) {
|
|
i = R.id.view_dialog_confirmation_text;
|
|
TextView textView2 = (TextView) view2.findViewById(R.id.view_dialog_confirmation_text);
|
|
if (textView2 != null) {
|
|
return new a6((LinearLayout) view2, loadingButton, textView, textView2);
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i)));
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetUrgentMessageDialog.kt */
|
|
/* loaded from: classes.dex */
|
|
public static final class c extends o implements Function1<x.d, Unit> {
|
|
public c() {
|
|
super(1);
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public Unit invoke(x.d dVar) {
|
|
x.d dVar2 = dVar;
|
|
m.checkNotNullParameter(dVar2, "viewState");
|
|
t tVar = t.this;
|
|
KProperty[] kPropertyArr = t.j;
|
|
TextView textView = tVar.g().c;
|
|
m.checkNotNullExpressionValue(textView, "binding.viewDialogConfirmationHeader");
|
|
textView.setText(tVar.getString(R.string.system_dm_urgent_message_modal_header));
|
|
TextView textView2 = tVar.g().d;
|
|
m.checkNotNullExpressionValue(textView2, "binding.viewDialogConfirmationText");
|
|
textView2.setText(tVar.getString(R.string.system_dm_urgent_message_modal_body));
|
|
tVar.g().f79b.setText(tVar.getString(R.string.okay));
|
|
tVar.g().f79b.setIsLoading(dVar2.f50b);
|
|
tVar.g().f79b.setOnClickListener(new u(tVar));
|
|
return Unit.a;
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetUrgentMessageDialog.kt */
|
|
/* loaded from: classes.dex */
|
|
public static final class d extends o implements Function1<x.b, Unit> {
|
|
public d() {
|
|
super(1);
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public Unit invoke(x.b bVar) {
|
|
x.b bVar2 = bVar;
|
|
m.checkNotNullParameter(bVar2, "event");
|
|
t tVar = t.this;
|
|
KProperty[] kPropertyArr = t.j;
|
|
Objects.requireNonNull(tVar);
|
|
if (m.areEqual(bVar2, x.b.a.a)) {
|
|
tVar.dismiss();
|
|
} else if (m.areEqual(bVar2, x.b.C0027b.a)) {
|
|
b.a.d.m.g(tVar.getContext(), R.string.internal_server_error, 0, null, 12);
|
|
} else {
|
|
throw new NoWhenBranchMatchedException();
|
|
}
|
|
return Unit.a;
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetUrgentMessageDialog.kt */
|
|
/* loaded from: classes.dex */
|
|
public static final class e extends o implements Function0<AppViewModel<x.d>> {
|
|
public static final e j = new e();
|
|
|
|
public e() {
|
|
super(0);
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
public AppViewModel<x.d> invoke() {
|
|
return new x(null, null, null, 7);
|
|
}
|
|
}
|
|
|
|
public t() {
|
|
super(R.layout.widget_urgent_message_dialog);
|
|
e eVar = e.j;
|
|
f0 f0Var = new f0(this);
|
|
this.m = FragmentViewModelLazyKt.createViewModelLazy(this, a0.getOrCreateKotlinClass(x.class), new k(1, f0Var), new h0(eVar));
|
|
}
|
|
|
|
public final a6 g() {
|
|
return (a6) this.l.getValue((Fragment) this, j[0]);
|
|
}
|
|
|
|
public final x h() {
|
|
return (x) this.m.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$default(h().observeViewState(), this, null, 2, null), t.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new c(), 62, (Object) null);
|
|
PublishSubject<x.b> publishSubject = h().k;
|
|
m.checkNotNullExpressionValue(publishSubject, "eventSubject");
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.bindToComponentLifecycle$default(publishSubject, this, null, 2, null), t.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new d(), 62, (Object) null);
|
|
}
|
|
}
|