discord-jadx/app/src/main/java/b/a/a/b/e.java

204 lines
9.2 KiB
Java

package b.a.a.b;
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 b.a.i.u;
import com.discord.R;
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.guildboost.WidgetGuildBoost;
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: GuildBoostUpsellDialog.kt */
/* loaded from: classes.dex */
public final class e extends AppDialog {
public static final /* synthetic */ KProperty[] j = {b.d.b.a.a.b0(e.class, "binding", "getBinding()Lcom/discord/databinding/GuildBoostUpsellDialogBinding;", 0)};
public static final b k = new b(null);
public final FragmentViewBindingDelegate l = FragmentViewBindingDelegateKt.viewBinding$default(this, c.j, null, 2, null);
/* compiled from: java-style lambda group */
/* loaded from: classes2.dex */
public static final class a implements View.OnClickListener {
public final /* synthetic */ int j;
public final /* synthetic */ long k;
public final /* synthetic */ Object l;
public final /* synthetic */ Object m;
public final /* synthetic */ Object n;
public final /* synthetic */ Object o;
public a(int i, long j, Object obj, Object obj2, Object obj3, Object obj4) {
this.j = i;
this.k = j;
this.l = obj;
this.m = obj2;
this.n = obj3;
this.o = obj4;
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
int i = this.j;
if (i == 0) {
AnalyticsTracker.INSTANCE.guildBoostPromotionOpened(this.k, new Traits.Location((String) this.n, Traits.Location.Section.PREMIUM_GUILD_UPSELL_MODAL, Traits.Location.Obj.BUTTON_CTA, (String) this.o, null, 16, null), (Long) this.m);
WidgetGuildBoost.Companion companion = WidgetGuildBoost.Companion;
Context requireContext = ((e) this.l).requireContext();
m.checkNotNullExpressionValue(requireContext, "requireContext()");
companion.create(requireContext, this.k);
((e) this.l).dismiss();
} else if (i == 1) {
AnalyticsTracker.INSTANCE.guildBoostPromotionClosed(this.k, new Traits.Location((String) this.n, Traits.Location.Section.PREMIUM_GUILD_UPSELL_MODAL, Traits.Location.Obj.BUTTON_CTA, (String) this.o, null, 16, null), (Long) this.m);
((e) this.l).dismiss();
} else if (i == 2) {
AnalyticsTracker.INSTANCE.guildBoostPromotionClosed(this.k, new Traits.Location((String) this.n, Traits.Location.Section.PREMIUM_GUILD_UPSELL_MODAL, Traits.Location.Obj.BUTTON_CTA, (String) this.o, null, 16, null), (Long) this.m);
((e) this.l).dismiss();
} else {
throw null;
}
}
}
/* compiled from: GuildBoostUpsellDialog.kt */
/* loaded from: classes.dex */
public static final class b {
public b(DefaultConstructorMarker defaultConstructorMarker) {
}
/* JADX WARN: Removed duplicated region for block: B:19:0x0041 */
/* JADX WARN: Removed duplicated region for block: B:21:0x004c */
/* JADX WARN: Removed duplicated region for block: B:28:0x0076 */
/* JADX WARN: Removed duplicated region for block: B:29:0x007c */
/* JADX WARN: Removed duplicated region for block: B:31:0x007f */
/* JADX WARN: Removed duplicated region for block: B:32:0x0085 */
/* JADX WARN: Removed duplicated region for block: B:34:0x0088 */
/*
Code decompiled incorrectly, please refer to instructions dump.
*/
public final void a(FragmentManager fragmentManager, long j, Long l, Integer num, Traits.Location location) {
String str;
Bundle I;
String page;
m.checkNotNullParameter(fragmentManager, "fragmentManager");
e eVar = new e();
String str2 = null;
if (num != null && num.intValue() == 1) {
str = Traits.Location.ObjType.TIER_1;
} else if (num != null && num.intValue() == 2) {
str = Traits.Location.ObjType.TIER_2;
} else if (num != null && num.intValue() == 3) {
str = Traits.Location.ObjType.TIER_3;
} else {
str = null;
I = b.d.b.a.a.I("extra_guild_id", j);
if (l != null) {
I.putLong("extra_channel_id", l.longValue());
}
if (str != null) {
I.putString("extra_object_type", str);
}
if (!(location == null || (page = location.getPage()) == null)) {
I.putString("extra_page", page);
}
eVar.setArguments(I);
eVar.show(fragmentManager, e.class.getSimpleName());
AnalyticsTracker analyticsTracker = AnalyticsTracker.INSTANCE;
String v = b.d.b.a.a.v("Premium Guild Upsell Modal - Tier ", str);
String page2 = location == null ? location.getPage() : null;
String str3 = location == null ? location.get_object() : null;
if (location != null) {
str2 = location.getSection();
}
analyticsTracker.openModal(v, new Traits.Location(page2, str2, str3, str, null, 16, null));
}
I = b.d.b.a.a.I("extra_guild_id", j);
if (l != null) {
}
if (str != null) {
}
if (location == null) {
I.putString("extra_page", page);
}
eVar.setArguments(I);
eVar.show(fragmentManager, e.class.getSimpleName());
AnalyticsTracker analyticsTracker2 = AnalyticsTracker.INSTANCE;
String v2 = b.d.b.a.a.v("Premium Guild Upsell Modal - Tier ", str);
if (location == null) {
}
if (location == null) {
}
if (location != null) {
}
analyticsTracker2.openModal(v2, new Traits.Location(page2, str2, str3, str, null, 16, null));
}
}
/* compiled from: GuildBoostUpsellDialog.kt */
/* loaded from: classes.dex */
public static final /* synthetic */ class c extends k implements Function1<View, u> {
public static final c j = new c();
public c() {
super(1, u.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/GuildBoostUpsellDialogBinding;", 0);
}
@Override // kotlin.jvm.functions.Function1
public u invoke(View view) {
View view2 = view;
m.checkNotNullParameter(view2, "p1");
int i = R.id.guild_boost_upsell_close;
ImageView imageView = (ImageView) view2.findViewById(R.id.guild_boost_upsell_close);
if (imageView != null) {
i = R.id.guild_boost_upsell_close_button;
TextView textView = (TextView) view2.findViewById(R.id.guild_boost_upsell_close_button);
if (textView != null) {
i = R.id.guild_boost_upsell_subscribe_button;
MaterialButton materialButton = (MaterialButton) view2.findViewById(R.id.guild_boost_upsell_subscribe_button);
if (materialButton != null) {
return new u((RelativeLayout) view2, imageView, textView, materialButton);
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i)));
}
}
public e() {
super(R.layout.guild_boost_upsell_dialog);
}
public final u g() {
return (u) this.l.getValue((Fragment) this, j[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", -1L);
Bundle arguments = getArguments();
String str = null;
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();
if (arguments3 != null) {
str = arguments3.getString("extra_page");
}
g().d.setOnClickListener(new a(0, j2, this, valueOf, str, string));
g().f204b.setOnClickListener(new a(1, j2, this, valueOf, str, string));
g().c.setOnClickListener(new a(2, j2, this, valueOf, str, string));
}
}