forked from Juby210/discord-jadx
176 lines
7.5 KiB
Java
176 lines
7.5 KiB
Java
package b.a.a.b;
|
|
|
|
import android.app.Dialog;
|
|
import android.content.DialogInterface;
|
|
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;
|
|
import b.a.i.d1;
|
|
import com.discord.R;
|
|
import com.discord.app.AppDialog;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
import com.google.android.material.button.MaterialButton;
|
|
import d0.z.d.k;
|
|
import d0.z.d.m;
|
|
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 b extends AppDialog {
|
|
public static final /* synthetic */ KProperty[] j = {b.d.b.a.a.b0(b.class, "binding", "getBinding()Lcom/discord/databinding/PremiumUpgradeYearlyDialogBinding;", 0)};
|
|
public static final C0007b k = new C0007b(null);
|
|
public Function0<Unit> l;
|
|
public Function0<Unit> m;
|
|
public Function0<Unit> n;
|
|
public String o;
|
|
public boolean p;
|
|
public final FragmentViewBindingDelegate q = 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) {
|
|
Function0<Unit> function0 = ((b) this.k).l;
|
|
if (function0 != null) {
|
|
function0.mo1invoke();
|
|
}
|
|
((b) this.k).dismiss();
|
|
} else if (i == 1) {
|
|
Function0<Unit> function02 = ((b) this.k).m;
|
|
if (function02 != null) {
|
|
function02.mo1invoke();
|
|
}
|
|
((b) this.k).dismiss();
|
|
} else {
|
|
throw null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: UpgradePremiumYearlyDialog.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) {
|
|
}
|
|
}
|
|
|
|
/* compiled from: UpgradePremiumYearlyDialog.kt */
|
|
public static final /* synthetic */ class c extends k implements Function1<View, d1> {
|
|
public static final c j = new c();
|
|
|
|
public c() {
|
|
super(1, d1.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/PremiumUpgradeYearlyDialogBinding;", 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 d1 invoke(View view) {
|
|
View view2 = view;
|
|
m.checkNotNullParameter(view2, "p1");
|
|
int i = R.id.premium_upsell_header;
|
|
ImageView imageView = (ImageView) view2.findViewById(R.id.premium_upsell_header);
|
|
if (imageView != null) {
|
|
i = R.id.premium_upsell_yearly_description;
|
|
TextView textView = (TextView) view2.findViewById(R.id.premium_upsell_yearly_description);
|
|
if (textView != null) {
|
|
i = R.id.premium_upsell_yearly_title;
|
|
TextView textView2 = (TextView) view2.findViewById(R.id.premium_upsell_yearly_title);
|
|
if (textView2 != null) {
|
|
i = R.id.purchase_premium_monthly;
|
|
TextView textView3 = (TextView) view2.findViewById(R.id.purchase_premium_monthly);
|
|
if (textView3 != null) {
|
|
i = R.id.purchase_premium_yearly;
|
|
MaterialButton materialButton = (MaterialButton) view2.findViewById(R.id.purchase_premium_yearly);
|
|
if (materialButton != null) {
|
|
return new d1((LinearLayout) view2, imageView, textView, textView2, textView3, materialButton);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i)));
|
|
}
|
|
}
|
|
|
|
/* compiled from: UpgradePremiumYearlyDialog.kt */
|
|
public static final class d implements DialogInterface.OnCancelListener {
|
|
public final /* synthetic */ b j;
|
|
|
|
public d(b bVar) {
|
|
this.j = bVar;
|
|
}
|
|
|
|
@Override // android.content.DialogInterface.OnCancelListener
|
|
public final void onCancel(DialogInterface dialogInterface) {
|
|
Function0<Unit> function0 = this.j.n;
|
|
if (function0 != null) {
|
|
function0.mo1invoke();
|
|
}
|
|
}
|
|
}
|
|
|
|
public b() {
|
|
super(R.layout.premium_upgrade_yearly_dialog);
|
|
}
|
|
|
|
public final d1 g() {
|
|
return (d1) this.q.getValue((Fragment) this, j[0]);
|
|
}
|
|
|
|
@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();
|
|
if (this.l == null || this.m == null) {
|
|
dismiss();
|
|
}
|
|
requireDialog().setCanceledOnTouchOutside(true);
|
|
requireDialog().setOnCancelListener(new d(this));
|
|
boolean z2 = getArgumentsOrDefault().getBoolean("ARG_IS_TIER_1");
|
|
CharSequence k2 = b.a.k.b.k(this, z2 ? R.string.premium_tier_1 : R.string.premium_tier_2, new Object[0], null, 4);
|
|
TextView textView = g().d;
|
|
m.checkNotNullExpressionValue(textView, "binding.premiumUpsellYearlyTitle");
|
|
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;
|
|
m.checkNotNullExpressionValue(textView2, "binding.premiumUpsellYearlyDescription");
|
|
b.a.k.b.n(textView2, R.string.premium_upsell_yearly_description, new Object[]{NumberFormat.getPercentInstance().format(Float.valueOf(0.16f))}, null, 4);
|
|
MaterialButton materialButton = g().f;
|
|
m.checkNotNullExpressionValue(materialButton, "binding.purchasePremiumYearly");
|
|
b.a.k.b.n(materialButton, R.string.premium_upsell_yearly_cta, new Object[]{this.o}, null, 4);
|
|
g().f96b.setImageResource(z2 ? R.drawable.img_premium_guild_subscription_purchase_header_tier_1 : R.drawable.img_premium_guild_subscription_purchase_header_tier_2);
|
|
TextView textView3 = g().e;
|
|
m.checkNotNullExpressionValue(textView3, "binding.purchasePremiumMonthly");
|
|
textView3.setVisibility(this.p ^ true ? 0 : 8);
|
|
g().e.setOnClickListener(new a(0, this));
|
|
g().f.setOnClickListener(new a(1, this));
|
|
}
|
|
}
|