2021-08-03 07:33:18 +00:00
|
|
|
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;
|
2021-08-11 06:37:47 +00:00
|
|
|
import c.a.k.b;
|
2021-08-03 07:33:18 +00:00
|
|
|
import c.d.b.a.a;
|
2021-08-09 22:51:56 +00:00
|
|
|
import com.discord.R;
|
2021-08-03 07:33:18 +00:00
|
|
|
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;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.z.d.m;
|
2021-08-03 07:33:18 +00:00
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import kotlin.reflect.KProperty;
|
|
|
|
/* compiled from: StickerPremiumUpsellDialog.kt */
|
|
|
|
public final class StickerPremiumUpsellDialog extends AppDialog {
|
2021-11-05 06:48:17 +00:00
|
|
|
public static final /* synthetic */ KProperty[] $$delegatedProperties = {a.b0(StickerPremiumUpsellDialog.class, "binding", "getBinding()Lcom/discord/databinding/PremiumStickerUpsellDialogBinding;", 0)};
|
2021-08-03 07:33:18 +00:00
|
|
|
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");
|
2021-08-09 22:51:56 +00:00
|
|
|
AnalyticsTracker.INSTANCE.openModal(Traits.Location.Section.STICKER_PREMIUM_TIER_2_UPSELL_MODAL, location);
|
2021-08-03 07:33:18 +00:00
|
|
|
new StickerPremiumUpsellDialog().show(fragmentManager, StickerPremiumUpsellDialog.class.getSimpleName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public StickerPremiumUpsellDialog() {
|
2021-08-09 22:51:56 +00:00
|
|
|
super(R.layout.premium_sticker_upsell_dialog);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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");
|
2021-08-09 22:51:56 +00:00
|
|
|
b.n(textView, R.string.premium_upsell_feature_pretext, new Object[]{skuPrice}, null, 4);
|
2021-08-03 07:33:18 +00:00
|
|
|
} else {
|
|
|
|
TextView textView2 = getBinding().d;
|
|
|
|
m.checkNotNullExpressionValue(textView2, "binding.premiumUpsellDescription");
|
2021-08-09 22:51:56 +00:00
|
|
|
b.n(textView2, R.string.premium_upsell_feature_pretext_without_price, new Object[0], null, 4);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
TextView textView3 = getBinding().e;
|
|
|
|
m.checkNotNullExpressionValue(textView3, "binding.premiumUpsellPerkBoosts");
|
|
|
|
Context requireContext = requireContext();
|
|
|
|
m.checkNotNullExpressionValue(requireContext, "requireContext()");
|
2021-08-09 22:51:56 +00:00
|
|
|
b.n(textView3, 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);
|
2021-12-02 18:53:44 +00:00
|
|
|
getBinding().f1701c.setOnClickListener(new StickerPremiumUpsellDialog$onViewBoundOrOnResume$1(this));
|
2021-08-03 07:33:18 +00:00
|
|
|
getBinding().f.setOnClickListener(new StickerPremiumUpsellDialog$onViewBoundOrOnResume$2(this));
|
|
|
|
getBinding().b.setOnClickListener(new StickerPremiumUpsellDialog$onViewBoundOrOnResume$3(this));
|
|
|
|
}
|
|
|
|
}
|