429 lines
13 KiB
Smali
429 lines
13 KiB
Smali
.class public final Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;
|
|
.super Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;
|
|
.source "WidgetSettingsBoostAdapter.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "BoostInfoListItem"
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder<",
|
|
"Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter;",
|
|
"Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostItem;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field static final synthetic $$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
|
|
# instance fields
|
|
.field private final container$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
.field private final text$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 5
|
|
|
|
const/4 v0, 0x2
|
|
|
|
new-array v0, v0, [Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v1, Lkotlin/jvm/internal/v;
|
|
|
|
const-class v2, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;
|
|
|
|
invoke-static {v2}, Lkotlin/jvm/internal/w;->Q(Ljava/lang/Class;)Lkotlin/reflect/b;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "text"
|
|
|
|
const-string v4, "getText()Landroid/widget/TextView;"
|
|
|
|
invoke-direct {v1, v2, v3, v4}, Lkotlin/jvm/internal/v;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-static {v1}, Lkotlin/jvm/internal/w;->a(Lkotlin/jvm/internal/u;)Lkotlin/reflect/d;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
new-instance v1, Lkotlin/jvm/internal/v;
|
|
|
|
const-class v2, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;
|
|
|
|
invoke-static {v2}, Lkotlin/jvm/internal/w;->Q(Ljava/lang/Class;)Lkotlin/reflect/b;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "container"
|
|
|
|
const-string v4, "getContainer()Landroid/view/View;"
|
|
|
|
invoke-direct {v1, v2, v3, v4}, Lkotlin/jvm/internal/v;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
invoke-static {v1}, Lkotlin/jvm/internal/w;->a(Lkotlin/jvm/internal/u;)Lkotlin/reflect/d;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
sput-object v0, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter;)V
|
|
.locals 1
|
|
|
|
const-string v0, "adapter"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;
|
|
|
|
const v0, 0x7f0d00a6
|
|
|
|
invoke-direct {p0, v0, p1}, Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;-><init>(ILcom/discord/utilities/mg_recycler/MGRecyclerAdapter;)V
|
|
|
|
const p1, 0x7f0a00e9
|
|
|
|
invoke-static {p0, p1}, Lkotterknife/b;->a(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->text$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
const p1, 0x7f0a00e8
|
|
|
|
invoke-static {p0, p1}, Lkotterknife/b;->a(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->container$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getContainer()Landroid/view/View;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->container$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
aget-object v1, v1, v2
|
|
|
|
invoke-interface {v0, p0, v1}, Lkotlin/properties/ReadOnlyProperty;->getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/view/View;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getText()Landroid/widget/TextView;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->text$delegate:Lkotlin/properties/ReadOnlyProperty;
|
|
|
|
sget-object v1, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aget-object v1, v1, v2
|
|
|
|
invoke-interface {v0, p0, v1}, Lkotlin/properties/ReadOnlyProperty;->getValue(Ljava/lang/Object;Lkotlin/reflect/KProperty;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/widget/TextView;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected final onConfigure(ILcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostItem;)V
|
|
.locals 13
|
|
|
|
const-string v0, "data"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-super {p0, p1, p2}, Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;->onConfigure(ILjava/lang/Object;)V
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->itemView:Landroid/view/View;
|
|
|
|
const-string v0, "itemView"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {p2}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostItem;->getBoostsRemaining()Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "context"
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p2}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostItem;->getBoostsRemaining()Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p1
|
|
|
|
if-lez p1, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->getContainer()Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
const v4, 0x7f0800bc
|
|
|
|
invoke-virtual {p1, v4}, Landroid/view/View;->setBackgroundResource(I)V
|
|
|
|
invoke-static {v2, v0}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
const v0, 0x7f10009b
|
|
|
|
invoke-virtual {p2}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostItem;->getBoostsRemaining()Ljava/lang/Integer;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v4
|
|
|
|
new-array v5, v1, [Ljava/lang/Object;
|
|
|
|
invoke-virtual {p2}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostItem;->getBoostsRemaining()Ljava/lang/Integer;
|
|
|
|
move-result-object p2
|
|
|
|
aput-object p2, v5, v3
|
|
|
|
invoke-virtual {p1, v0, v4, v5}, Landroid/content/res/Resources;->getQuantityString(II[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->getText()Landroid/widget/TextView;
|
|
|
|
move-result-object p2
|
|
|
|
sget-object v0, Lcom/discord/utilities/textprocessing/Parsers;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers;
|
|
|
|
const v4, 0x7f120da8
|
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
|
|
|
aput-object p1, v1, v3
|
|
|
|
invoke-virtual {v2, v4, v1}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v1, "context.getString(R.stri\u2026_count, boostCountString)"
|
|
|
|
invoke-static {p1, v1}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
move-object v3, p1
|
|
|
|
check-cast v3, Ljava/lang/CharSequence;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x4
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v1, v0
|
|
|
|
invoke-static/range {v1 .. v6}, Lcom/discord/utilities/textprocessing/Parsers;->parseMarkdown$default(Lcom/discord/utilities/textprocessing/Parsers;Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;ILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p2, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->getContainer()Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->getContainer()Landroid/view/View;
|
|
|
|
move-result-object v4
|
|
|
|
const v5, 0x7f0402a6
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x2
|
|
|
|
invoke-static {v4, v5, v3, v7, v6}, Lcom/discord/utilities/drawable/DrawableCompat;->getThemedDrawableRes$default(Landroid/view/View;IIILjava/lang/Object;)I
|
|
|
|
move-result v4
|
|
|
|
invoke-virtual {p1, v4}, Landroid/view/View;->setBackgroundResource(I)V
|
|
|
|
invoke-virtual {p2}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostItem;->getCooldownEndsAt()Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
const-wide/16 v4, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move-wide p1, v4
|
|
|
|
:goto_0
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v8
|
|
|
|
sub-long/2addr p1, v8
|
|
|
|
invoke-static {p1, p2, v4, v5}, Ljava/lang/Math;->max(JJ)J
|
|
|
|
move-result-wide p1
|
|
|
|
const-wide/32 v4, 0x5265c00
|
|
|
|
div-long v8, p1, v4
|
|
|
|
mul-long v4, v4, v8
|
|
|
|
sub-long/2addr p1, v4
|
|
|
|
const-wide/32 v4, 0x36ee80
|
|
|
|
div-long v10, p1, v4
|
|
|
|
mul-long v4, v4, v10
|
|
|
|
sub-long/2addr p1, v4
|
|
|
|
const-wide/32 v4, 0xea60
|
|
|
|
div-long/2addr p1, v4
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->getText()Landroid/widget/TextView;
|
|
|
|
move-result-object v12
|
|
|
|
sget-object v4, Lcom/discord/utilities/textprocessing/Parsers;->INSTANCE:Lcom/discord/utilities/textprocessing/Parsers;
|
|
|
|
invoke-static {v2, v0}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const v0, 0x7f120d74
|
|
|
|
const/4 v5, 0x3
|
|
|
|
new-array v5, v5, [Ljava/lang/Object;
|
|
|
|
invoke-static {v8, v9}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
aput-object v6, v5, v3
|
|
|
|
invoke-static {v10, v11}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v5, v1
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
aput-object p1, v5, v7
|
|
|
|
invoke-virtual {v2, v0, v5}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "context.getString(R.stri\u2026ng(), minutes.toString())"
|
|
|
|
invoke-static {p1, p2}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
move-object v3, p1
|
|
|
|
check-cast v3, Ljava/lang/CharSequence;
|
|
|
|
const/4 p1, 0x0
|
|
|
|
const/4 v5, 0x4
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v1, v4
|
|
|
|
move-object v4, p1
|
|
|
|
invoke-static/range {v1 .. v6}, Lcom/discord/utilities/textprocessing/Parsers;->parseMarkdown$default(Lcom/discord/utilities/textprocessing/Parsers;Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/Integer;ILjava/lang/Object;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v12, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final bridge synthetic onConfigure(ILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
check-cast p2, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostItem;
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostInfoListItem;->onConfigure(ILcom/discord/widgets/settings/nitro/WidgetSettingsBoostAdapter$BoostItem;)V
|
|
|
|
return-void
|
|
.end method
|