2021-08-10 21:50:53 +00:00
|
|
|
package c.a.a.e;
|
2021-08-04 22:02:59 +00:00
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.view.View;
|
|
|
|
import android.widget.ImageView;
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import androidx.core.content.ContextCompat;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import androidx.fragment.app.FragmentManager;
|
2021-11-30 23:47:08 +00:00
|
|
|
import c.a.i.w0;
|
2021-08-09 22:50:01 +00:00
|
|
|
import com.discord.R;
|
2021-08-04 22:02:59 +00:00
|
|
|
import com.discord.app.AppDialog;
|
|
|
|
import com.discord.utilities.drawable.DrawableCompat;
|
|
|
|
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 kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import kotlin.reflect.KProperty;
|
|
|
|
/* compiled from: PremiumActivatedDialog.kt */
|
|
|
|
public final class f extends AppDialog {
|
2021-12-17 22:03:14 +00:00
|
|
|
public static final /* synthetic */ KProperty[] j = {c.d.b.a.a.b0(f.class, "binding", "getBinding()Lcom/discord/databinding/PremiumActivatedDialogBinding;", 0)};
|
|
|
|
public static final a k = new a(null);
|
|
|
|
public Function0<Unit> l;
|
|
|
|
public final FragmentViewBindingDelegate m = FragmentViewBindingDelegateKt.viewBinding$default(this, b.j, null, 2, null);
|
2021-08-04 22:02:59 +00:00
|
|
|
|
|
|
|
/* compiled from: PremiumActivatedDialog.kt */
|
|
|
|
public static final class a {
|
|
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void a(FragmentManager fragmentManager, Function0<Unit> function0, boolean z2) {
|
|
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
|
|
|
m.checkNotNullParameter(function0, "onDismiss");
|
|
|
|
f fVar = new f();
|
2021-12-17 22:03:14 +00:00
|
|
|
fVar.l = function0;
|
2021-08-04 22:02:59 +00:00
|
|
|
Bundle bundle = new Bundle();
|
|
|
|
bundle.putBoolean("ARG_IS_TIER_1", z2);
|
|
|
|
fVar.setArguments(bundle);
|
|
|
|
fVar.show(fragmentManager, f.class.getSimpleName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: PremiumActivatedDialog.kt */
|
2021-11-30 23:47:08 +00:00
|
|
|
public static final /* synthetic */ class b extends k implements Function1<View, w0> {
|
2021-12-17 22:03:14 +00:00
|
|
|
public static final b j = new b();
|
2021-08-04 22:02:59 +00:00
|
|
|
|
|
|
|
public b() {
|
2021-11-30 23:47:08 +00:00
|
|
|
super(1, w0.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/PremiumActivatedDialogBinding;", 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 w0 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_activated_confirm;
|
2021-08-09 22:50:01 +00:00
|
|
|
MaterialButton materialButton = (MaterialButton) view2.findViewById(R.id.premium_activated_confirm);
|
2021-08-04 22:02:59 +00:00
|
|
|
if (materialButton != null) {
|
2021-12-17 22:03:14 +00:00
|
|
|
i = R.id.premium_activated_description;
|
2021-08-09 22:50:01 +00:00
|
|
|
TextView textView = (TextView) view2.findViewById(R.id.premium_activated_description);
|
2021-08-04 22:02:59 +00:00
|
|
|
if (textView != null) {
|
2021-12-17 22:03:14 +00:00
|
|
|
i = R.id.premium_activated_header_background;
|
2021-08-09 22:50:01 +00:00
|
|
|
ImageView imageView = (ImageView) view2.findViewById(R.id.premium_activated_header_background);
|
2021-08-04 22:02:59 +00:00
|
|
|
if (imageView != null) {
|
2021-12-17 22:03:14 +00:00
|
|
|
i = R.id.premium_activated_logo;
|
2021-08-09 22:50:01 +00:00
|
|
|
ImageView imageView2 = (ImageView) view2.findViewById(R.id.premium_activated_logo);
|
2021-08-04 22:02:59 +00:00
|
|
|
if (imageView2 != null) {
|
2021-12-17 22:03:14 +00:00
|
|
|
i = R.id.premium_activated_title;
|
2021-08-09 22:50:01 +00:00
|
|
|
ImageView imageView3 = (ImageView) view2.findViewById(R.id.premium_activated_title);
|
2021-08-04 22:02:59 +00:00
|
|
|
if (imageView3 != null) {
|
2021-12-17 22:03:14 +00:00
|
|
|
i = R.id.premium_activated_wumpus;
|
2021-08-09 22:50:01 +00:00
|
|
|
ImageView imageView4 = (ImageView) view2.findViewById(R.id.premium_activated_wumpus);
|
2021-08-04 22:02:59 +00:00
|
|
|
if (imageView4 != null) {
|
2021-11-30 23:47:08 +00:00
|
|
|
return new w0((LinearLayout) view2, materialButton, textView, imageView, imageView2, imageView3, imageView4);
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: PremiumActivatedDialog.kt */
|
|
|
|
public static final class c implements View.OnClickListener {
|
2021-12-17 22:03:14 +00:00
|
|
|
public final /* synthetic */ f j;
|
2021-08-04 22:02:59 +00:00
|
|
|
|
|
|
|
public c(f fVar) {
|
2021-12-17 22:03:14 +00:00
|
|
|
this.j = fVar;
|
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
|
|
|
Function0<Unit> function0 = this.j.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
|
|
|
this.j.dismiss();
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public f() {
|
2021-08-09 22:50:01 +00:00
|
|
|
super(R.layout.premium_activated_dialog);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
|
2021-11-30 23:47:08 +00:00
|
|
|
public final w0 g() {
|
2021-12-17 22:03:14 +00:00
|
|
|
return (w0) this.m.getValue((Fragment) this, j[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.app.AppDialog, androidx.fragment.app.Fragment
|
|
|
|
public void onResume() {
|
2021-12-17 22:03:14 +00:00
|
|
|
int i;
|
2021-08-04 22:02:59 +00:00
|
|
|
super.onResume();
|
2021-12-17 22:03:14 +00:00
|
|
|
if (this.l == null) {
|
2021-08-04 22:02:59 +00:00
|
|
|
dismiss();
|
|
|
|
}
|
|
|
|
boolean z2 = getArgumentsOrDefault().getBoolean("ARG_IS_TIER_1");
|
2021-12-17 22:03:14 +00:00
|
|
|
int i2 = z2 ? R.drawable.bg_premium_classic_subscription_header : R.drawable.bg_premium_subscription_header;
|
|
|
|
int i3 = z2 ? R.drawable.img_logo_nitro_classic : R.drawable.img_logo_discord_nitro;
|
|
|
|
int i4 = z2 ? R.drawable.img_wumpus_riding_wheel : R.drawable.img_wumpus_jetpack;
|
2021-08-04 22:02:59 +00:00
|
|
|
if (z2) {
|
|
|
|
Context requireContext = requireContext();
|
|
|
|
m.checkNotNullExpressionValue(requireContext, "requireContext()");
|
2021-12-17 22:03:14 +00:00
|
|
|
i = DrawableCompat.getThemedDrawableRes$default(requireContext, (int) R.attr.img_premium_activated_tier_1, 0, 2, (Object) null);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
|
|
|
Context requireContext2 = requireContext();
|
|
|
|
m.checkNotNullExpressionValue(requireContext2, "requireContext()");
|
2021-12-17 22:03:14 +00:00
|
|
|
i = DrawableCompat.getThemedDrawableRes$default(requireContext2, (int) R.attr.img_premium_activated_tier_2, 0, 2, (Object) null);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2021-12-17 22:03:14 +00:00
|
|
|
int i5 = z2 ? R.string.billing_switch_plan_confirm_tier_1 : R.string.billing_switch_plan_confirm_tier_2;
|
|
|
|
g().d.setBackgroundResource(i2);
|
|
|
|
g().e.setImageDrawable(ContextCompat.getDrawable(requireContext(), i3));
|
|
|
|
g().g.setImageDrawable(ContextCompat.getDrawable(requireContext(), i4));
|
2021-08-04 22:02:59 +00:00
|
|
|
ImageView imageView = g().g;
|
|
|
|
m.checkNotNullExpressionValue(imageView, "binding.premiumActivatedWumpus");
|
|
|
|
imageView.setScaleX(z2 ? 1.0f : -1.0f);
|
2021-12-17 22:03:14 +00:00
|
|
|
g().f.setImageDrawable(ContextCompat.getDrawable(requireContext(), i));
|
|
|
|
TextView textView = g().f180c;
|
2021-08-04 22:02:59 +00:00
|
|
|
m.checkNotNullExpressionValue(textView, "binding.premiumActivatedDescription");
|
2021-12-17 22:03:14 +00:00
|
|
|
textView.setText(getString(i5));
|
2021-08-04 22:02:59 +00:00
|
|
|
requireDialog().setCanceledOnTouchOutside(true);
|
|
|
|
g().b.setOnClickListener(new c(this));
|
|
|
|
}
|
|
|
|
}
|