248 lines
6.4 KiB
Smali
248 lines
6.4 KiB
Smali
.class public final Lcom/discord/widgets/roles/RolesListView;
|
|
.super Lcom/google/android/material/chip/ChipGroup;
|
|
.source "RolesListView.kt"
|
|
|
|
|
|
# instance fields
|
|
.field public roles:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelGuildRole;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/google/android/material/chip/ChipGroup;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
|
|
|
|
sget-object p1, Li0/i/n;->d:Li0/i/n;
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/roles/RolesListView;->roles:Ljava/util/List;
|
|
|
|
invoke-virtual {p0}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
const p2, 0x7f0701ef
|
|
|
|
invoke-virtual {p1, p2}, Landroid/content/res/Resources;->getDimension(I)F
|
|
|
|
move-result p1
|
|
|
|
float-to-int p1, p1
|
|
|
|
invoke-virtual {p0, p1}, Lcom/google/android/material/chip/ChipGroup;->setChipSpacingVertical(I)V
|
|
|
|
invoke-virtual {p0, p1}, Lcom/google/android/material/chip/ChipGroup;->setChipSpacingHorizontal(I)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "attrs"
|
|
|
|
invoke-static {p1}, Li0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Li0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getRoles()Ljava/util/List;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/models/domain/ModelGuildRole;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/roles/RolesListView;->roles:Ljava/util/List;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final setRoles(Ljava/util/List;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelGuildRole;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/roles/RolesListView;->roles:Ljava/util/List;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "<set-?>"
|
|
|
|
invoke-static {p1}, Li0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final updateView(Ljava/util/List;I)V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelGuildRole;",
|
|
">;I)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/roles/RolesListView;->roles:Ljava/util/List;
|
|
|
|
invoke-static {p1, v1}, Li0/n/c/h;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
sget-object v1, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreStream$Companion;->getUserSettings()Lcom/discord/stores/StoreUserSettings;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreUserSettings;->getDeveloperMode()Z
|
|
|
|
move-result v1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/roles/RolesListView;->roles:Ljava/util/List;
|
|
|
|
invoke-virtual {p0}, Landroid/view/ViewGroup;->removeAllViews()V
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/discord/models/domain/ModelGuildRole;
|
|
|
|
invoke-virtual {p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v3
|
|
|
|
const v4, 0x7f0d005d
|
|
|
|
invoke-static {v3, v4, v0}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
check-cast v3, Lcom/google/android/material/chip/Chip;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelGuildRole;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v3, v4}, Landroid/widget/CheckBox;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelGuildRole;->isDefaultColor()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
move v4, p2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-static {v2}, Lcom/discord/models/domain/ModelGuildRole;->getOpaqueColor(Lcom/discord/models/domain/ModelGuildRole;)I
|
|
|
|
move-result v4
|
|
|
|
:goto_1
|
|
sget-object v5, Lcom/discord/utilities/color/ColorCompat;->INSTANCE:Lcom/discord/utilities/color/ColorCompat;
|
|
|
|
invoke-virtual {v5, v4}, Lcom/discord/utilities/color/ColorCompat;->createDefaultColorStateList(I)Landroid/content/res/ColorStateList;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v3, v4}, Lcom/google/android/material/chip/Chip;->setChipIconTint(Landroid/content/res/ColorStateList;)V
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
new-instance v4, Lcom/discord/widgets/roles/RolesListView$updateView$$inlined$forEach$lambda$1;
|
|
|
|
invoke-direct {v4, v2, p0, p2, v1}, Lcom/discord/widgets/roles/RolesListView$updateView$$inlined$forEach$lambda$1;-><init>(Lcom/discord/models/domain/ModelGuildRole;Lcom/discord/widgets/roles/RolesListView;IZ)V
|
|
|
|
invoke-virtual {v3, v4}, Landroid/widget/CheckBox;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
:cond_2
|
|
invoke-virtual {p0, v3}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
new-instance p1, Lkotlin/TypeCastException;
|
|
|
|
const-string p2, "null cannot be cast to non-null type com.google.android.material.chip.Chip"
|
|
|
|
invoke-direct {p1, p2}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_4
|
|
return-void
|
|
|
|
:cond_5
|
|
const-string p1, "roles"
|
|
|
|
invoke-static {p1}, Li0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|