127 lines
5.6 KiB
Java
127 lines
5.6 KiB
Java
package c.a.a;
|
|
|
|
import android.content.Context;
|
|
import android.view.View;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.TextView;
|
|
import androidx.fragment.app.Fragment;
|
|
import c.a.i.h;
|
|
import com.discord.R;
|
|
import com.discord.app.AppDialog;
|
|
import com.discord.utilities.uri.UriHandler;
|
|
import com.discord.utilities.view.extensions.ViewExtensions;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
import d0.z.d.k;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.reflect.KProperty;
|
|
/* compiled from: ConnectedAccountActionsDialog.kt */
|
|
public final class i extends AppDialog {
|
|
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.a0(i.class, "binding", "getBinding()Lcom/discord/databinding/ConnectedAccountActionsDialogBinding;", 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 */
|
|
public static final class a implements View.OnClickListener {
|
|
public final /* synthetic */ int i;
|
|
public final /* synthetic */ Object j;
|
|
public final /* synthetic */ Object k;
|
|
|
|
public a(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) {
|
|
UriHandler uriHandler = UriHandler.INSTANCE;
|
|
Context requireContext = ((i) this.j).requireContext();
|
|
m.checkNotNullExpressionValue(requireContext, "requireContext()");
|
|
UriHandler.handle$default(uriHandler, requireContext, (String) this.k, null, 4, null);
|
|
((i) this.j).dismiss();
|
|
} else if (i == 1) {
|
|
Context requireContext2 = ((i) this.j).requireContext();
|
|
m.checkNotNullExpressionValue(requireContext2, "requireContext()");
|
|
String str = (String) this.k;
|
|
m.checkNotNullExpressionValue(str, "username");
|
|
c.a.d.m.a(requireContext2, str, R.string.copied_text);
|
|
((i) this.j).dismiss();
|
|
} else {
|
|
throw null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: ConnectedAccountActionsDialog.kt */
|
|
public static final class b {
|
|
public b(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
/* compiled from: ConnectedAccountActionsDialog.kt */
|
|
public static final /* synthetic */ class c extends k implements Function1<View, h> {
|
|
public static final c i = new c();
|
|
|
|
public c() {
|
|
super(1, h.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/ConnectedAccountActionsDialogBinding;", 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 h invoke(View view) {
|
|
View view2 = view;
|
|
m.checkNotNullParameter(view2, "p1");
|
|
int i2 = R.id.connected_account_actions_dialog_copy_username;
|
|
TextView textView = (TextView) view2.findViewById(R.id.connected_account_actions_dialog_copy_username);
|
|
if (textView != null) {
|
|
i2 = R.id.connected_account_actions_dialog_header;
|
|
TextView textView2 = (TextView) view2.findViewById(R.id.connected_account_actions_dialog_header);
|
|
if (textView2 != null) {
|
|
i2 = R.id.connected_account_actions_dialog_open_in_browser;
|
|
TextView textView3 = (TextView) view2.findViewById(R.id.connected_account_actions_dialog_open_in_browser);
|
|
if (textView3 != null) {
|
|
return new h((LinearLayout) view2, textView, textView2, textView3);
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
|
|
}
|
|
}
|
|
|
|
public i() {
|
|
super(R.layout.connected_account_actions_dialog);
|
|
}
|
|
|
|
public final h g() {
|
|
return (h) this.k.getValue((Fragment) this, i[0]);
|
|
}
|
|
|
|
@Override // com.discord.app.AppDialog
|
|
public void onViewBound(View view) {
|
|
m.checkNotNullParameter(view, "view");
|
|
super.onViewBound(view);
|
|
String string = getArgumentsOrDefault().getString("ARG_PROFILE_URL", "");
|
|
String string2 = getArgumentsOrDefault().getString("ARG_USERNAME", "");
|
|
int i2 = getArgumentsOrDefault().getInt("ARG_PLATFORM_IMAGE_RES", 0);
|
|
if (i2 != 0) {
|
|
TextView textView = g().f104c;
|
|
m.checkNotNullExpressionValue(textView, "binding.connectedAccountActionsDialogHeader");
|
|
ViewExtensions.setCompoundDrawableWithIntrinsicBounds$default(textView, i2, 0, 0, 0, 14, null);
|
|
}
|
|
TextView textView2 = g().f104c;
|
|
m.checkNotNullExpressionValue(textView2, "binding.connectedAccountActionsDialogHeader");
|
|
textView2.setText(string2);
|
|
TextView textView3 = g().d;
|
|
m.checkNotNullExpressionValue(textView3, "binding.connectedAccountActionsDialogOpenInBrowser");
|
|
textView3.setVisibility((string == null || string.length() == 0) ^ true ? 0 : 8);
|
|
g().d.setOnClickListener(new a(0, this, string));
|
|
g().b.setOnClickListener(new a(1, this, string2));
|
|
}
|
|
}
|