156 lines
6.6 KiB
Java
156 lines
6.6 KiB
Java
package c.a.a.e;
|
|
|
|
import android.app.Dialog;
|
|
import android.content.Context;
|
|
import android.view.View;
|
|
import android.view.Window;
|
|
import android.widget.ImageView;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import androidx.fragment.app.Fragment;
|
|
import c.a.i.c1;
|
|
import com.discord.R;
|
|
import com.discord.app.AppDialog;
|
|
import com.discord.utilities.resources.StringResourceUtilsKt;
|
|
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 kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.reflect.KProperty;
|
|
/* compiled from: UpgradePremiumGuildDialog.kt */
|
|
public final class c extends AppDialog {
|
|
public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.b0(c.class, "binding", "getBinding()Lcom/discord/databinding/PremiumGuildUpgradeDialogBinding;", 0)};
|
|
public static final b j = new b(null);
|
|
public Function0<Unit> k;
|
|
public Function0<Unit> l;
|
|
public String m;
|
|
public boolean n;
|
|
public final FragmentViewBindingDelegate o = FragmentViewBindingDelegateKt.viewBinding$default(this, C0014c.i, null, 2, null);
|
|
|
|
/* compiled from: java-style lambda group */
|
|
public static final class a implements View.OnClickListener {
|
|
public final /* synthetic */ int i;
|
|
public final /* synthetic */ Object j;
|
|
|
|
public a(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) {
|
|
Function0<Unit> function0 = ((c) this.j).k;
|
|
if (function0 != null) {
|
|
function0.mo1invoke();
|
|
}
|
|
((c) this.j).dismiss();
|
|
} else if (i == 1) {
|
|
Function0<Unit> function02 = ((c) this.j).l;
|
|
if (function02 != null) {
|
|
function02.mo1invoke();
|
|
}
|
|
((c) this.j).dismiss();
|
|
} else if (i == 2) {
|
|
((c) this.j).dismiss();
|
|
} else {
|
|
throw null;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: UpgradePremiumGuildDialog.kt */
|
|
public static final class b {
|
|
public b(DefaultConstructorMarker defaultConstructorMarker) {
|
|
}
|
|
}
|
|
|
|
/* compiled from: UpgradePremiumGuildDialog.kt */
|
|
/* renamed from: c.a.a.e.c$c reason: collision with other inner class name */
|
|
public static final /* synthetic */ class C0014c extends k implements Function1<View, c1> {
|
|
public static final C0014c i = new C0014c();
|
|
|
|
public C0014c() {
|
|
super(1, c1.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/PremiumGuildUpgradeDialogBinding;", 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 c1 invoke(View view) {
|
|
View view2 = view;
|
|
m.checkNotNullParameter(view2, "p1");
|
|
int i2 = R.id.continue_button;
|
|
TextView textView = (TextView) view2.findViewById(R.id.continue_button);
|
|
if (textView != null) {
|
|
i2 = R.id.premium_upsell_close;
|
|
ImageView imageView = (ImageView) view2.findViewById(R.id.premium_upsell_close);
|
|
if (imageView != null) {
|
|
i2 = R.id.premium_upsell_description;
|
|
TextView textView2 = (TextView) view2.findViewById(R.id.premium_upsell_description);
|
|
if (textView2 != null) {
|
|
i2 = R.id.premium_upsell_server_perk;
|
|
TextView textView3 = (TextView) view2.findViewById(R.id.premium_upsell_server_perk);
|
|
if (textView3 != null) {
|
|
i2 = R.id.upgrade_button;
|
|
MaterialButton materialButton = (MaterialButton) view2.findViewById(R.id.upgrade_button);
|
|
if (materialButton != null) {
|
|
return new c1((RelativeLayout) view2, textView, imageView, textView2, textView3, materialButton);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2)));
|
|
}
|
|
}
|
|
|
|
public c() {
|
|
super(R.layout.premium_guild_upgrade_dialog);
|
|
}
|
|
|
|
public final c1 g() {
|
|
return (c1) this.o.getValue((Fragment) this, i[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.k == null || this.l == null) {
|
|
dismiss();
|
|
}
|
|
requireDialog().setCanceledOnTouchOutside(true);
|
|
TextView textView = g().d;
|
|
m.checkNotNullExpressionValue(textView, "binding.premiumUpsellDescription");
|
|
c.a.k.b.n(textView, R.string.premium_upsell_feature_pretext, new Object[]{this.m}, null, 4);
|
|
TextView textView2 = g().e;
|
|
m.checkNotNullExpressionValue(textView2, "binding.premiumUpsellServerPerk");
|
|
Context requireContext = requireContext();
|
|
m.checkNotNullExpressionValue(requireContext, "requireContext()");
|
|
c.a.k.b.n(textView2, R.string.premium_upsell_feature_free_guild_subscription, new Object[]{StringResourceUtilsKt.getI18nPluralString(requireContext, R.plurals.premium_upsell_feature_free_guild_subscription_numFreeGuildSubscriptions, 2, 2)}, null, 4);
|
|
TextView textView3 = g().b;
|
|
m.checkNotNullExpressionValue(textView3, "binding.continueButton");
|
|
textView3.setVisibility(this.n ^ true ? 0 : 8);
|
|
g().b.setOnClickListener(new a(0, this));
|
|
g().f.setOnClickListener(new a(1, this));
|
|
g().f75c.setOnClickListener(new a(2, this));
|
|
}
|
|
}
|