383 lines
12 KiB
Smali
383 lines
12 KiB
Smali
.class public final Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;
|
|
.super Landroid/widget/FrameLayout;
|
|
.source "PremiumGuildSubscriptionUpsellView.kt"
|
|
|
|
|
|
# instance fields
|
|
.field public final d:Lcom/discord/app/AppTextView;
|
|
|
|
.field public final e:Landroid/widget/TextView;
|
|
|
|
.field public final f:Landroid/widget/TextView;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, p1, p2, v0, v0}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
|
|
|
|
const p2, 0x7f0d0120
|
|
|
|
invoke-static {p1, p2, p0}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
const p1, 0x7f0a09e7
|
|
|
|
invoke-virtual {p0, p1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "findViewById(R.id.view_p\u2026m_upsell_info_subheading)"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Lcom/discord/app/AppTextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;->d:Lcom/discord/app/AppTextView;
|
|
|
|
const p1, 0x7f0a09e9
|
|
|
|
invoke-virtual {p0, p1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "findViewById(R.id.view_p\u2026ll_info_subheading_price)"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;->e:Landroid/widget/TextView;
|
|
|
|
const p1, 0x7f0a09e8
|
|
|
|
invoke-virtual {p0, p1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "findViewById(R.id.view_p\u2026ll_info_subheading_blurb)"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;->f:Landroid/widget/TextView;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a(Lcom/discord/models/domain/ModelSubscriptionPlan$PremiumTier;Z)V
|
|
.locals 16
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
iget-object v2, v0, Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;->f:Landroid/widget/TextView;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/16 v4, 0x8
|
|
|
|
:goto_0
|
|
invoke-virtual {v2, v4}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
const/4 v2, 0x1
|
|
|
|
new-array v4, v2, [Ljava/lang/Object;
|
|
|
|
sget-object v5, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->PREMIUM_GUILD_MONTH:Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->getPrice()I
|
|
|
|
move-result v5
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v6
|
|
|
|
const-string v7, "context"
|
|
|
|
invoke-static {v6, v7}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v5, v6}, Lcom/discord/utilities/billing/PremiumUtilsKt;->getFormattedPrice(ILandroid/content/Context;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object v5
|
|
|
|
aput-object v5, v4, v3
|
|
|
|
const v5, 0x7f1202f3
|
|
|
|
invoke-static {v0, v5, v4}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
new-array v6, v2, [Ljava/lang/Object;
|
|
|
|
sget-object v8, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->PREMIUM_GUILD_MONTH:Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
invoke-virtual {v8}, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->getPrice()I
|
|
|
|
move-result v8
|
|
|
|
int-to-float v8, v8
|
|
|
|
const v9, 0x3f333333 # 0.7f
|
|
|
|
mul-float v8, v8, v9
|
|
|
|
float-to-int v8, v8
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v9
|
|
|
|
invoke-static {v9, v7}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v8, v9}, Lcom/discord/utilities/billing/PremiumUtilsKt;->getFormattedPrice(ILandroid/content/Context;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object v8
|
|
|
|
aput-object v8, v6, v3
|
|
|
|
invoke-static {v0, v5, v6}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
const v6, 0x7f120ab7
|
|
|
|
new-array v8, v2, [Ljava/lang/Object;
|
|
|
|
invoke-static {}, Ljava/text/NumberFormat;->getPercentInstance()Ljava/text/NumberFormat;
|
|
|
|
move-result-object v9
|
|
|
|
const v10, 0x3e99999a # 0.3f
|
|
|
|
invoke-static {v10}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-virtual {v9, v10}, Ljava/text/NumberFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v9
|
|
|
|
const-string v10, "NumberFormat.getPercentI\u2026ISCOUNT_PERCENT\n )"
|
|
|
|
invoke-static {v9, v10}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
aput-object v9, v8, v3
|
|
|
|
invoke-static {v0, v6, v8}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
sget-object v8, Lcom/discord/utilities/textprocessing/Parsers;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers;
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v9
|
|
|
|
invoke-static {v9, v7}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const v10, 0x7f120ac0
|
|
|
|
const/4 v15, 0x2
|
|
|
|
new-array v11, v15, [Ljava/lang/Object;
|
|
|
|
aput-object v5, v11, v3
|
|
|
|
aput-object v4, v11, v2
|
|
|
|
invoke-static {v0, v10, v11}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
const/4 v11, 0x0
|
|
|
|
const v5, 0x7f040131
|
|
|
|
invoke-static {v0, v5}, Lcom/discord/utilities/color/ColorCompat;->getThemedColor(Landroid/view/View;I)I
|
|
|
|
move-result v5
|
|
|
|
invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v12
|
|
|
|
const/4 v13, 0x0
|
|
|
|
const/16 v14, 0x14
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
move-object v15, v5
|
|
|
|
invoke-static/range {v8 .. v15}, Lcom/discord/utilities/textprocessing/Parsers;->parseMarkdown$default(Lcom/discord/utilities/textprocessing/Parsers;Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;Ljava/lang/Integer;ZILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual/range {p1 .. p1}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_3
|
|
|
|
if-eq v8, v2, :cond_2
|
|
|
|
if-eq v8, v1, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget-object v4, v0, Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;->d:Lcom/discord/app/AppTextView;
|
|
|
|
sget-object v8, Lcom/discord/utilities/textprocessing/Parsers;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers;
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v9
|
|
|
|
invoke-static {v9, v7}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const v7, 0x7f120ac5
|
|
|
|
new-array v10, v1, [Ljava/lang/Object;
|
|
|
|
invoke-static {v1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
aput-object v1, v10, v3
|
|
|
|
aput-object v6, v10, v2
|
|
|
|
invoke-static {v0, v7, v10}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
const/4 v11, 0x0
|
|
|
|
const/4 v12, 0x0
|
|
|
|
const/4 v13, 0x0
|
|
|
|
const/16 v14, 0x1c
|
|
|
|
const/4 v15, 0x0
|
|
|
|
invoke-static/range {v8 .. v15}, Lcom/discord/utilities/textprocessing/Parsers;->parseMarkdown$default(Lcom/discord/utilities/textprocessing/Parsers;Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;Ljava/lang/Integer;ZILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v4, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
iget-object v1, v0, Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;->e:Landroid/widget/TextView;
|
|
|
|
invoke-static {v1, v5}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setTextAndVisibilityBy(Landroid/widget/TextView;Ljava/lang/CharSequence;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
iget-object v1, v0, Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;->d:Lcom/discord/app/AppTextView;
|
|
|
|
sget-object v8, Lcom/discord/utilities/textprocessing/Parsers;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers;
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v9
|
|
|
|
invoke-static {v9, v7}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const v4, 0x7f120ac3
|
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
|
|
|
aput-object v6, v2, v3
|
|
|
|
invoke-static {v0, v4, v2}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
const/4 v11, 0x0
|
|
|
|
const/4 v12, 0x0
|
|
|
|
const/4 v13, 0x0
|
|
|
|
const/16 v14, 0x1c
|
|
|
|
const/4 v15, 0x0
|
|
|
|
invoke-static/range {v8 .. v15}, Lcom/discord/utilities/textprocessing/Parsers;->parseMarkdown$default(Lcom/discord/utilities/textprocessing/Parsers;Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;Ljava/lang/Integer;ZILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
iget-object v1, v0, Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;->e:Landroid/widget/TextView;
|
|
|
|
invoke-static {v1, v5}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setTextAndVisibilityBy(Landroid/widget/TextView;Ljava/lang/CharSequence;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
iget-object v1, v0, Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;->d:Lcom/discord/app/AppTextView;
|
|
|
|
const v5, 0x7f120abf
|
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
|
|
|
aput-object v4, v2, v3
|
|
|
|
invoke-static {v0, v5, v2}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
new-array v3, v3, [Ljava/lang/Object;
|
|
|
|
invoke-virtual {v1, v2, v3}, Lcom/discord/app/AppTextView;->b(Ljava/lang/String;[Ljava/lang/Object;)V
|
|
|
|
iget-object v1, v0, Lcom/discord/views/premiumguild/PremiumGuildSubscriptionUpsellView;->e:Landroid/widget/TextView;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {v1, v2}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setTextAndVisibilityBy(Landroid/widget/TextView;Ljava/lang/CharSequence;)V
|
|
|
|
:goto_1
|
|
return-void
|
|
|
|
:cond_4
|
|
const/4 v2, 0x0
|
|
|
|
const-string v1, "userPremiumTier"
|
|
|
|
invoke-static {v1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
.end method
|