apkfuckery/com.discord/smali/androidx/recyclerview/widget/AdapterHelper.smali
2019-07-24 13:27:29 +02:00

1899 lines
50 KiB
Smali

.class Landroidx/recyclerview/widget/AdapterHelper;
.super Ljava/lang/Object;
.source "AdapterHelper.java"
# interfaces
.implements Landroidx/recyclerview/widget/OpReorderer$Callback;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/recyclerview/widget/AdapterHelper$Callback;,
Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
}
.end annotation
# static fields
.field private static final DEBUG:Z = false
.field static final POSITION_TYPE_INVISIBLE:I = 0x0
.field static final POSITION_TYPE_NEW_OR_LAID_OUT:I = 0x1
.field private static final TAG:Ljava/lang/String; = "AHT"
# instance fields
.field final mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
.field final mDisableRecycler:Z
.field private mExistingUpdateTypes:I
.field mOnItemProcessedCallback:Ljava/lang/Runnable;
.field final mOpReorderer:Landroidx/recyclerview/widget/OpReorderer;
.field final mPendingUpdates:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList<",
"Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;",
">;"
}
.end annotation
.end field
.field final mPostponedList:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList<",
"Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;",
">;"
}
.end annotation
.end field
.field private mUpdateOpPool:Landroidx/core/util/Pools$Pool;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/core/util/Pools$Pool<",
"Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;",
">;"
}
.end annotation
.end field
# direct methods
.method constructor <init>(Landroidx/recyclerview/widget/AdapterHelper$Callback;)V
.locals 1
const/4 v0, 0x0
invoke-direct {p0, p1, v0}, Landroidx/recyclerview/widget/AdapterHelper;-><init>(Landroidx/recyclerview/widget/AdapterHelper$Callback;Z)V
return-void
.end method
.method constructor <init>(Landroidx/recyclerview/widget/AdapterHelper$Callback;Z)V
.locals 2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Landroidx/core/util/Pools$SimplePool;
const/16 v1, 0x1e
invoke-direct {v0, v1}, Landroidx/core/util/Pools$SimplePool;-><init>(I)V
iput-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mUpdateOpPool:Landroidx/core/util/Pools$Pool;
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
const/4 v0, 0x0
iput v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
iput-object p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iput-boolean p2, p0, Landroidx/recyclerview/widget/AdapterHelper;->mDisableRecycler:Z
new-instance p1, Landroidx/recyclerview/widget/OpReorderer;
invoke-direct {p1, p0}, Landroidx/recyclerview/widget/OpReorderer;-><init>(Landroidx/recyclerview/widget/OpReorderer$Callback;)V
iput-object p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mOpReorderer:Landroidx/recyclerview/widget/OpReorderer;
return-void
.end method
.method private applyAdd(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
.locals 0
invoke-direct {p0, p1}, Landroidx/recyclerview/widget/AdapterHelper;->postponeAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
return-void
.end method
.method private applyMove(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
.locals 0
invoke-direct {p0, p1}, Landroidx/recyclerview/widget/AdapterHelper;->postponeAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
return-void
.end method
.method private applyRemove(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
.locals 10
iget v0, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v2, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr v1, v2
iget v2, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
const/4 v3, 0x0
const/4 v4, -0x1
const/4 v4, 0x0
const/4 v5, -0x1
:goto_0
const/4 v6, 0x0
const/4 v7, 0x2
if-ge v2, v1, :cond_5
iget-object v8, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
invoke-interface {v8, v2}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->findViewHolder(I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
move-result-object v8
const/4 v9, 0x1
if-nez v8, :cond_2
invoke-direct {p0, v2}, Landroidx/recyclerview/widget/AdapterHelper;->canFindInPreLayout(I)Z
move-result v8
if-eqz v8, :cond_0
goto :goto_2
:cond_0
if-ne v5, v9, :cond_1
invoke-virtual {p0, v7, v0, v4, v6}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object v5
invoke-direct {p0, v5}, Landroidx/recyclerview/widget/AdapterHelper;->postponeAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
const/4 v5, 0x1
goto :goto_1
:cond_1
const/4 v5, 0x0
:goto_1
const/4 v6, 0x0
goto :goto_4
:cond_2
:goto_2
if-nez v5, :cond_3
invoke-virtual {p0, v7, v0, v4, v6}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object v5
invoke-direct {p0, v5}, Landroidx/recyclerview/widget/AdapterHelper;->dispatchAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
const/4 v5, 0x1
goto :goto_3
:cond_3
const/4 v5, 0x0
:goto_3
const/4 v6, 0x1
:goto_4
if-eqz v5, :cond_4
sub-int/2addr v2, v4
sub-int/2addr v1, v4
const/4 v4, 0x1
goto :goto_5
:cond_4
add-int/lit8 v4, v4, 0x1
:goto_5
add-int/2addr v2, v9
move v5, v6
goto :goto_0
:cond_5
iget v1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
if-eq v4, v1, :cond_6
invoke-virtual {p0, p1}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOp(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
invoke-virtual {p0, v7, v0, v4, v6}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object p1
:cond_6
if-nez v5, :cond_7
invoke-direct {p0, p1}, Landroidx/recyclerview/widget/AdapterHelper;->dispatchAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
return-void
:cond_7
invoke-direct {p0, p1}, Landroidx/recyclerview/widget/AdapterHelper;->postponeAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
return-void
.end method
.method private applyUpdate(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
.locals 9
iget v0, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v2, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr v1, v2
iget v2, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
const/4 v3, 0x0
const/4 v4, -0x1
move v4, v0
const/4 v0, 0x0
const/4 v5, -0x1
:goto_0
const/4 v6, 0x4
if-ge v2, v1, :cond_4
iget-object v7, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
invoke-interface {v7, v2}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->findViewHolder(I)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
move-result-object v7
const/4 v8, 0x1
if-nez v7, :cond_2
invoke-direct {p0, v2}, Landroidx/recyclerview/widget/AdapterHelper;->canFindInPreLayout(I)Z
move-result v7
if-eqz v7, :cond_0
goto :goto_1
:cond_0
if-ne v5, v8, :cond_1
iget-object v5, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
invoke-virtual {p0, v6, v4, v0, v5}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object v0
invoke-direct {p0, v0}, Landroidx/recyclerview/widget/AdapterHelper;->postponeAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
move v4, v2
const/4 v0, 0x0
:cond_1
const/4 v5, 0x0
goto :goto_2
:cond_2
:goto_1
if-nez v5, :cond_3
iget-object v5, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
invoke-virtual {p0, v6, v4, v0, v5}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object v0
invoke-direct {p0, v0}, Landroidx/recyclerview/widget/AdapterHelper;->dispatchAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
move v4, v2
const/4 v0, 0x0
:cond_3
const/4 v5, 0x1
:goto_2
add-int/2addr v0, v8
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_4
iget v1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
if-eq v0, v1, :cond_5
iget-object v1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
invoke-virtual {p0, p1}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOp(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
invoke-virtual {p0, v6, v4, v0, v1}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object p1
:cond_5
if-nez v5, :cond_6
invoke-direct {p0, p1}, Landroidx/recyclerview/widget/AdapterHelper;->dispatchAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
return-void
:cond_6
invoke-direct {p0, p1}, Landroidx/recyclerview/widget/AdapterHelper;->postponeAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
return-void
.end method
.method private canFindInPreLayout(I)Z
.locals 7
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
const/4 v1, 0x0
const/4 v2, 0x0
:goto_0
if-ge v2, v0, :cond_3
iget-object v3, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v3, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
iget v4, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/16 v5, 0x8
const/4 v6, 0x1
if-ne v4, v5, :cond_0
iget v3, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/lit8 v4, v2, 0x1
invoke-virtual {p0, v3, v4}, Landroidx/recyclerview/widget/AdapterHelper;->findPositionOffset(II)I
move-result v3
if-ne v3, p1, :cond_2
return v6
:cond_0
iget v4, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
if-ne v4, v6, :cond_2
iget v4, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v5, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr v4, v5
iget v3, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
:goto_1
if-ge v3, v4, :cond_2
add-int/lit8 v5, v2, 0x1
invoke-virtual {p0, v3, v5}, Landroidx/recyclerview/widget/AdapterHelper;->findPositionOffset(II)I
move-result v5
if-ne v5, p1, :cond_1
return v6
:cond_1
add-int/lit8 v3, v3, 0x1
goto :goto_1
:cond_2
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_3
return v1
.end method
.method private dispatchAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
.locals 12
iget v0, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/4 v1, 0x1
if-eq v0, v1, :cond_9
iget v0, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/16 v2, 0x8
if-eq v0, v2, :cond_9
iget v0, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v2, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
invoke-direct {p0, v0, v2}, Landroidx/recyclerview/widget/AdapterHelper;->updatePositionWithPostponed(II)I
move-result v0
iget v2, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v3, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/4 v4, 0x2
const/4 v5, 0x4
const/4 v6, 0x0
if-eq v3, v4, :cond_1
if-ne v3, v5, :cond_0
const/4 v3, 0x1
goto :goto_0
:cond_0
new-instance v0, Ljava/lang/IllegalArgumentException;
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p1
const-string v1, "op should be remove or update."
invoke-virtual {v1, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:cond_1
const/4 v3, 0x0
:goto_0
move v7, v0
move v8, v2
const/4 v0, 0x1
const/4 v2, 0x1
:goto_1
iget v9, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
if-ge v0, v9, :cond_7
iget v9, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
mul-int v10, v3, v0
add-int/2addr v9, v10
iget v10, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
invoke-direct {p0, v9, v10}, Landroidx/recyclerview/widget/AdapterHelper;->updatePositionWithPostponed(II)I
move-result v9
iget v10, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
if-eq v10, v4, :cond_4
if-eq v10, v5, :cond_3
:cond_2
const/4 v10, 0x0
goto :goto_3
:cond_3
add-int/lit8 v10, v7, 0x1
if-ne v9, v10, :cond_2
:goto_2
const/4 v10, 0x1
goto :goto_3
:cond_4
if-ne v9, v7, :cond_2
goto :goto_2
:goto_3
if-eqz v10, :cond_5
add-int/lit8 v2, v2, 0x1
goto :goto_4
:cond_5
iget v10, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
iget-object v11, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
invoke-virtual {p0, v10, v7, v2, v11}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object v7
invoke-virtual {p0, v7, v8}, Landroidx/recyclerview/widget/AdapterHelper;->dispatchFirstPassAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;I)V
invoke-virtual {p0, v7}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOp(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
iget v7, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
if-ne v7, v5, :cond_6
add-int/2addr v8, v2
:cond_6
move v7, v9
const/4 v2, 0x1
:goto_4
add-int/lit8 v0, v0, 0x1
goto :goto_1
:cond_7
iget-object v0, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
invoke-virtual {p0, p1}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOp(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
if-lez v2, :cond_8
iget p1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
invoke-virtual {p0, p1, v7, v2, v0}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object p1
invoke-virtual {p0, p1, v8}, Landroidx/recyclerview/widget/AdapterHelper;->dispatchFirstPassAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;I)V
invoke-virtual {p0, p1}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOp(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
:cond_8
return-void
:cond_9
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "should not dispatch add or move for pre layout"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
goto :goto_6
:goto_5
throw p1
:goto_6
goto :goto_5
.end method
.method private postponeAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
.locals 3
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget v0, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/4 v1, 0x1
if-eq v0, v1, :cond_3
const/4 v1, 0x2
if-eq v0, v1, :cond_2
const/4 v1, 0x4
if-eq v0, v1, :cond_1
const/16 v1, 0x8
if-ne v0, v1, :cond_0
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget v1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget p1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
invoke-interface {v0, v1, p1}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->offsetPositionsForMove(II)V
return-void
:cond_0
new-instance v0, Ljava/lang/IllegalArgumentException;
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p1
const-string v1, "Unknown update op type for "
invoke-virtual {v1, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:cond_1
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget v1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v2, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
iget-object p1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
invoke-interface {v0, v1, v2, p1}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->markViewHoldersUpdated(IILjava/lang/Object;)V
return-void
:cond_2
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget v1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget p1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
invoke-interface {v0, v1, p1}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->offsetPositionsForRemovingLaidOutOrNewView(II)V
return-void
:cond_3
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget v1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget p1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
invoke-interface {v0, v1, p1}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->offsetPositionsForAdd(II)V
return-void
.end method
.method private updatePositionWithPostponed(II)I
.locals 6
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
const/4 v1, 0x1
sub-int/2addr v0, v1
:goto_0
const/16 v2, 0x8
if-ltz v0, :cond_d
iget-object v3, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v3, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
iget v4, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/4 v5, 0x2
if-ne v4, v2, :cond_8
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v4, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
if-ge v2, v4, :cond_0
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v4, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
goto :goto_1
:cond_0
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
iget v4, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
:goto_1
if-lt p1, v2, :cond_6
if-gt p1, v4, :cond_6
iget v4, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-ne v2, v4, :cond_3
if-ne p2, v1, :cond_1
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr v2, v1
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
goto :goto_2
:cond_1
if-ne p2, v5, :cond_2
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
sub-int/2addr v2, v1
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
:cond_2
:goto_2
add-int/lit8 p1, p1, 0x1
goto :goto_4
:cond_3
if-ne p2, v1, :cond_4
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
add-int/2addr v2, v1
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
goto :goto_3
:cond_4
if-ne p2, v5, :cond_5
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
sub-int/2addr v2, v1
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
:cond_5
:goto_3
add-int/lit8 p1, p1, -0x1
goto :goto_4
:cond_6
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-ge p1, v2, :cond_c
if-ne p2, v1, :cond_7
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
add-int/2addr v2, v1
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr v2, v1
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
goto :goto_4
:cond_7
if-ne p2, v5, :cond_c
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
sub-int/2addr v2, v1
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
sub-int/2addr v2, v1
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
goto :goto_4
:cond_8
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-gt v2, p1, :cond_a
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
if-ne v2, v1, :cond_9
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
sub-int/2addr p1, v2
goto :goto_4
:cond_9
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
if-ne v2, v5, :cond_c
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr p1, v2
goto :goto_4
:cond_a
if-ne p2, v1, :cond_b
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
add-int/2addr v2, v1
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
goto :goto_4
:cond_b
if-ne p2, v5, :cond_c
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
sub-int/2addr v2, v1
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
:cond_c
:goto_4
add-int/lit8 v0, v0, -0x1
goto/16 :goto_0
:cond_d
iget-object p2, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {p2}, Ljava/util/ArrayList;->size()I
move-result p2
sub-int/2addr p2, v1
:goto_5
if-ltz p2, :cond_11
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v0, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
iget v1, v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
if-ne v1, v2, :cond_f
iget v1, v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
iget v3, v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-eq v1, v3, :cond_e
iget v1, v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
if-gez v1, :cond_10
:cond_e
iget-object v1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v1, p2}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;
invoke-virtual {p0, v0}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOp(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
goto :goto_6
:cond_f
iget v1, v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
if-gtz v1, :cond_10
iget-object v1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v1, p2}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;
invoke-virtual {p0, v0}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOp(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
:cond_10
:goto_6
add-int/lit8 p2, p2, -0x1
goto :goto_5
:cond_11
return p1
.end method
# virtual methods
.method varargs addUpdateOp([Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)Landroidx/recyclerview/widget/AdapterHelper;
.locals 1
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-static {v0, p1}, Ljava/util/Collections;->addAll(Ljava/util/Collection;[Ljava/lang/Object;)Z
return-object p0
.end method
.method public applyPendingUpdatesToPosition(I)I
.locals 5
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
const/4 v1, 0x0
:goto_0
if-ge v1, v0, :cond_7
iget-object v2, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v2, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/4 v4, 0x1
if-eq v3, v4, :cond_5
const/4 v4, 0x2
if-eq v3, v4, :cond_3
const/16 v4, 0x8
if-eq v3, v4, :cond_0
goto :goto_1
:cond_0
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-ne v3, p1, :cond_1
iget p1, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
goto :goto_1
:cond_1
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-ge v3, p1, :cond_2
add-int/lit8 p1, p1, -0x1
:cond_2
iget v2, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
if-gt v2, p1, :cond_6
add-int/lit8 p1, p1, 0x1
goto :goto_1
:cond_3
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-gt v3, p1, :cond_6
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v4, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr v3, v4
if-le v3, p1, :cond_4
const/4 p1, -0x1
return p1
:cond_4
iget v2, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
sub-int/2addr p1, v2
goto :goto_1
:cond_5
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-gt v3, p1, :cond_6
iget v2, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr p1, v2
:cond_6
:goto_1
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_7
return p1
.end method
.method consumePostponedUpdates()V
.locals 5
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
const/4 v1, 0x0
const/4 v2, 0x0
:goto_0
if-ge v2, v0, :cond_0
iget-object v3, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget-object v4, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v4, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v4
check-cast v4, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
invoke-interface {v3, v4}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->onDispatchSecondPass(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_0
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {p0, v0}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOpsAndClearList(Ljava/util/List;)V
iput v1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
return-void
.end method
.method consumeUpdatesInOnePass()V
.locals 7
invoke-virtual {p0}, Landroidx/recyclerview/widget/AdapterHelper;->consumePostponedUpdates()V
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
const/4 v1, 0x0
const/4 v2, 0x0
:goto_0
if-ge v2, v0, :cond_5
iget-object v3, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v3, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
iget v4, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/4 v5, 0x1
if-eq v4, v5, :cond_3
const/4 v5, 0x2
if-eq v4, v5, :cond_2
const/4 v5, 0x4
if-eq v4, v5, :cond_1
const/16 v5, 0x8
if-eq v4, v5, :cond_0
goto :goto_1
:cond_0
iget-object v4, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
invoke-interface {v4, v3}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->onDispatchSecondPass(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
iget-object v4, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget v5, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v3, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
invoke-interface {v4, v5, v3}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->offsetPositionsForMove(II)V
goto :goto_1
:cond_1
iget-object v4, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
invoke-interface {v4, v3}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->onDispatchSecondPass(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
iget-object v4, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget v5, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v6, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
iget-object v3, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
invoke-interface {v4, v5, v6, v3}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->markViewHoldersUpdated(IILjava/lang/Object;)V
goto :goto_1
:cond_2
iget-object v4, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
invoke-interface {v4, v3}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->onDispatchSecondPass(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
iget-object v4, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget v5, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v3, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
invoke-interface {v4, v5, v3}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->offsetPositionsForRemovingInvisible(II)V
goto :goto_1
:cond_3
iget-object v4, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
invoke-interface {v4, v3}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->onDispatchSecondPass(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
iget-object v4, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget v5, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v3, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
invoke-interface {v4, v5, v3}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->offsetPositionsForAdd(II)V
:goto_1
iget-object v3, p0, Landroidx/recyclerview/widget/AdapterHelper;->mOnItemProcessedCallback:Ljava/lang/Runnable;
if-eqz v3, :cond_4
invoke-interface {v3}, Ljava/lang/Runnable;->run()V
:cond_4
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_5
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {p0, v0}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOpsAndClearList(Ljava/util/List;)V
iput v1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
return-void
.end method
.method dispatchFirstPassAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;I)V
.locals 2
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
invoke-interface {v0, p1}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->onDispatchFirstPass(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
iget v0, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/4 v1, 0x2
if-eq v0, v1, :cond_1
const/4 v1, 0x4
if-ne v0, v1, :cond_0
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget v1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
iget-object p1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
invoke-interface {v0, p2, v1, p1}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->markViewHoldersUpdated(IILjava/lang/Object;)V
return-void
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "only remove and update ops can be dispatched in first pass"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
:cond_1
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mCallback:Landroidx/recyclerview/widget/AdapterHelper$Callback;
iget p1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
invoke-interface {v0, p2, p1}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->offsetPositionsForRemovingInvisible(II)V
return-void
.end method
.method findPositionOffset(I)I
.locals 1
const/4 v0, 0x0
invoke-virtual {p0, p1, v0}, Landroidx/recyclerview/widget/AdapterHelper;->findPositionOffset(II)I
move-result p1
return p1
.end method
.method findPositionOffset(II)I
.locals 4
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
:goto_0
if-ge p2, v0, :cond_6
iget-object v1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v1, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
iget v2, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/16 v3, 0x8
if-ne v2, v3, :cond_2
iget v2, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-ne v2, p1, :cond_0
iget p1, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
goto :goto_1
:cond_0
iget v2, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-ge v2, p1, :cond_1
add-int/lit8 p1, p1, -0x1
:cond_1
iget v1, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
if-gt v1, p1, :cond_5
add-int/lit8 p1, p1, 0x1
goto :goto_1
:cond_2
iget v2, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-gt v2, p1, :cond_5
iget v2, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/4 v3, 0x2
if-ne v2, v3, :cond_4
iget v2, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iget v3, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr v2, v3
if-ge p1, v2, :cond_3
const/4 p1, -0x1
return p1
:cond_3
iget v1, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
sub-int/2addr p1, v1
goto :goto_1
:cond_4
iget v2, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/4 v3, 0x1
if-ne v2, v3, :cond_5
iget v1, v1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr p1, v1
:cond_5
:goto_1
add-int/lit8 p2, p2, 0x1
goto :goto_0
:cond_6
return p1
.end method
.method hasAnyUpdateTypes(I)Z
.locals 1
iget v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
and-int/2addr p1, v0
if-eqz p1, :cond_0
const/4 p1, 0x1
return p1
:cond_0
const/4 p1, 0x0
return p1
.end method
.method hasPendingUpdates()Z
.locals 1
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
if-lez v0, :cond_0
const/4 v0, 0x1
return v0
:cond_0
const/4 v0, 0x0
return v0
.end method
.method hasUpdates()Z
.locals 1
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->isEmpty()Z
move-result v0
if-nez v0, :cond_0
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->isEmpty()Z
move-result v0
if-nez v0, :cond_0
const/4 v0, 0x1
return v0
:cond_0
const/4 v0, 0x0
return v0
.end method
.method public obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
.locals 1
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mUpdateOpPool:Landroidx/core/util/Pools$Pool;
invoke-interface {v0}, Landroidx/core/util/Pools$Pool;->acquire()Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
if-nez v0, :cond_0
new-instance v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
invoke-direct {v0, p1, p2, p3, p4}, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;-><init>(IIILjava/lang/Object;)V
goto :goto_0
:cond_0
iput p1, v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
iput p2, v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
iput p3, v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
iput-object p4, v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
:goto_0
return-object v0
.end method
.method onItemRangeChanged(IILjava/lang/Object;)Z
.locals 3
const/4 v0, 0x0
if-gtz p2, :cond_0
return v0
:cond_0
iget-object v1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
const/4 v2, 0x4
invoke-virtual {p0, v2, p1, p2, p3}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object p1
invoke-virtual {v1, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
or-int/2addr p1, v2
iput p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
iget-object p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {p1}, Ljava/util/ArrayList;->size()I
move-result p1
const/4 p2, 0x1
if-ne p1, p2, :cond_1
return p2
:cond_1
return v0
.end method
.method onItemRangeInserted(II)Z
.locals 4
const/4 v0, 0x0
if-gtz p2, :cond_0
return v0
:cond_0
iget-object v1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
const/4 v2, 0x0
const/4 v3, 0x1
invoke-virtual {p0, v3, p1, p2, v2}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object p1
invoke-virtual {v1, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
or-int/2addr p1, v3
iput p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
iget-object p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {p1}, Ljava/util/ArrayList;->size()I
move-result p1
if-ne p1, v3, :cond_1
return v3
:cond_1
return v0
.end method
.method onItemRangeMoved(III)Z
.locals 4
const/4 v0, 0x0
if-ne p1, p2, :cond_0
return v0
:cond_0
const/4 v1, 0x1
if-ne p3, v1, :cond_2
iget-object p3, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
const/4 v2, 0x0
const/16 v3, 0x8
invoke-virtual {p0, v3, p1, p2, v2}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object p1
invoke-virtual {p3, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
or-int/2addr p1, v3
iput p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
iget-object p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {p1}, Ljava/util/ArrayList;->size()I
move-result p1
if-ne p1, v1, :cond_1
return v1
:cond_1
return v0
:cond_2
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "Moving more than 1 item is not supported yet"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method onItemRangeRemoved(II)Z
.locals 4
const/4 v0, 0x0
if-gtz p2, :cond_0
return v0
:cond_0
iget-object v1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
const/4 v2, 0x0
const/4 v3, 0x2
invoke-virtual {p0, v3, p1, p2, v2}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
move-result-object p1
invoke-virtual {v1, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
or-int/2addr p1, v3
iput p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
iget-object p1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {p1}, Ljava/util/ArrayList;->size()I
move-result p1
const/4 p2, 0x1
if-ne p1, p2, :cond_1
return p2
:cond_1
return v0
.end method
.method preProcess()V
.locals 5
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mOpReorderer:Landroidx/recyclerview/widget/OpReorderer;
iget-object v1, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v0, v1}, Landroidx/recyclerview/widget/OpReorderer;->reorderOps(Ljava/util/List;)V
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
move-result v0
const/4 v1, 0x0
:goto_0
if-ge v1, v0, :cond_5
iget-object v2, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v2, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/4 v4, 0x1
if-eq v3, v4, :cond_3
const/4 v4, 0x2
if-eq v3, v4, :cond_2
const/4 v4, 0x4
if-eq v3, v4, :cond_1
const/16 v4, 0x8
if-eq v3, v4, :cond_0
goto :goto_1
:cond_0
invoke-direct {p0, v2}, Landroidx/recyclerview/widget/AdapterHelper;->applyMove(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
goto :goto_1
:cond_1
invoke-direct {p0, v2}, Landroidx/recyclerview/widget/AdapterHelper;->applyUpdate(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
goto :goto_1
:cond_2
invoke-direct {p0, v2}, Landroidx/recyclerview/widget/AdapterHelper;->applyRemove(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
goto :goto_1
:cond_3
invoke-direct {p0, v2}, Landroidx/recyclerview/widget/AdapterHelper;->applyAdd(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
:goto_1
iget-object v2, p0, Landroidx/recyclerview/widget/AdapterHelper;->mOnItemProcessedCallback:Ljava/lang/Runnable;
if-eqz v2, :cond_4
invoke-interface {v2}, Ljava/lang/Runnable;->run()V
:cond_4
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_5
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
return-void
.end method
.method public recycleUpdateOp(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
.locals 1
iget-boolean v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mDisableRecycler:Z
if-nez v0, :cond_0
const/4 v0, 0x0
iput-object v0, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mUpdateOpPool:Landroidx/core/util/Pools$Pool;
invoke-interface {v0, p1}, Landroidx/core/util/Pools$Pool;->release(Ljava/lang/Object;)Z
:cond_0
return-void
.end method
.method recycleUpdateOpsAndClearList(Ljava/util/List;)V
.locals 3
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;",
">;)V"
}
.end annotation
invoke-interface {p1}, Ljava/util/List;->size()I
move-result v0
const/4 v1, 0x0
:goto_0
if-ge v1, v0, :cond_0
invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
invoke-virtual {p0, v2}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOp(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_0
invoke-interface {p1}, Ljava/util/List;->clear()V
return-void
.end method
.method reset()V
.locals 1
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {p0, v0}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOpsAndClearList(Ljava/util/List;)V
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPostponedList:Ljava/util/ArrayList;
invoke-virtual {p0, v0}, Landroidx/recyclerview/widget/AdapterHelper;->recycleUpdateOpsAndClearList(Ljava/util/List;)V
const/4 v0, 0x0
iput v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mExistingUpdateTypes:I
return-void
.end method