797 lines
27 KiB
Smali
797 lines
27 KiB
Smali
.class public final Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;
|
|
.super Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;
|
|
.source "WidgetEmojiAdapterV2.kt"
|
|
|
|
# interfaces
|
|
.implements Lcom/discord/utilities/views/StickyHeaderItemDecoration$StickyHeaderAdapter;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$HeaderItem;,
|
|
Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$EmojiItem;,
|
|
Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$HeaderViewHolder;,
|
|
Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$EmojiViewHolder;,
|
|
Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;,
|
|
Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple<",
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;",
|
|
">;",
|
|
"Lcom/discord/utilities/views/StickyHeaderItemDecoration$StickyHeaderAdapter;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final Companion:Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$Companion;
|
|
|
|
.field public static final DEFAULT_NUM_COLUMNS:I = 0x8
|
|
|
|
.field public static final ITEM_TYPE_EMOJI:I = 0x1
|
|
|
|
.field public static final ITEM_TYPE_HEADER:I = 0x0
|
|
|
|
.field public static final MAX_EMOJI_SIZE_PX:I = 0x40
|
|
|
|
|
|
# instance fields
|
|
.field public emojiItemDecoration:Lcom/discord/widgets/chat/input/emoji/EmojiPickerEmojiItemDecoration;
|
|
|
|
.field public final emojiSizePx:I
|
|
|
|
.field public headerIndices:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final layoutManager:Landroidx/recyclerview/widget/GridLayoutManager;
|
|
|
|
.field public final numColumns:I
|
|
|
|
.field public final onEmojiSelectedListener:Lcom/discord/widgets/chat/input/emoji/OnEmojiSelectedListener;
|
|
|
|
.field public onScrollListener:Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;
|
|
|
|
.field public onScrollPositionListener:Lkotlin/jvm/functions/Function1;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"-",
|
|
"Ljava/lang/Integer;",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public stickyHeaderManager:Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->Companion:Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$Companion;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroidx/recyclerview/widget/RecyclerView;Lcom/discord/widgets/chat/input/emoji/OnEmojiSelectedListener;)V
|
|
.locals 2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;-><init>(Landroidx/recyclerview/widget/RecyclerView;)V
|
|
|
|
iput-object p2, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onEmojiSelectedListener:Lcom/discord/widgets/chat/input/emoji/OnEmojiSelectedListener;
|
|
|
|
sget-object p2, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$onScrollPositionListener$1;->INSTANCE:Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$onScrollPositionListener$1;
|
|
|
|
iput-object p2, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onScrollPositionListener:Lkotlin/jvm/functions/Function1;
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v0, "recycler.context"
|
|
|
|
invoke-static {p2, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p2
|
|
|
|
const v0, 0x7f07006f
|
|
|
|
invoke-virtual {p2, v0}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
move-result p2
|
|
|
|
iput p2, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->emojiSizePx:I
|
|
|
|
sget-object p2, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->Companion:Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$Companion;
|
|
|
|
invoke-static {p2, p1}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$Companion;->access$calculateNumOfColumns(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$Companion;Landroidx/recyclerview/widget/RecyclerView;)I
|
|
|
|
move-result p2
|
|
|
|
iput p2, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->numColumns:I
|
|
|
|
new-instance p2, Landroidx/recyclerview/widget/GridLayoutManager;
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
iget v1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->numColumns:I
|
|
|
|
invoke-direct {p2, v0, v1}, Landroidx/recyclerview/widget/GridLayoutManager;-><init>(Landroid/content/Context;I)V
|
|
|
|
iput-object p2, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->layoutManager:Landroidx/recyclerview/widget/GridLayoutManager;
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$1;-><init>(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)V
|
|
|
|
invoke-virtual {p2, v0}, Landroidx/recyclerview/widget/GridLayoutManager;->setSpanSizeLookup(Landroidx/recyclerview/widget/GridLayoutManager$SpanSizeLookup;)V
|
|
|
|
iget-object p2, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->layoutManager:Landroidx/recyclerview/widget/GridLayoutManager;
|
|
|
|
invoke-virtual {p1, p2}, Landroidx/recyclerview/widget/RecyclerView;->setLayoutManager(Landroidx/recyclerview/widget/RecyclerView$LayoutManager;)V
|
|
|
|
invoke-virtual {p1, p0}, Landroidx/recyclerview/widget/RecyclerView;->setAdapter(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->setupScrollObservables()V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "onEmojiSelectedListener"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "recycler"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getEmojiSizePx$p(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)I
|
|
.locals 0
|
|
|
|
iget p0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->emojiSizePx:I
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getLayoutManager$p(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)Landroidx/recyclerview/widget/GridLayoutManager;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->layoutManager:Landroidx/recyclerview/widget/GridLayoutManager;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getNumColumns$p(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)I
|
|
.locals 0
|
|
|
|
iget p0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->numColumns:I
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getOnEmojiSelectedListener$p(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)Lcom/discord/widgets/chat/input/emoji/OnEmojiSelectedListener;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onEmojiSelectedListener:Lcom/discord/widgets/chat/input/emoji/OnEmojiSelectedListener;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getOnScrollListener$p(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onScrollListener:Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getOnScrollPositionListener$p(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)Lkotlin/jvm/functions/Function1;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onScrollPositionListener:Lkotlin/jvm/functions/Function1;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getStickyHeaderManager$p(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->stickyHeaderManager:Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const-string p0, "stickyHeaderManager"
|
|
|
|
invoke-static {p0}, Lj0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 p0, 0x0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$setOnScrollListener$p(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onScrollListener:Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$setOnScrollPositionListener$p(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;Lkotlin/jvm/functions/Function1;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onScrollPositionListener:Lkotlin/jvm/functions/Function1;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$setStickyHeaderManager$p(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->stickyHeaderManager:Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final setupScrollObservables()V
|
|
.locals 11
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$setupScrollObservables$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$setupScrollObservables$1;-><init>(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)V
|
|
|
|
sget-object v1, Lrx/Emitter$BackpressureMode;->h:Lrx/Emitter$BackpressureMode;
|
|
|
|
invoke-static {v0, v1}, Lrx/Observable;->n(Lrx/functions/Action1;Lrx/Emitter$BackpressureMode;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/utilities/rx/LeadingEdgeThrottle;
|
|
|
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
const-wide/16 v3, 0xfa
|
|
|
|
invoke-direct {v1, v3, v4, v2}, Lcom/discord/utilities/rx/LeadingEdgeThrottle;-><init>(JLjava/util/concurrent/TimeUnit;)V
|
|
|
|
new-instance v2, Lr0/l/a/u;
|
|
|
|
iget-object v0, v0, Lrx/Observable;->d:Lrx/Observable$a;
|
|
|
|
invoke-direct {v2, v0, v1}, Lr0/l/a/u;-><init>(Lrx/Observable$a;Lrx/Observable$b;)V
|
|
|
|
invoke-static {v2}, Lrx/Observable;->b0(Lrx/Observable$a;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "Observable\n .crea\u2026, TimeUnit.MILLISECONDS))"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object v2
|
|
|
|
const-class v3, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
new-instance v8, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$setupScrollObservables$2;
|
|
|
|
invoke-direct {v8, p0}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$setupScrollObservables$2;-><init>(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)V
|
|
|
|
const/16 v9, 0x1e
|
|
|
|
const/4 v10, 0x0
|
|
|
|
invoke-static/range {v2 .. v10}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onScrollListener:Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;->getRecycler()Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1, v0}, Landroidx/recyclerview/widget/RecyclerView;->addOnScrollListener(Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getAndBindHeaderView(I)Landroid/view/View;
|
|
.locals 5
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;->getInternalData()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->stickyHeaderManager:Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const-string v3, "stickyHeaderManager"
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;->getStickyHeaderHolder()Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$HeaderViewHolder;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v4, "row"
|
|
|
|
invoke-static {v0, v4}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, p1, v0}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$HeaderViewHolder;->bind(ILcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;)V
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->stickyHeaderManager:Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;->getCurrentStickyHeaderView()Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
invoke-static {v3}, Lj0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
|
|
:cond_1
|
|
invoke-static {v3}, Lj0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
.end method
|
|
|
|
.method public getHeaderPositionForItem(I)Ljava/lang/Integer;
|
|
.locals 8
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->headerIndices:Ljava/util/List;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v2
|
|
|
|
invoke-interface {v0, v2}, Ljava/util/List;->listIterator(I)Ljava/util/ListIterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_0
|
|
invoke-interface {v0}, Ljava/util/ListIterator;->hasPrevious()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
invoke-interface {v0}, Ljava/util/ListIterator;->previous()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
move-object v3, v2
|
|
|
|
check-cast v3, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Number;->intValue()I
|
|
|
|
move-result v3
|
|
|
|
if-lt p1, v3, :cond_1
|
|
|
|
const/4 v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v3, :cond_0
|
|
|
|
move-object v1, v2
|
|
|
|
:cond_2
|
|
check-cast v1, Ljava/lang/Integer;
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
sget-object v2, Lcom/discord/app/AppLog;->c:Lcom/discord/app/AppLog;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x6
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const-string v3, "failed to find header position for item in WidgetEmojiAdapterV2"
|
|
|
|
invoke-static/range {v2 .. v7}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
:cond_3
|
|
return-object v1
|
|
|
|
:cond_4
|
|
const-string p1, "headerIndices"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method public isHeader(I)Z
|
|
.locals 2
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;->getInternalData()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "this.internalData"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v0, p1}, Lj0/i/l;->getOrNull(Ljava/util/List;I)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
instance-of p1, p1, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$HeaderItem;
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public onAttachedToRecyclerView(Landroidx/recyclerview/widget/RecyclerView;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-super {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->onAttachedToRecyclerView(Landroidx/recyclerview/widget/RecyclerView;)V
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;-><init>(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)V
|
|
|
|
iput-object v0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->stickyHeaderManager:Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$StickyHeadersManager;
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$onAttachedToRecyclerView$1;
|
|
|
|
invoke-direct {v0, p0, p1}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$onAttachedToRecyclerView$1;-><init>(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;Landroidx/recyclerview/widget/RecyclerView;)V
|
|
|
|
invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->addOnLayoutChangeListener(Landroid/view/View$OnLayoutChangeListener;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "recyclerView"
|
|
|
|
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/chat/input/emoji/WidgetEmojiAdapterV2;->onCreateViewHolder(Landroid/view/ViewGroup;I)Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public onCreateViewHolder(Landroid/view/ViewGroup;I)Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/view/ViewGroup;",
|
|
"I)",
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerViewHolder<",
|
|
"Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;",
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
const/4 p1, 0x1
|
|
|
|
if-ne p2, p1, :cond_0
|
|
|
|
new-instance p1, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$EmojiViewHolder;
|
|
|
|
invoke-direct {p1, p0}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$EmojiViewHolder;-><init>(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0, p2}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;->invalidViewTypeException(I)Ljava/lang/IllegalArgumentException;
|
|
|
|
move-result-object p1
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
new-instance p1, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$HeaderViewHolder;
|
|
|
|
invoke-direct {p1, p0}, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2$HeaderViewHolder;-><init>(Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;)V
|
|
|
|
:goto_0
|
|
return-object p1
|
|
|
|
: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 scrollToPosition(I)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onScrollListener:Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;->getRecycler()Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1, v0}, Landroidx/recyclerview/widget/RecyclerView;->removeOnScrollListener(Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;)V
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->layoutManager:Landroidx/recyclerview/widget/GridLayoutManager;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, p1, v1}, Landroidx/recyclerview/widget/LinearLayoutManager;->scrollToPositionWithOffset(II)V
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onScrollListener:Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;->getRecycler()Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1}, Landroidx/recyclerview/widget/RecyclerView;->addOnScrollListener(Landroidx/recyclerview/widget/RecyclerView$OnScrollListener;)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public setData(Ljava/util/List;)V
|
|
.locals 5
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
invoke-super {p0, p1}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;->setData(Ljava/util/List;)V
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
const/4 v2, 0x0
|
|
|
|
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 v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
add-int/lit8 v4, v2, 0x1
|
|
|
|
if-ltz v2, :cond_2
|
|
|
|
check-cast v3, Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;
|
|
|
|
invoke-interface {v3}, Lcom/discord/utilities/mg_recycler/MGRecyclerDataPayload;->getType()I
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
move-object v2, v0
|
|
|
|
:goto_1
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_1
|
|
move v2, v4
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
invoke-static {}, Lf/i/a/b/i1/e;->throwIndexOverflow()V
|
|
|
|
throw v0
|
|
|
|
:cond_3
|
|
iput-object v1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->headerIndices:Ljava/util/List;
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->emojiItemDecoration:Lcom/discord/widgets/chat/input/emoji/EmojiPickerEmojiItemDecoration;
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;->getRecycler()Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1, p1}, Landroidx/recyclerview/widget/RecyclerView;->removeItemDecoration(Landroidx/recyclerview/widget/RecyclerView$ItemDecoration;)V
|
|
|
|
:cond_4
|
|
new-instance p1, Lcom/discord/widgets/chat/input/emoji/EmojiPickerEmojiItemDecoration;
|
|
|
|
iget v1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->numColumns:I
|
|
|
|
iget-object v2, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->headerIndices:Ljava/util/List;
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;->getRecycler()Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroid/view/ViewGroup;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v0
|
|
|
|
const v3, 0x7f0701ee
|
|
|
|
invoke-virtual {v0, v3}, Landroid/content/res/Resources;->getDimension(I)F
|
|
|
|
move-result v0
|
|
|
|
float-to-int v0, v0
|
|
|
|
invoke-direct {p1, v1, v2, v0}, Lcom/discord/widgets/chat/input/emoji/EmojiPickerEmojiItemDecoration;-><init>(ILjava/util/List;I)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/mg_recycler/MGRecyclerAdapter;->getRecycler()Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1}, Landroidx/recyclerview/widget/RecyclerView;->addItemDecoration(Landroidx/recyclerview/widget/RecyclerView$ItemDecoration;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->emojiItemDecoration:Lcom/discord/widgets/chat/input/emoji/EmojiPickerEmojiItemDecoration;
|
|
|
|
return-void
|
|
|
|
:cond_5
|
|
const-string p1, "headerIndices"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_6
|
|
const-string p1, "data"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final setOnScrollPositionListener(Lkotlin/jvm/functions/Function1;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
"-",
|
|
"Ljava/lang/Integer;",
|
|
"Lkotlin/Unit;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/chat/input/emoji/WidgetEmojiAdapterV2;->onScrollPositionListener:Lkotlin/jvm/functions/Function1;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "onScrollPositionListener"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|