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

155 lines
6.8 KiB
Java
Raw Normal View History

2021-12-21 23:37:30 +00:00
package b.a.a.b;
2021-08-04 22:02:59 +00:00
import android.app.Dialog;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
2021-12-21 23:37:30 +00:00
import b.a.i.d1;
import com.discord.R;
2021-08-04 22:02:59 +00:00
import com.discord.app.AppDialog;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
import com.google.android.material.button.MaterialButton;
2021-11-08 18:25:28 +00:00
import d0.z.d.k;
import d0.z.d.m;
2021-08-04 22:02:59 +00:00
import java.text.NumberFormat;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.reflect.KProperty;
/* compiled from: UpgradePremiumYearlyDialog.kt */
public final class e extends AppDialog {
2021-12-21 23:37:30 +00:00
public static final /* synthetic */ KProperty[] j = {b.d.b.a.a.b0(e.class, "binding", "getBinding()Lcom/discord/databinding/PremiumUpgradeYearlyDialogBinding;", 0)};
2021-12-17 22:03:14 +00:00
public static final b k = new b(null);
2021-08-04 22:02:59 +00:00
public Function0<Unit> l;
2021-12-17 22:03:14 +00:00
public Function0<Unit> m;
public String n;
public boolean o;
public final FragmentViewBindingDelegate p = FragmentViewBindingDelegateKt.viewBinding$default(this, c.j, null, 2, null);
2021-08-04 22:02:59 +00:00
/* compiled from: java-style lambda group */
public static final class a implements View.OnClickListener {
2021-12-17 22:03:14 +00:00
public final /* synthetic */ int j;
public final /* synthetic */ Object k;
2021-08-04 22:02:59 +00:00
public a(int i, Object obj) {
2021-12-17 22:03:14 +00:00
this.j = i;
this.k = obj;
2021-08-04 22:02:59 +00:00
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
2021-12-17 22:03:14 +00:00
int i = this.j;
2021-08-04 22:02:59 +00:00
if (i == 0) {
2021-12-17 22:03:14 +00:00
Function0<Unit> function0 = ((e) this.k).l;
2021-08-04 22:02:59 +00:00
if (function0 != null) {
2021-11-08 18:25:28 +00:00
function0.mo1invoke();
2021-08-04 22:02:59 +00:00
}
2021-12-17 22:03:14 +00:00
((e) this.k).dismiss();
2021-08-04 22:02:59 +00:00
} else if (i == 1) {
2021-12-17 22:03:14 +00:00
Function0<Unit> function02 = ((e) this.k).m;
2021-08-04 22:02:59 +00:00
if (function02 != null) {
2021-11-08 18:25:28 +00:00
function02.mo1invoke();
2021-08-04 22:02:59 +00:00
}
2021-12-17 22:03:14 +00:00
((e) this.k).dismiss();
2021-08-04 22:02:59 +00:00
} else {
throw null;
}
}
}
/* compiled from: UpgradePremiumYearlyDialog.kt */
public static final class b {
public b(DefaultConstructorMarker defaultConstructorMarker) {
}
}
/* compiled from: UpgradePremiumYearlyDialog.kt */
2021-11-30 23:47:08 +00:00
public static final /* synthetic */ class c extends k implements Function1<View, d1> {
2021-12-17 22:03:14 +00:00
public static final c j = new c();
2021-08-04 22:02:59 +00:00
public c() {
2021-11-30 23:47:08 +00:00
super(1, d1.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/PremiumUpgradeYearlyDialogBinding;", 0);
2021-08-04 22:02:59 +00:00
}
/* 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
2021-11-30 23:47:08 +00:00
public d1 invoke(View view) {
2021-08-04 22:02:59 +00:00
View view2 = view;
m.checkNotNullParameter(view2, "p1");
2021-12-17 22:03:14 +00:00
int i = R.id.premium_upsell_header;
ImageView imageView = (ImageView) view2.findViewById(R.id.premium_upsell_header);
2021-08-04 22:02:59 +00:00
if (imageView != null) {
2021-12-17 22:03:14 +00:00
i = R.id.premium_upsell_yearly_description;
TextView textView = (TextView) view2.findViewById(R.id.premium_upsell_yearly_description);
2021-08-04 22:02:59 +00:00
if (textView != null) {
2021-12-17 22:03:14 +00:00
i = R.id.premium_upsell_yearly_title;
TextView textView2 = (TextView) view2.findViewById(R.id.premium_upsell_yearly_title);
2021-08-04 22:02:59 +00:00
if (textView2 != null) {
2021-12-17 22:03:14 +00:00
i = R.id.purchase_premium_monthly;
TextView textView3 = (TextView) view2.findViewById(R.id.purchase_premium_monthly);
2021-08-04 22:02:59 +00:00
if (textView3 != null) {
2021-12-17 22:03:14 +00:00
i = R.id.purchase_premium_yearly;
MaterialButton materialButton = (MaterialButton) view2.findViewById(R.id.purchase_premium_yearly);
2021-08-04 22:02:59 +00:00
if (materialButton != null) {
2021-11-30 23:47:08 +00:00
return new d1((LinearLayout) view2, imageView, textView, textView2, textView3, materialButton);
2021-08-04 22:02:59 +00:00
}
}
}
}
}
2021-12-17 22:03:14 +00:00
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i)));
2021-08-04 22:02:59 +00:00
}
}
public e() {
super(R.layout.premium_upgrade_yearly_dialog);
2021-08-04 22:02:59 +00:00
}
2021-11-30 23:47:08 +00:00
public final d1 g() {
2021-12-17 22:03:14 +00:00
return (d1) this.p.getValue((Fragment) this, j[0]);
2021-08-04 22:02:59 +00:00
}
@Override // com.discord.app.AppDialog, androidx.fragment.app.DialogFragment, androidx.fragment.app.Fragment
public void onStart() {
super.onStart();
Dialog requireDialog = requireDialog();
m.checkNotNullExpressionValue(requireDialog, "requireDialog()");
Window window = requireDialog.getWindow();
if (window != null) {
window.setLayout(-1, -2);
}
}
@Override // com.discord.app.AppDialog
public void onViewBoundOrOnResume() {
super.onViewBoundOrOnResume();
2021-12-17 22:03:14 +00:00
if (this.l == null || this.m == null) {
2021-08-04 22:02:59 +00:00
dismiss();
}
requireDialog().setCanceledOnTouchOutside(true);
boolean z2 = getArgumentsOrDefault().getBoolean("ARG_IS_TIER_1");
2021-12-21 23:37:30 +00:00
CharSequence k2 = b.a.k.b.k(this, z2 ? R.string.premium_tier_1 : R.string.premium_tier_2, new Object[0], null, 4);
2021-08-04 22:02:59 +00:00
TextView textView = g().d;
m.checkNotNullExpressionValue(textView, "binding.premiumUpsellYearlyTitle");
2021-12-21 23:37:30 +00:00
b.a.k.b.n(textView, R.string.premium_upsell_yearly_title, new Object[]{NumberFormat.getPercentInstance().format(Float.valueOf(0.16f)), k2}, null, 4);
TextView textView2 = g().c;
2021-08-04 22:02:59 +00:00
m.checkNotNullExpressionValue(textView2, "binding.premiumUpsellYearlyDescription");
2021-12-21 23:37:30 +00:00
b.a.k.b.n(textView2, R.string.premium_upsell_yearly_description, new Object[]{NumberFormat.getPercentInstance().format(Float.valueOf(0.16f))}, null, 4);
2021-08-04 22:02:59 +00:00
MaterialButton materialButton = g().f;
m.checkNotNullExpressionValue(materialButton, "binding.purchasePremiumYearly");
2021-12-21 23:37:30 +00:00
b.a.k.b.n(materialButton, R.string.premium_upsell_yearly_cta, new Object[]{this.n}, null, 4);
2022-02-01 19:18:35 +00:00
g().f96b.setImageResource(z2 ? R.drawable.img_premium_guild_subscription_purchase_header_tier_1 : R.drawable.img_premium_guild_subscription_purchase_header_tier_2);
2021-08-04 22:02:59 +00:00
TextView textView3 = g().e;
m.checkNotNullExpressionValue(textView3, "binding.purchasePremiumMonthly");
2021-12-17 22:03:14 +00:00
textView3.setVisibility(this.o ^ true ? 0 : 8);
2021-08-04 22:02:59 +00:00
g().e.setOnClickListener(new a(0, this));
g().f.setOnClickListener(new a(1, this));
}
}