395 lines
11 KiB
Smali
395 lines
11 KiB
Smali
.class public final Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;
|
|
.super Landroidx/recyclerview/widget/RecyclerView$Adapter;
|
|
.source "WidgetGuildProfileSheetEmojisAdapter.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroidx/recyclerview/widget/RecyclerView$Adapter<",
|
|
"Lcom/discord/widgets/guilds/profile/BaseEmojiViewHolder;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public data:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/widgets/guilds/profile/EmojiItem;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public onClickEmoji:Lkotlin/jvm/functions/Function0;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lkotlin/jvm/functions/Function0<",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;-><init>()V
|
|
|
|
sget-object v0, Lj0/i/n;->d:Lj0/i/n;
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->data:Ljava/util/List;
|
|
|
|
sget-object v0, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter$onClickEmoji$1;->INSTANCE:Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter$onClickEmoji$1;
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->onClickEmoji:Lkotlin/jvm/functions/Function0;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getEmojiItems(Ljava/util/List;I)Ljava/util/List;
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/models/domain/emoji/Emoji;",
|
|
">;I)",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/widgets/guilds/profile/EmojiItem;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-static {p1, p2}, Lj0/i/l;->take(Ljava/lang/Iterable;I)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/discord/models/domain/emoji/Emoji;
|
|
|
|
new-instance v3, Lcom/discord/widgets/guilds/profile/EmojiItem$EmojiData;
|
|
|
|
invoke-direct {v3, v2}, Lcom/discord/widgets/guilds/profile/EmojiItem$EmojiData;-><init>(Lcom/discord/models/domain/emoji/Emoji;)V
|
|
|
|
invoke-interface {v1, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-interface {p1}, Ljava/util/Collection;->size()I
|
|
|
|
move-result p1
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
sub-int/2addr p1, v0
|
|
|
|
if-lez p1, :cond_2
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-ne v0, p2, :cond_1
|
|
|
|
invoke-static {v1}, Lf/n/a/k/a;->getLastIndex(Ljava/util/List;)I
|
|
|
|
move-result p2
|
|
|
|
invoke-interface {v1, p2}, Ljava/util/List;->remove(I)Ljava/lang/Object;
|
|
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
:cond_1
|
|
const/16 p2, 0x63
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result p1
|
|
|
|
new-instance p2, Lcom/discord/widgets/guilds/profile/EmojiItem$MoreEmoji;
|
|
|
|
invoke-direct {p2, p1}, Lcom/discord/widgets/guilds/profile/EmojiItem$MoreEmoji;-><init>(I)V
|
|
|
|
invoke-interface {v1, p2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_2
|
|
return-object v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getItemCount()I
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->data:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getItemViewType(I)I
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->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/guilds/profile/EmojiItem;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/guilds/profile/EmojiItem;->getType()I
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final getOnClickEmoji()Lkotlin/jvm/functions/Function0;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lkotlin/jvm/functions/Function0<",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->onClickEmoji:Lkotlin/jvm/functions/Function0;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public bridge synthetic onBindViewHolder(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;I)V
|
|
.locals 0
|
|
|
|
check-cast p1, Lcom/discord/widgets/guilds/profile/BaseEmojiViewHolder;
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->onBindViewHolder(Lcom/discord/widgets/guilds/profile/BaseEmojiViewHolder;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onBindViewHolder(Lcom/discord/widgets/guilds/profile/BaseEmojiViewHolder;I)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->data:Ljava/util/List;
|
|
|
|
invoke-interface {v0, p2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Lcom/discord/widgets/guilds/profile/EmojiItem;
|
|
|
|
invoke-virtual {p1, p2}, Lcom/discord/widgets/guilds/profile/BaseEmojiViewHolder;->bind(Lcom/discord/widgets/guilds/profile/EmojiItem;)V
|
|
|
|
iget-object p1, p1, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;
|
|
|
|
new-instance p2, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter$onBindViewHolder$1;
|
|
|
|
invoke-direct {p2, p0}, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter$onBindViewHolder$1;-><init>(Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;)V
|
|
|
|
invoke-virtual {p1, p2}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "holder"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public bridge synthetic onCreateViewHolder(Landroid/view/ViewGroup;I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
|
|
.locals 0
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->onCreateViewHolder(Landroid/view/ViewGroup;I)Lcom/discord/widgets/guilds/profile/BaseEmojiViewHolder;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public onCreateViewHolder(Landroid/view/ViewGroup;I)Lcom/discord/widgets/guilds/profile/BaseEmojiViewHolder;
|
|
.locals 3
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
const-string v0, "view"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-ne p2, v2, :cond_0
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object p2
|
|
|
|
const v2, 0x7f0d01dd
|
|
|
|
invoke-virtual {p2, v2, p1, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Lcom/discord/widgets/guilds/profile/MoreEmojiViewHolder;
|
|
|
|
invoke-static {p1, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p2, p1}, Lcom/discord/widgets/guilds/profile/MoreEmojiViewHolder;-><init>(Landroid/view/View;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "invalid view type: "
|
|
|
|
invoke-static {v0, p2}, Lf/e/b/a/a;->h(Ljava/lang/String;I)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {p2}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object p2
|
|
|
|
const v2, 0x7f0d01de
|
|
|
|
invoke-virtual {p2, v2, p1, v1}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Lcom/discord/widgets/guilds/profile/EmojiViewHolder;
|
|
|
|
invoke-static {p1, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p2, p1}, Lcom/discord/widgets/guilds/profile/EmojiViewHolder;-><init>(Landroid/view/View;)V
|
|
|
|
:goto_0
|
|
return-object p2
|
|
|
|
:cond_2
|
|
const-string p1, "parent"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final setData(Ljava/util/List;I)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/models/domain/emoji/Emoji;",
|
|
">;I)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->getEmojiItems(Ljava/util/List;I)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->data:Ljava/util/List;
|
|
|
|
invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->notifyDataSetChanged()V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "emojis"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final setOnClickEmoji(Lkotlin/jvm/functions/Function0;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkotlin/jvm/functions/Function0<",
|
|
"Lkotlin/Unit;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/guilds/profile/WidgetGuildProfileSheetEmojisAdapter;->onClickEmoji:Lkotlin/jvm/functions/Function0;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "<set-?>"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|