88 lines
4.3 KiB
Java
88 lines
4.3 KiB
Java
package com.discord.widgets.stickers;
|
|
|
|
import android.app.Dialog;
|
|
import android.content.Context;
|
|
import android.view.Window;
|
|
import android.widget.TextView;
|
|
import androidx.fragment.app.Fragment;
|
|
import androidx.fragment.app.FragmentManager;
|
|
import c.a.l.b;
|
|
import c.d.b.a.a;
|
|
import com.discord.app.AppDialog;
|
|
import com.discord.databinding.PremiumStickerUpsellDialogBinding;
|
|
import com.discord.utilities.analytics.AnalyticsTracker;
|
|
import com.discord.utilities.analytics.Traits;
|
|
import com.discord.utilities.billing.GooglePlaySku;
|
|
import com.discord.utilities.premium.PremiumUtils;
|
|
import com.discord.utilities.resources.StringResourceUtilsKt;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegate;
|
|
import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.reflect.KProperty;
|
|
/* compiled from: StickerPremiumUpsellDialog.kt */
|
|
public final class StickerPremiumUpsellDialog extends AppDialog {
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.V(StickerPremiumUpsellDialog.class, "binding", "getBinding()Lcom/discord/databinding/PremiumStickerUpsellDialogBinding;", 0)};
|
|
public static final Companion Companion = new Companion(null);
|
|
private final FragmentViewBindingDelegate binding$delegate = FragmentViewBindingDelegateKt.viewBinding$default(this, StickerPremiumUpsellDialog$binding$2.INSTANCE, null, 2, null);
|
|
|
|
/* compiled from: StickerPremiumUpsellDialog.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final void show(FragmentManager fragmentManager, Traits.Location location) {
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
|
m.checkNotNullParameter(location, "analyticsLocation");
|
|
AnalyticsTracker.INSTANCE.openModal("Stickers Nitro Upsell Modal", location);
|
|
new StickerPremiumUpsellDialog().show(fragmentManager, StickerPremiumUpsellDialog.class.getSimpleName());
|
|
}
|
|
}
|
|
|
|
public StickerPremiumUpsellDialog() {
|
|
super(2131558653);
|
|
}
|
|
|
|
private final PremiumStickerUpsellDialogBinding getBinding() {
|
|
return (PremiumStickerUpsellDialogBinding) this.binding$delegate.getValue((Fragment) this, $$delegatedProperties[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();
|
|
requireDialog().setCanceledOnTouchOutside(true);
|
|
String skuPrice = PremiumUtils.INSTANCE.getSkuPrice(GooglePlaySku.PREMIUM_TIER_2_MONTHLY.getSkuName());
|
|
if (skuPrice != null) {
|
|
TextView textView = getBinding().d;
|
|
m.checkNotNullExpressionValue(textView, "binding.premiumUpsellDescription");
|
|
b.n(textView, 2131892671, new Object[]{skuPrice}, null, 4);
|
|
} else {
|
|
TextView textView2 = getBinding().d;
|
|
m.checkNotNullExpressionValue(textView2, "binding.premiumUpsellDescription");
|
|
b.n(textView2, 2131892673, new Object[0], null, 4);
|
|
}
|
|
TextView textView3 = getBinding().e;
|
|
m.checkNotNullExpressionValue(textView3, "binding.premiumUpsellPerkBoosts");
|
|
Context requireContext = requireContext();
|
|
m.checkNotNullExpressionValue(requireContext, "requireContext()");
|
|
b.n(textView3, 2131892669, new Object[]{StringResourceUtilsKt.getI18nPluralString(requireContext, 2131755303, 2, 2)}, null, 4);
|
|
getBinding().f1621c.setOnClickListener(new StickerPremiumUpsellDialog$onViewBoundOrOnResume$1(this));
|
|
getBinding().f.setOnClickListener(new StickerPremiumUpsellDialog$onViewBoundOrOnResume$2(this));
|
|
getBinding().b.setOnClickListener(new StickerPremiumUpsellDialog$onViewBoundOrOnResume$3(this));
|
|
}
|
|
}
|