463 lines
13 KiB
Smali
463 lines
13 KiB
Smali
.class public final Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;
|
|
.super Ljava/lang/Object;
|
|
.source "PaymentSourcesSpinnerAdapter.kt"
|
|
|
|
# interfaces
|
|
.implements Landroid/widget/SpinnerAdapter;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final context:Landroid/content/Context;
|
|
|
|
.field public final data:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final observers:Ljava/util/HashSet;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashSet<",
|
|
"Landroid/database/DataSetObserver;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/content/Context;",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "context"
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "data"
|
|
|
|
invoke-static {p2, v0}, Lc0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->context:Landroid/content/Context;
|
|
|
|
iput-object p2, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->data:Ljava/util/List;
|
|
|
|
new-instance p1, Ljava/util/HashSet;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashSet;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->observers:Ljava/util/HashSet;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final configurePaymentSourceItem(Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem$PaymentSource;Landroid/view/View;)Landroid/view/View;
|
|
.locals 9
|
|
|
|
const v0, 0x7f0a0059
|
|
|
|
invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "view.findViewById(R.id.a\u2026method_spinner_item_text)"
|
|
|
|
invoke-static {v0, v1}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast v0, Landroid/widget/TextView;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem$PaymentSource;->getPaymentSource()Lcom/discord/models/domain/ModelPaymentSource;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/billing/PremiumUtilsKt;->getPaymentSourceIcon(Lcom/discord/models/domain/ModelPaymentSource;)I
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/16 v7, 0xe
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move-object v2, v0
|
|
|
|
invoke-static/range {v2 .. v8}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setCompoundDrawableWithIntrinsicBounds$default(Landroid/widget/TextView;IIIIILjava/lang/Object;)V
|
|
|
|
instance-of v1, p1, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->context:Landroid/content/Context;
|
|
|
|
const v2, 0x7f121175
|
|
|
|
const/4 v3, 0x1
|
|
|
|
new-array v3, v3, [Ljava/lang/Object;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
check-cast p1, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;->getLast4()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
aput-object p1, v3, v4
|
|
|
|
invoke-virtual {v1, v2, v3}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
instance-of v1, p1, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourcePaypal;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
check-cast p1, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourcePaypal;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourcePaypal;->getEmail()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
return-object p2
|
|
|
|
:cond_1
|
|
new-instance p1, Lkotlin/NoWhenBranchMatchedException;
|
|
|
|
invoke-direct {p1}, Lkotlin/NoWhenBranchMatchedException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final configureSimpleTextItem(Ljava/lang/CharSequence;Landroid/view/View;)Landroid/view/View;
|
|
.locals 9
|
|
|
|
const v0, 0x7f0a0059
|
|
|
|
invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "view.findViewById(R.id.a\u2026method_spinner_item_text)"
|
|
|
|
invoke-static {v0, v1}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast v0, Landroid/widget/TextView;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/16 v7, 0xe
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move-object v2, v0
|
|
|
|
invoke-static/range {v2 .. v8}, Lcom/discord/utilities/view/extensions/ViewExtensions;->setCompoundDrawableWithIntrinsicBounds$default(Landroid/widget/TextView;IIIIILjava/lang/Object;)V
|
|
|
|
invoke-virtual {v0, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
return-object p2
|
|
.end method
|
|
|
|
.method private final getItemView(ILandroid/view/View;)Landroid/view/View;
|
|
.locals 2
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object p2, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->context:Landroid/content/Context;
|
|
|
|
const v0, 0x7f0d001c
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-static {p2, v0, v1}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
move-result-object p2
|
|
|
|
:goto_0
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->data:Ljava/util/List;
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem;
|
|
|
|
instance-of v0, p1, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem$PaymentSource;
|
|
|
|
const-string v1, "view"
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
check-cast p1, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem$PaymentSource;
|
|
|
|
invoke-static {p2, v1}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->configurePaymentSourceItem(Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem$PaymentSource;Landroid/view/View;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
sget-object v0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem$AddPaymentSourceItem;->INSTANCE:Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem$AddPaymentSourceItem;
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/i;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-static {p2, v1}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const p1, 0x7f1202a5
|
|
|
|
invoke-static {p2, p1}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->configureSimpleTextItem(Ljava/lang/CharSequence;Landroid/view/View;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
sget-object v0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem$AttachPaymentSourceItem;->INSTANCE:Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem$AttachPaymentSourceItem;
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/i;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
invoke-static {p2, v1}, Lc0/n/c/i;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const p1, 0x7f120249
|
|
|
|
invoke-static {p2, p1}, Lcom/discord/utilities/view/extensions/ViewExtensions;->getString(Landroid/view/View;I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->configureSimpleTextItem(Ljava/lang/CharSequence;Landroid/view/View;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_1
|
|
return-object p1
|
|
|
|
:cond_3
|
|
new-instance p1, Lkotlin/NoWhenBranchMatchedException;
|
|
|
|
invoke-direct {p1}, Lkotlin/NoWhenBranchMatchedException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getCount()I
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->data:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getDropDownView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
|
|
.locals 1
|
|
|
|
const-string v0, "parent"
|
|
|
|
invoke-static {p3, v0}, Lc0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->getItemView(ILandroid/view/View;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public getItem(I)Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->data:Ljava/util/List;
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem;
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public bridge synthetic getItem(I)Ljava/lang/Object;
|
|
.locals 0
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->getItem(I)Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter$DropdownItem;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public getItemId(I)J
|
|
.locals 2
|
|
|
|
int-to-long v0, p1
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public getItemViewType(I)I
|
|
.locals 0
|
|
|
|
const/4 p1, -0x1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final getObservers()Ljava/util/HashSet;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/HashSet<",
|
|
"Landroid/database/DataSetObserver;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->observers:Ljava/util/HashSet;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
|
|
.locals 1
|
|
|
|
const-string v0, "parent"
|
|
|
|
invoke-static {p3, v0}, Lc0/n/c/i;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->getItemView(ILandroid/view/View;)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public getViewTypeCount()I
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public hasStableIds()Z
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public isEmpty()Z
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->data:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public registerDataSetObserver(Landroid/database/DataSetObserver;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->observers:Ljava/util/HashSet;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public unregisterDataSetObserver(Landroid/database/DataSetObserver;)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/PaymentSourcesSpinnerAdapter;->observers:Ljava/util/HashSet;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-static {v0}, Lc0/n/c/v;->asMutableCollection(Ljava/lang/Object;)Ljava/util/Collection;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/Collection;->remove(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/NullPointerException;
|
|
|
|
const-string v0, "null cannot be cast to non-null type kotlin.collections.MutableCollection<T>"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|