346 lines
9.8 KiB
Smali
346 lines
9.8 KiB
Smali
.class public final Lcom/discord/views/premium/AccountCreditView;
|
|
.super Landroidx/constraintlayout/widget/ConstraintLayout;
|
|
.source "AccountCreditView.kt"
|
|
|
|
|
|
# instance fields
|
|
.field public final d:Landroid/widget/ImageView;
|
|
|
|
.field public final e:Landroid/widget/TextView;
|
|
|
|
.field public final f:Landroid/widget/TextView;
|
|
|
|
.field public final g:Landroid/widget/TextView;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const-string v1, "context"
|
|
|
|
invoke-static {p1, v1}, Lc0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p1, p2, v0}, Landroidx/constraintlayout/widget/ConstraintLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
|
|
|
|
const p2, 0x7f0d0108
|
|
|
|
invoke-static {p1, p2, p0}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
const p1, 0x7f0a02c5
|
|
|
|
invoke-virtual {p0, p1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/ImageView;
|
|
|
|
iput-object p1, p0, Lcom/discord/views/premium/AccountCreditView;->d:Landroid/widget/ImageView;
|
|
|
|
const p1, 0x7f0a02c4
|
|
|
|
invoke-virtual {p0, p1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/views/premium/AccountCreditView;->e:Landroid/widget/TextView;
|
|
|
|
const p1, 0x7f0a02c6
|
|
|
|
invoke-virtual {p0, p1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/views/premium/AccountCreditView;->f:Landroid/widget/TextView;
|
|
|
|
const p1, 0x7f0a02cb
|
|
|
|
invoke-virtual {p0, p1}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/views/premium/AccountCreditView;->g:Landroid/widget/TextView;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a(JILcom/discord/models/domain/ModelSubscription;)V
|
|
.locals 18
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
move/from16 v1, p3
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-lez v1, :cond_0
|
|
|
|
const/4 v4, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v4, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v4, :cond_1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/16 v4, 0x8
|
|
|
|
:goto_1
|
|
invoke-virtual {v0, v4}, Landroid/view/View;->setVisibility(I)V
|
|
|
|
if-gtz v1, :cond_2
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
sget-object v4, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->PREMIUM_MONTH_TIER_1:Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->getPlanId()J
|
|
|
|
move-result-wide v4
|
|
|
|
const v6, 0x7f1212db
|
|
|
|
const-string v7, "header"
|
|
|
|
cmp-long v8, p1, v4
|
|
|
|
if-nez v8, :cond_3
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v4
|
|
|
|
const v5, 0x7f1212fc
|
|
|
|
invoke-virtual {v4, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
const-string v5, "context.getString(R.string.premium_tier_1)"
|
|
|
|
invoke-static {v4, v5}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v5, v0, Lcom/discord/views/premium/AccountCreditView;->d:Landroid/widget/ImageView;
|
|
|
|
const v8, 0x7f080167
|
|
|
|
invoke-virtual {v5, v8}, Landroid/widget/ImageView;->setImageResource(I)V
|
|
|
|
iget-object v5, v0, Lcom/discord/views/premium/AccountCreditView;->e:Landroid/widget/TextView;
|
|
|
|
invoke-static {v5, v7}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v7
|
|
|
|
new-array v8, v2, [Ljava/lang/Object;
|
|
|
|
aput-object v4, v8, v3
|
|
|
|
invoke-virtual {v7, v6, v8}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {v5, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
sget-object v4, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->PREMIUM_MONTH_TIER_2:Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->getPlanId()J
|
|
|
|
move-result-wide v4
|
|
|
|
cmp-long v8, p1, v4
|
|
|
|
if-nez v8, :cond_4
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v4
|
|
|
|
const v5, 0x7f1212fd
|
|
|
|
invoke-virtual {v4, v5}, Landroid/content/Context;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
const-string v5, "context.getString(R.string.premium_tier_2)"
|
|
|
|
invoke-static {v4, v5}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v5, v0, Lcom/discord/views/premium/AccountCreditView;->d:Landroid/widget/ImageView;
|
|
|
|
const v8, 0x7f080166
|
|
|
|
invoke-virtual {v5, v8}, Landroid/widget/ImageView;->setImageResource(I)V
|
|
|
|
iget-object v5, v0, Lcom/discord/views/premium/AccountCreditView;->e:Landroid/widget/TextView;
|
|
|
|
invoke-static {v5, v7}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v7
|
|
|
|
new-array v8, v2, [Ljava/lang/Object;
|
|
|
|
aput-object v4, v8, v3
|
|
|
|
invoke-virtual {v7, v6, v8}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {v5, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
const-string v4, ""
|
|
|
|
:goto_2
|
|
const-string v5, "context"
|
|
|
|
const-string v6, "infoText"
|
|
|
|
if-eqz p4, :cond_5
|
|
|
|
invoke-virtual/range {p4 .. p4}, Lcom/discord/models/domain/ModelSubscription;->getPlanId()J
|
|
|
|
move-result-wide v7
|
|
|
|
cmp-long v9, p1, v7
|
|
|
|
if-nez v9, :cond_5
|
|
|
|
sget-object v10, Lcom/discord/utilities/time/TimeUtils;->INSTANCE:Lcom/discord/utilities/time/TimeUtils;
|
|
|
|
invoke-virtual/range {p4 .. p4}, Lcom/discord/models/domain/ModelSubscription;->getCurrentPeriodEnd()Ljava/lang/String;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v12
|
|
|
|
invoke-static {v12, v5}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 v13, 0x0
|
|
|
|
const/4 v14, 0x0
|
|
|
|
const/4 v15, 0x0
|
|
|
|
const/16 v16, 0x1c
|
|
|
|
const/16 v17, 0x0
|
|
|
|
invoke-static/range {v10 .. v17}, Lcom/discord/utilities/time/TimeUtils;->renderUtcDate$default(Lcom/discord/utilities/time/TimeUtils;Ljava/lang/String;Landroid/content/Context;Ljava/lang/String;Ljava/text/DateFormat;IILjava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
iget-object v7, v0, Lcom/discord/views/premium/AccountCreditView;->f:Landroid/widget/TextView;
|
|
|
|
invoke-static {v7, v6}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v6
|
|
|
|
const v8, 0x7f1212dd
|
|
|
|
new-array v9, v2, [Ljava/lang/Object;
|
|
|
|
aput-object v4, v9, v3
|
|
|
|
invoke-virtual {v6, v8, v9}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v7, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
goto :goto_3
|
|
|
|
:cond_5
|
|
iget-object v7, v0, Lcom/discord/views/premium/AccountCreditView;->f:Landroid/widget/TextView;
|
|
|
|
invoke-static {v7, v6}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v6
|
|
|
|
const v8, 0x7f1212dc
|
|
|
|
new-array v9, v2, [Ljava/lang/Object;
|
|
|
|
aput-object v4, v9, v3
|
|
|
|
invoke-virtual {v6, v8, v9}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v7, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
:goto_3
|
|
iget-object v4, v0, Lcom/discord/views/premium/AccountCreditView;->g:Landroid/widget/TextView;
|
|
|
|
const-string v6, "timeText"
|
|
|
|
invoke-static {v4, v6}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v6
|
|
|
|
const-string v7, "resources"
|
|
|
|
invoke-static {v6, v7}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual/range {p0 .. p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-static {v7, v5}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const v5, 0x7f1000f0
|
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
|
|
|
invoke-static/range {p3 .. p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v8
|
|
|
|
aput-object v8, v2, v3
|
|
|
|
invoke-static {v6, v7, v5, v1, v2}, Lcom/discord/utilities/resources/StringResourceUtilsKt;->getQuantityString(Landroid/content/res/Resources;Landroid/content/Context;II[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v4, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
return-void
|
|
.end method
|