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

206 lines
8.9 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 */
public final class b extends AppDialog {
public static final /* synthetic */ KProperty[] j = {b.d.b.a.a.b0(b.class, "binding", "getBinding()Lcom/discord/databinding/GuildBoostUpsellDialogBinding;", 0)};
public static final C0007b k = new C0007b(null);
public final FragmentViewBindingDelegate l = FragmentViewBindingDelegateKt.viewBinding$default(this, c.j, null, 2, null);
/* compiled from: java-style lambda group */
public static final class a implements View.OnClickListener {
public final /* synthetic */ int j;
public final /* synthetic */ Object k;
public a(int i, Object obj) {
this.j = i;
this.k = obj;
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
int i = this.j;
if (i == 0) {
((b) this.k).dismiss();
} else if (i == 1) {
((b) this.k).dismiss();
} else {
throw null;
}
}
}
/* compiled from: GuildBoostUpsellDialog.kt */
/* renamed from: b.a.a.b.b$b reason: collision with other inner class name */
public static final class C0007b {
public C0007b(DefaultConstructorMarker defaultConstructorMarker) {
}
/* JADX WARNING: Removed duplicated region for block: B:17:0x0041 */
/* JADX WARNING: Removed duplicated region for block: B:19:0x004c */
/* JADX WARNING: Removed duplicated region for block: B:26:0x0076 */
/* JADX WARNING: Removed duplicated region for block: B:27:0x007c */
/* JADX WARNING: Removed duplicated region for block: B:29:0x007f */
/* JADX WARNING: Removed duplicated region for block: B:30:0x0085 */
/* JADX WARNING: Removed duplicated region for block: B:32:0x0088 */
public final void a(FragmentManager fragmentManager, long j, Long l, Integer num, Traits.Location location) {
String str;
Bundle I;
String page;
String str2;
m.checkNotNullParameter(fragmentManager, "fragmentManager");
b bVar = new b();
String str3 = null;
if (num != null && num.intValue() == 1) {
str2 = Traits.Location.ObjType.TIER_1;
} else if (num != null && num.intValue() == 2) {
str2 = Traits.Location.ObjType.TIER_2;
} else if (num != null && num.intValue() == 3) {
str2 = 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);
}
bVar.setArguments(I);
bVar.show(fragmentManager, b.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 str4 = location == null ? location.get_object() : null;
if (location != null) {
str3 = location.getSection();
}
analyticsTracker.openModal(v, new Traits.Location(page2, str3, str4, str, null, 16, null));
}
str = str2;
I = b.d.b.a.a.I("extra_guild_id", j);
if (l != null) {
}
if (str != null) {
}
I.putString("extra_page", page);
bVar.setArguments(I);
bVar.show(fragmentManager, b.class.getSimpleName());
AnalyticsTracker analyticsTracker = AnalyticsTracker.INSTANCE;
String v = b.d.b.a.a.v("Premium Guild Upsell Modal - Tier ", str);
if (location == null) {
}
if (location == null) {
}
if (location != null) {
}
analyticsTracker.openModal(v, new Traits.Location(page2, str3, str4, str, null, 16, null));
}
}
/* compiled from: GuildBoostUpsellDialog.kt */
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);
}
/* 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 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)));
}
}
/* compiled from: GuildBoostUpsellDialog.kt */
public static final class d implements View.OnClickListener {
public final /* synthetic */ b j;
public final /* synthetic */ long k;
public final /* synthetic */ Long l;
public final /* synthetic */ String m;
public final /* synthetic */ String n;
public d(b bVar, long j, Long l, String str, String str2) {
this.j = bVar;
this.k = j;
this.l = l;
this.m = str;
this.n = str2;
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
AnalyticsTracker.INSTANCE.guildBoostPromotionOpened(this.k, new Traits.Location(this.m, Traits.Location.Section.PREMIUM_GUILD_UPSELL_MODAL, Traits.Location.Obj.BUTTON_CTA, this.n, null, 16, null), this.l);
WidgetGuildBoost.Companion companion = WidgetGuildBoost.Companion;
Context requireContext = this.j.requireContext();
m.checkNotNullExpressionValue(requireContext, "requireContext()");
companion.create(requireContext, this.k);
this.j.dismiss();
}
}
public b() {
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", -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().f203b.setOnClickListener(new a(0, this));
g().c.setOnClickListener(new a(1, this));
}
}