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

207 lines
9.0 KiB
Java

package c.a.a.d;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import c.a.i.y0;
import com.discord.app.AppDialog;
import com.discord.utilities.analytics.AnalyticsTracker;
import com.discord.utilities.analytics.Traits;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
import com.discord.widgets.servers.premiumguild.WidgetPremiumGuildSubscription;
import com.google.android.material.button.MaterialButton;
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: PremiumGuildSubscriptionUpsellDialog.kt */
public final class a extends AppDialog {
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.V(a.class, "binding", "getBinding()Lcom/discord/databinding/PremiumGuildSubscriptionUpsellDialogBinding;", 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.d.a$a reason: collision with other inner class name */
public static final class View$OnClickListenerC0011a implements View.OnClickListener {
public final /* synthetic */ int i;
public final /* synthetic */ Object j;
public View$OnClickListenerC0011a(int i, Object obj) {
this.i = i;
this.j = obj;
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
int i = this.i;
if (i == 0) {
((a) this.j).dismiss();
} else if (i == 1) {
((a) this.j).dismiss();
} else {
throw null;
}
}
}
/* compiled from: PremiumGuildSubscriptionUpsellDialog.kt */
public static final class b {
public b(DefaultConstructorMarker defaultConstructorMarker) {
}
/* JADX WARNING: Removed duplicated region for block: B:17:0x0045 */
/* JADX WARNING: Removed duplicated region for block: B:19:0x0050 */
/* JADX WARNING: Removed duplicated region for block: B:26:0x007a */
/* JADX WARNING: Removed duplicated region for block: B:27:0x0080 */
/* JADX WARNING: Removed duplicated region for block: B:29:0x0083 */
/* JADX WARNING: Removed duplicated region for block: B:30:0x0089 */
/* JADX WARNING: Removed duplicated region for block: B:32:0x008c */
public final void a(FragmentManager fragmentManager, long j, Long l, Integer num, Traits.Location location) {
String str;
Bundle bundle;
String page;
String str2;
m.checkNotNullParameter(fragmentManager, "fragmentManager");
a aVar = new a();
String str3 = null;
if (num != null && num.intValue() == 1) {
str2 = "tier_1";
} else if (num != null && num.intValue() == 2) {
str2 = "tier_2";
} else if (num != null && num.intValue() == 3) {
str2 = "tier_3";
} else {
str = null;
bundle = new Bundle();
bundle.putLong("extra_guild_id", j);
if (l != null) {
bundle.putLong("extra_channel_id", l.longValue());
}
if (str != null) {
bundle.putString("extra_object_type", str);
}
if (!(location == null || (page = location.getPage()) == null)) {
bundle.putString("extra_page", page);
}
aVar.setArguments(bundle);
aVar.show(fragmentManager, a.class.getSimpleName());
AnalyticsTracker analyticsTracker = AnalyticsTracker.INSTANCE;
String s2 = c.d.b.a.a.s("Premium Guild Upsell Modal - Tier ", str);
String page2 = location == null ? location.getPage() : null;
String str4 = location == null ? location.get_object() : null;
if (location != null) {
str3 = location.getSection();
}
analyticsTracker.openModal(s2, new Traits.Location(page2, str3, str4, str, null, 16, null));
}
str = str2;
bundle = new Bundle();
bundle.putLong("extra_guild_id", j);
if (l != null) {
}
if (str != null) {
}
bundle.putString("extra_page", page);
aVar.setArguments(bundle);
aVar.show(fragmentManager, a.class.getSimpleName());
AnalyticsTracker analyticsTracker = AnalyticsTracker.INSTANCE;
String s2 = c.d.b.a.a.s("Premium Guild Upsell Modal - Tier ", str);
if (location == null) {
}
if (location == null) {
}
if (location != null) {
}
analyticsTracker.openModal(s2, new Traits.Location(page2, str3, str4, str, null, 16, null));
}
}
/* compiled from: PremiumGuildSubscriptionUpsellDialog.kt */
public static final /* synthetic */ class c extends k implements Function1<View, y0> {
public static final c i = new c();
public c() {
super(1, y0.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/PremiumGuildSubscriptionUpsellDialogBinding;", 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 y0 invoke(View view) {
View view2 = view;
m.checkNotNullParameter(view2, "p1");
int i2 = 2131364399;
ImageView imageView = (ImageView) view2.findViewById(2131364399);
if (imageView != null) {
i2 = 2131364400;
TextView textView = (TextView) view2.findViewById(2131364400);
if (textView != null) {
i2 = 2131364401;
MaterialButton materialButton = (MaterialButton) view2.findViewById(2131364401);
if (materialButton != null) {
return new y0((RelativeLayout) view2, imageView, textView, materialButton);
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
}
}
/* compiled from: PremiumGuildSubscriptionUpsellDialog.kt */
public static final class d implements View.OnClickListener {
public final /* synthetic */ a i;
public final /* synthetic */ long j;
public final /* synthetic */ Long k;
public final /* synthetic */ String l;
public final /* synthetic */ String m;
public d(a aVar, long j, Long l, String str, String str2) {
this.i = aVar;
this.j = j;
this.k = l;
this.l = str;
this.m = str2;
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
AnalyticsTracker.INSTANCE.premiumGuildPromotionOpened(this.j, new Traits.Location(this.l, "Premium Guild Upsell Modal", "Button CTA", this.m, null, 16, null), this.k);
WidgetPremiumGuildSubscription.Companion companion = WidgetPremiumGuildSubscription.Companion;
Context requireContext = this.i.requireContext();
m.checkNotNullExpressionValue(requireContext, "requireContext()");
companion.create(requireContext, this.j);
this.i.dismiss();
}
}
public a() {
super(2131558646);
}
public final y0 g() {
return (y0) this.k.getValue((Fragment) this, i[0]);
}
@Override // com.discord.app.AppDialog
public void onViewBound(View view) {
m.checkNotNullParameter(view, "view");
super.onViewBound(view);
long j2 = getArgumentsOrDefault().getLong("extra_guild_id", -1);
Bundle arguments = getArguments();
Long valueOf = arguments != null ? Long.valueOf(arguments.getLong("extra_channel_id")) : null;
Bundle arguments2 = getArguments();
String string = arguments2 != null ? arguments2.getString("extra_object_type") : null;
Bundle arguments3 = getArguments();
g().d.setOnClickListener(new d(this, j2, valueOf, arguments3 != null ? arguments3.getString("extra_page") : null, string));
g().b.setOnClickListener(new View$OnClickListenerC0011a(0, this));
g().f187c.setOnClickListener(new View$OnClickListenerC0011a(1, this));
}
}