279 lines
6.3 KiB
Smali
279 lines
6.3 KiB
Smali
.class public final Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;
|
|
.super Landroidx/recyclerview/widget/RecyclerView$ItemDecoration;
|
|
.source "ExpressionPickerItemDecoration.kt"
|
|
|
|
|
|
# instance fields
|
|
.field public final bottomPaddingForLastRow:I
|
|
|
|
.field public final headerIndices:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final numOfColumns:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(ILjava/util/List;I)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(I",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/Integer;",
|
|
">;I)V"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "headerIndices"
|
|
|
|
invoke-static {p2, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0}, Landroidx/recyclerview/widget/RecyclerView$ItemDecoration;-><init>()V
|
|
|
|
iput p1, p0, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->numOfColumns:I
|
|
|
|
iput-object p2, p0, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->headerIndices:Ljava/util/List;
|
|
|
|
iput p3, p0, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->bottomPaddingForLastRow:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getHeaderPositionForItem(I)I
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->headerIndices:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/List;->listIterator(I)Ljava/util/ListIterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_0
|
|
invoke-interface {v0}, Ljava/util/ListIterator;->hasPrevious()Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {v0}, Ljava/util/ListIterator;->previous()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
move-object v3, v1
|
|
|
|
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
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v1, 0x0
|
|
|
|
:goto_1
|
|
check-cast v1, Ljava/lang/Integer;
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v2
|
|
|
|
:cond_3
|
|
return v2
|
|
.end method
|
|
|
|
.method private final getNextHeaderPositionForItem(I)Ljava/lang/Integer;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->headerIndices:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
move-object v2, v1
|
|
|
|
check-cast v2, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/Number;->intValue()I
|
|
|
|
move-result v2
|
|
|
|
if-gt p1, v2, :cond_1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v2, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v1, 0x0
|
|
|
|
:goto_1
|
|
check-cast v1, Ljava/lang/Integer;
|
|
|
|
return-object v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getItemOffsets(Landroid/graphics/Rect;Landroid/view/View;Landroidx/recyclerview/widget/RecyclerView;Landroidx/recyclerview/widget/RecyclerView$State;)V
|
|
.locals 3
|
|
|
|
const-string v0, "outRect"
|
|
|
|
invoke-static {p1, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string/jumbo v0, "view"
|
|
|
|
invoke-static {p2, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "parent"
|
|
|
|
invoke-static {p3, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "state"
|
|
|
|
invoke-static {p4, v0}, Lb0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-super {p0, p1, p2, p3, p4}, Landroidx/recyclerview/widget/RecyclerView$ItemDecoration;->getItemOffsets(Landroid/graphics/Rect;Landroid/view/View;Landroidx/recyclerview/widget/RecyclerView;Landroidx/recyclerview/widget/RecyclerView$State;)V
|
|
|
|
invoke-virtual {p3, p2}, Landroidx/recyclerview/widget/RecyclerView;->getChildAdapterPosition(Landroid/view/View;)I
|
|
|
|
move-result p2
|
|
|
|
iget-object p3, p0, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->headerIndices:Ljava/util/List;
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {p3, v0}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result p3
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p2}, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->getHeaderPositionForItem(I)I
|
|
|
|
move-result p3
|
|
|
|
invoke-direct {p0, p2}, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->getNextHeaderPositionForItem(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p4
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {p4}, Landroidx/recyclerview/widget/RecyclerView$State;->getItemCount()I
|
|
|
|
move-result p4
|
|
|
|
:goto_0
|
|
sub-int/2addr p4, p3
|
|
|
|
const/4 v0, 0x1
|
|
|
|
sub-int/2addr p4, v0
|
|
|
|
sub-int/2addr p2, p3
|
|
|
|
sub-int/2addr p2, v0
|
|
|
|
iget p3, p0, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->numOfColumns:I
|
|
|
|
rem-int p3, p4, p3
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez p3, :cond_2
|
|
|
|
const/4 p3, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 p3, 0x0
|
|
|
|
:goto_1
|
|
iget v2, p0, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->numOfColumns:I
|
|
|
|
div-int/2addr p4, v2
|
|
|
|
sub-int/2addr p4, p3
|
|
|
|
mul-int p4, p4, v2
|
|
|
|
if-lt p2, p4, :cond_3
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
const/4 v0, 0x0
|
|
|
|
:goto_2
|
|
if-eqz v0, :cond_4
|
|
|
|
iget v1, p0, Lcom/discord/widgets/chat/input/ExpressionPickerItemDecoration;->bottomPaddingForLastRow:I
|
|
|
|
:cond_4
|
|
iput v1, p1, Landroid/graphics/Rect;->bottom:I
|
|
|
|
return-void
|
|
.end method
|