175 lines
7.2 KiB
Java
175 lines
7.2 KiB
Java
package c.a.a.g;
|
|
|
|
import android.content.Context;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.TextView;
|
|
import androidx.fragment.app.Fragment;
|
|
import c.a.i.n5;
|
|
import com.discord.R;
|
|
import com.discord.app.AppDialog;
|
|
import com.discord.stores.StoreNotices;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.utilities.string.StringUtilsKt;
|
|
import com.discord.utilities.uri.UriHandler;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
import com.google.android.material.button.MaterialButton;
|
|
import d0.z.d.k;
|
|
import d0.z.d.m;
|
|
import java.util.Objects;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.reflect.KProperty;
|
|
/* compiled from: WidgetMaskedLinksDialog.kt */
|
|
public final class a extends AppDialog {
|
|
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.a0(a.class, "binding", "getBinding()Lcom/discord/databinding/WidgetMaskedLinksDialogBinding;", 0)};
|
|
public static final b j = new b(null);
|
|
public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, c.i, null, 2, null);
|
|
|
|
/* compiled from: java-style lambda group */
|
|
/* renamed from: c.a.a.g.a$a reason: collision with other inner class name */
|
|
public static final class View$OnClickListenerC0018a implements View.OnClickListener {
|
|
public final /* synthetic */ int i;
|
|
public final /* synthetic */ Object j;
|
|
public final /* synthetic */ Object k;
|
|
|
|
public View$OnClickListenerC0018a(int i, Object obj, Object obj2) {
|
|
this.i = i;
|
|
this.j = obj;
|
|
this.k = obj2;
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
int i = this.i;
|
|
if (i == 0) {
|
|
a aVar = (a) this.j;
|
|
m.checkNotNullExpressionValue(view, "v");
|
|
Context context = view.getContext();
|
|
m.checkNotNullExpressionValue(context, "v.context");
|
|
String str = (String) this.k;
|
|
KProperty[] kPropertyArr = a.i;
|
|
Objects.requireNonNull(aVar);
|
|
UriHandler.handle$default(UriHandler.INSTANCE, context, str, null, 4, null);
|
|
aVar.dismiss();
|
|
} else if (i == 1) {
|
|
a aVar2 = (a) this.j;
|
|
m.checkNotNullExpressionValue(view, "v");
|
|
Context context2 = view.getContext();
|
|
m.checkNotNullExpressionValue(context2, "v.context");
|
|
String str2 = (String) this.k;
|
|
KProperty[] kPropertyArr2 = a.i;
|
|
Objects.requireNonNull(aVar2);
|
|
StoreStream.Companion.getMaskedLinks().trustDomain(str2);
|
|
UriHandler.handle$default(UriHandler.INSTANCE, context2, str2, null, 4, null);
|
|
aVar2.dismiss();
|
|
} else {
|
|
throw null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetMaskedLinksDialog.kt */
|
|
public static final class b {
|
|
public b(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetMaskedLinksDialog.kt */
|
|
public static final /* synthetic */ class c extends k implements Function1<View, n5> {
|
|
public static final c i = new c();
|
|
|
|
public c() {
|
|
super(1, n5.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/WidgetMaskedLinksDialogBinding;", 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 n5 invoke(View view) {
|
|
View view2 = view;
|
|
m.checkNotNullParameter(view2, "p1");
|
|
int i2 = R.id.masked_links_body_text;
|
|
TextView textView = (TextView) view2.findViewById(R.id.masked_links_body_text);
|
|
if (textView != null) {
|
|
i2 = R.id.masked_links_cancel;
|
|
MaterialButton materialButton = (MaterialButton) view2.findViewById(R.id.masked_links_cancel);
|
|
if (materialButton != null) {
|
|
i2 = R.id.masked_links_confirm;
|
|
MaterialButton materialButton2 = (MaterialButton) view2.findViewById(R.id.masked_links_confirm);
|
|
if (materialButton2 != null) {
|
|
i2 = R.id.masked_links_trust_domain;
|
|
TextView textView2 = (TextView) view2.findViewById(R.id.masked_links_trust_domain);
|
|
if (textView2 != null) {
|
|
i2 = R.id.view_dialog_confirmation_header;
|
|
TextView textView3 = (TextView) view2.findViewById(R.id.view_dialog_confirmation_header);
|
|
if (textView3 != null) {
|
|
return new n5((LinearLayout) view2, textView, materialButton, materialButton2, textView2, textView3);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetMaskedLinksDialog.kt */
|
|
public static final class d implements View.OnClickListener {
|
|
public final /* synthetic */ a i;
|
|
|
|
public d(a aVar) {
|
|
this.i = aVar;
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
this.i.dismiss();
|
|
}
|
|
}
|
|
|
|
public a() {
|
|
super(R.layout.widget_masked_links_dialog);
|
|
}
|
|
|
|
public final n5 g() {
|
|
return (n5) this.k.getValue((Fragment) this, i[0]);
|
|
}
|
|
|
|
@Override // androidx.fragment.app.Fragment
|
|
public void onDestroy() {
|
|
super.onDestroy();
|
|
StoreNotices notices = StoreStream.Companion.getNotices();
|
|
Objects.requireNonNull(j);
|
|
StoreNotices.markSeen$default(notices, "WIDGET_SPOOPY_LINKS_DIALOG", 0, 2, null);
|
|
}
|
|
|
|
@Override // com.discord.app.AppDialog
|
|
public void onViewBound(View view) {
|
|
String str;
|
|
Object obj;
|
|
m.checkNotNullParameter(view, "view");
|
|
super.onViewBound(view);
|
|
Bundle arguments = getArguments();
|
|
if (arguments == null || (str = arguments.getString("WIDGET_SPOOPY_LINKS_DIALOG_URL")) == null) {
|
|
str = "";
|
|
}
|
|
m.checkNotNullExpressionValue(str, "arguments?.getString(DIALOG_URL) ?: \"\"");
|
|
try {
|
|
obj = StringUtilsKt.toPunyCodeASCIIUrl(str);
|
|
} catch (Exception unused) {
|
|
dismiss();
|
|
obj = Unit.a;
|
|
}
|
|
TextView textView = g().b;
|
|
m.checkNotNullExpressionValue(textView, "binding.maskedLinksBodyText");
|
|
c.a.k.b.n(textView, R.string.masked_link_body, new Object[]{obj}, null, 4);
|
|
g().f136c.setOnClickListener(new d(this));
|
|
g().d.setOnClickListener(new View$OnClickListenerC0018a(0, this, str));
|
|
g().e.setOnClickListener(new View$OnClickListenerC0018a(1, this, str));
|
|
}
|
|
}
|