341 lines
11 KiB
Smali
341 lines
11 KiB
Smali
.class public final Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;
|
|
.super Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;
|
|
.source "PaymentSourceAdapter.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/settings/billing/PaymentSourceAdapter;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "PaymentSourceItemViewHolder"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder<",
|
|
"Lcom/discord/widgets/settings/billing/PaymentSourceAdapter;",
|
|
"Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$Item;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private final icon:Landroid/widget/ImageView;
|
|
|
|
.field private final invalidIndicator:Landroid/view/View;
|
|
|
|
.field private final premiumIndicator:Landroid/view/View;
|
|
|
|
.field private final subtext:Landroid/widget/TextView;
|
|
|
|
.field private final title:Landroid/widget/TextView;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/widgets/settings/billing/PaymentSourceAdapter;)V
|
|
.locals 1
|
|
|
|
const-string v0, "adapter"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/j;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;
|
|
|
|
const v0, 0x7f0d0052
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;-><init>(ILcom/discord/utilities/mg_recycler/MGRecyclerAdapter;)V
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const v0, 0x7f0a0422
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "itemView.findViewById(R.id.payment_method_icon)"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/j;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroid/widget/ImageView;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->icon:Landroid/widget/ImageView;
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const v0, 0x7f0a0426
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "itemView.findViewById(R.id.payment_method_title)"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/j;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->title:Landroid/widget/TextView;
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const v0, 0x7f0a0425
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "itemView.findViewById(R.id.payment_method_subtext)"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/j;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroid/widget/TextView;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->subtext:Landroid/widget/TextView;
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const v0, 0x7f0a0424
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "itemView.findViewById(R.id.payment_method_premium)"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/j;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->premiumIndicator:Landroid/view/View;
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->itemView:Landroid/view/View;
|
|
|
|
const v0, 0x7f0a0423
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "itemView.findViewById(R.id.payment_method_invalid)"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/j;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->invalidIndicator:Landroid/view/View;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected final onConfigure(ILcom/discord/widgets/settings/billing/PaymentSourceAdapter$Item;)V
|
|
.locals 10
|
|
|
|
const-string p1, "data"
|
|
|
|
invoke-static {p2, p1}, Lkotlin/jvm/internal/j;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p2, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItem;
|
|
|
|
invoke-virtual {p2}, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItem;->getPaymentSource()Lcom/discord/models/domain/ModelPaymentSource;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->icon:Landroid/widget/ImageView;
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/billing/PremiumUtilsKt;->getPaymentSourceIcon(Lcom/discord/models/domain/ModelPaymentSource;)I
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageResource(I)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->title:Landroid/widget/TextView;
|
|
|
|
instance-of v1, p1, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x2
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
move-object v5, v0
|
|
|
|
check-cast v5, Landroid/view/View;
|
|
|
|
const v6, 0x7f120ba7
|
|
|
|
new-array v7, v4, [Ljava/lang/Object;
|
|
|
|
move-object v8, p1
|
|
|
|
check-cast v8, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;
|
|
|
|
invoke-virtual {v8}, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;->getBrand()Ljava/lang/String;
|
|
|
|
move-result-object v9
|
|
|
|
aput-object v9, v7, v3
|
|
|
|
invoke-virtual {v8}, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;->getLast4()Ljava/lang/String;
|
|
|
|
move-result-object v8
|
|
|
|
aput-object v8, v7, v2
|
|
|
|
invoke-static {v5, v6, v7}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Ljava/lang/CharSequence;
|
|
|
|
invoke-static {v5}, Lcom/discord/simpleast/core/a/b;->a(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Ljava/lang/CharSequence;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
instance-of v5, p1, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourcePaypal;
|
|
|
|
if-eqz v5, :cond_3
|
|
|
|
move-object v5, v0
|
|
|
|
check-cast v5, Landroid/view/View;
|
|
|
|
const v6, 0x7f120bc1
|
|
|
|
invoke-static {v5, v6}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I)Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Ljava/lang/CharSequence;
|
|
|
|
:goto_0
|
|
invoke-virtual {v0, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->subtext:Landroid/widget/TextView;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
sget-object v1, Lcom/discord/utilities/time/TimeUtils;->INSTANCE:Lcom/discord/utilities/time/TimeUtils;
|
|
|
|
move-object v5, p1
|
|
|
|
check-cast v5, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;->getExpiresMonth()I
|
|
|
|
move-result v6
|
|
|
|
iget-object v7, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->subtext:Landroid/widget/TextView;
|
|
|
|
invoke-virtual {v7}, Landroid/widget/TextView;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v7
|
|
|
|
const-string v8, "subtext.context"
|
|
|
|
invoke-static {v7, v8}, Lkotlin/jvm/internal/j;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, v6, v7}, Lcom/discord/utilities/time/TimeUtils;->getLocalizedMonthName(ILandroid/content/Context;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v6, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->title:Landroid/widget/TextView;
|
|
|
|
check-cast v6, Landroid/view/View;
|
|
|
|
const v7, 0x7f120ba9
|
|
|
|
new-array v8, v4, [Ljava/lang/Object;
|
|
|
|
aput-object v1, v8, v3
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;->getExpiresYear()I
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v1
|
|
|
|
aput-object v1, v8, v2
|
|
|
|
invoke-static {v6, v7, v8}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/CharSequence;
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
instance-of v1, p1, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourcePaypal;
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
move-object v1, p1
|
|
|
|
check-cast v1, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourcePaypal;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourcePaypal;->getEmail()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/CharSequence;
|
|
|
|
:goto_1
|
|
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->premiumIndicator:Landroid/view/View;
|
|
|
|
invoke-virtual {p2}, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItem;->isPremium()Z
|
|
|
|
move-result p2
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-static {v0, p2, v3, v4, v1}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setVisibilityBy$default(Landroid/view/View;ZIILjava/lang/Object;)V
|
|
|
|
iget-object p2, p0, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->invalidIndicator:Landroid/view/View;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPaymentSource;->getInvalid()Z
|
|
|
|
move-result p1
|
|
|
|
invoke-static {p2, p1, v3, v4, v1}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setVisibilityBy$default(Landroid/view/View;ZIILjava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
new-instance p1, Lkotlin/k;
|
|
|
|
invoke-direct {p1}, Lkotlin/k;-><init>()V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
new-instance p1, Lkotlin/k;
|
|
|
|
invoke-direct {p1}, Lkotlin/k;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final bridge synthetic onConfigure(ILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
check-cast p2, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$Item;
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/widgets/settings/billing/PaymentSourceAdapter$PaymentSourceItemViewHolder;->onConfigure(ILcom/discord/widgets/settings/billing/PaymentSourceAdapter$Item;)V
|
|
|
|
return-void
|
|
.end method
|