apkfuckery/com.discord/smali/androidx/recyclerview/widget/AdapterHelper.smali

1910 lines
51 KiB
Smali
Raw Normal View History

2019-02-04 20:08:30 +00:00
.class Landroidx/recyclerview/widget/AdapterHelper;
.super Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
.source "AdapterHelper.java"
2019-02-04 20:08:30 +00:00
# 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
2019-02-04 20:29:01 +00:00
move v4, v0
2019-02-04 20:08:30 +00:00
const/4 v0, 0x0
2019-02-04 20:29:01 +00:00
const/4 v5, -0x1
2019-02-04 20:08:30 +00:00
: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
2019-02-04 20:29:01 +00:00
if-ne v5, v8, :cond_1
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
iget-object v5, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
invoke-virtual {p0, v6, v4, v0, v5}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
2019-02-04 20:08:30 +00:00
move-result-object v0
invoke-direct {p0, v0}, Landroidx/recyclerview/widget/AdapterHelper;->postponeAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
2019-02-04 20:29:01 +00:00
move v4, v2
2019-02-04 20:08:30 +00:00
const/4 v0, 0x0
:cond_1
2019-02-04 20:29:01 +00:00
const/4 v5, 0x0
2019-02-04 20:08:30 +00:00
goto :goto_2
:cond_2
:goto_1
2019-02-04 20:29:01 +00:00
if-nez v5, :cond_3
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
iget-object v5, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->payload:Ljava/lang/Object;
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
invoke-virtual {p0, v6, v4, v0, v5}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
2019-02-04 20:08:30 +00:00
move-result-object v0
invoke-direct {p0, v0}, Landroidx/recyclerview/widget/AdapterHelper;->dispatchAndUpdateViewHolders(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
2019-02-04 20:29:01 +00:00
move v4, v2
2019-02-04 20:08:30 +00:00
const/4 v0, 0x0
:cond_3
2019-02-04 20:29:01 +00:00
const/4 v5, 0x1
2019-02-04 20:08:30 +00:00
: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
2019-02-04 20:29:01 +00:00
invoke-virtual {p0, v6, v4, v0, v1}, Landroidx/recyclerview/widget/AdapterHelper;->obtainUpdateOp(IIILjava/lang/Object;)Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;
2019-02-04 20:08:30 +00:00
move-result-object p1
:cond_5
2019-02-04 20:29:01 +00:00
if-nez v5, :cond_6
2019-02-04 20:08:30 +00:00
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
2019-02-04 20:29:01 +00:00
if-eq v0, v1, :cond_a
2019-02-04 20:08:30 +00:00
iget v0, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->cmd:I
const/16 v2, 0x8
2019-02-04 20:29:01 +00:00
if-eq v0, v2, :cond_a
2019-02-04 20:08:30 +00:00
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
2019-02-04 20:29:01 +00:00
if-ge v0, v9, :cond_8
2019-02-04 20:08:30 +00:00
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
2019-02-04 20:29:01 +00:00
if-eq v10, v5, :cond_2
2019-02-04 20:08:30 +00:00
const/4 v10, 0x0
2019-02-04 20:29:01 +00:00
goto :goto_2
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
:cond_2
2019-02-04 20:08:30 +00:00
add-int/lit8 v10, v7, 0x1
2019-02-04 20:29:01 +00:00
if-ne v9, v10, :cond_3
2019-02-04 20:08:30 +00:00
const/4 v10, 0x1
2019-02-04 20:29:01 +00:00
goto :goto_2
:cond_3
const/4 v10, 0x0
goto :goto_2
2019-02-04 20:08:30 +00:00
:cond_4
2019-02-04 20:29:01 +00:00
if-ne v9, v7, :cond_5
const/4 v10, 0x1
2019-02-04 20:08:30 +00:00
goto :goto_2
2019-02-04 20:29:01 +00:00
:cond_5
const/4 v10, 0x0
:goto_2
if-eqz v10, :cond_6
2019-02-04 20:08:30 +00:00
add-int/lit8 v2, v2, 0x1
2019-02-04 20:29:01 +00:00
goto :goto_3
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
:cond_6
2019-02-04 20:08:30 +00:00
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
2019-02-04 20:29:01 +00:00
if-ne v7, v5, :cond_7
2019-02-04 20:08:30 +00:00
add-int/2addr v8, v2
2019-02-04 20:29:01 +00:00
:cond_7
2019-02-04 20:08:30 +00:00
move v7, v9
const/4 v2, 0x1
2019-02-04 20:29:01 +00:00
:goto_3
2019-02-04 20:08:30 +00:00
add-int/lit8 v0, v0, 0x1
goto :goto_1
2019-02-04 20:29:01 +00:00
:cond_8
2019-02-04 20:08:30 +00:00
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
2019-02-04 20:29:01 +00:00
if-lez v2, :cond_9
2019-02-04 20:08:30 +00:00
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
2019-02-04 20:29:01 +00:00
:cond_9
2019-02-04 20:08:30 +00:00
return-void
2019-02-04 20:29:01 +00:00
:cond_a
2019-02-04 20:08:30 +00:00
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
throw p1
2019-02-04 20:29:01 +00:00
return-void
2019-02-04 20:08:30 +00:00
.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, 0x4
if-eq v0, v1, :cond_1
const/16 v1, 0x8
if-eq v0, v1, :cond_0
packed-switch v0, :pswitch_data_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
:pswitch_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;->offsetPositionsForRemovingLaidOutOrNewView(II)V
return-void
:pswitch_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 p1, p1, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
invoke-interface {v0, v1, p1}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->offsetPositionsForAdd(II)V
return-void
: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_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
nop
:pswitch_data_0
.packed-switch 0x1
:pswitch_1
:pswitch_0
.end packed-switch
.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
2019-02-04 20:29:01 +00:00
goto :goto_2
2019-02-04 20:08:30 +00:00
:cond_1
if-ne p2, v5, :cond_2
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
sub-int/2addr v2, v1
2019-02-04 20:29:01 +00:00
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
2019-02-04 20:08:30 +00:00
:cond_2
2019-02-04 20:29:01 +00:00
:goto_2
2019-02-04 20:08:30 +00:00
add-int/lit8 p1, p1, 0x1
2019-02-04 20:29:01 +00:00
goto :goto_4
2019-02-04 20:08:30 +00:00
: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
2019-02-04 20:29:01 +00:00
goto :goto_3
2019-02-04 20:08:30 +00:00
:cond_4
if-ne p2, v5, :cond_5
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
sub-int/2addr v2, v1
2019-02-04 20:29:01 +00:00
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
2019-02-04 20:08:30 +00:00
:cond_5
2019-02-04 20:29:01 +00:00
:goto_3
2019-02-04 20:08:30 +00:00
add-int/lit8 p1, p1, -0x1
2019-02-04 20:29:01 +00:00
goto :goto_4
2019-02-04 20:08:30 +00:00
: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
2019-02-04 20:29:01 +00:00
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
goto :goto_4
2019-02-04 20:08:30 +00:00
: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
2019-02-04 20:29:01 +00:00
goto :goto_4
2019-02-04 20:08:30 +00:00
: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
2019-02-04 20:29:01 +00:00
goto :goto_4
2019-02-04 20:08:30 +00:00
: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
2019-02-04 20:29:01 +00:00
goto :goto_4
2019-02-04 20:08:30 +00:00
: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
2019-02-04 20:29:01 +00:00
goto :goto_4
2019-02-04 20:08:30 +00:00
:cond_b
if-ne p2, v5, :cond_c
iget v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
sub-int/2addr v2, v1
2019-02-04 20:29:01 +00:00
iput v2, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
2019-02-04 20:08:30 +00:00
:cond_c
2019-02-04 20:29:01 +00:00
:goto_4
2019-02-04 20:08:30 +00:00
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
2019-02-04 20:29:01 +00:00
:goto_5
2019-02-04 20:08:30 +00:00
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
2019-02-04 20:29:01 +00:00
goto :goto_6
2019-02-04 20:08:30 +00:00
:cond_f
iget v1, v0, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
if-gtz v1, :cond_10
2019-02-04 20:29:01 +00:00
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
2019-02-04 20:08:30 +00:00
:cond_10
2019-02-04 20:29:01 +00:00
:goto_6
2019-02-04 20:08:30 +00:00
add-int/lit8 p2, p2, -0x1
2019-02-04 20:29:01 +00:00
goto :goto_5
2019-02-04 20:08:30 +00:00
: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_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/16 v4, 0x8
if-eq v3, v4, :cond_1
packed-switch v3, :pswitch_data_0
goto :goto_1
:pswitch_0
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-gt v3, p1, :cond_4
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_0
const/4 p1, -0x1
return p1
:cond_0
iget v2, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
sub-int/2addr p1, v2
goto :goto_1
:pswitch_1
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-gt v3, p1, :cond_4
iget v2, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
add-int/2addr p1, v2
goto :goto_1
:cond_1
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-ne v3, p1, :cond_2
iget p1, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
goto :goto_1
:cond_2
iget v3, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->positionStart:I
if-ge v3, p1, :cond_3
add-int/lit8 p1, p1, -0x1
:cond_3
iget v2, v2, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
if-gt v2, p1, :cond_4
add-int/lit8 p1, p1, 0x1
:cond_4
:goto_1
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_5
return p1
nop
:pswitch_data_0
.packed-switch 0x1
:pswitch_1
:pswitch_0
.end packed-switch
.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_3
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, 0x4
if-eq v4, v5, :cond_1
const/16 v5, 0x8
if-eq v4, v5, :cond_0
packed-switch v4, :pswitch_data_0
goto :goto_1
:pswitch_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;->offsetPositionsForRemovingInvisible(II)V
goto :goto_1
:pswitch_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 v3, v3, Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;->itemCount:I
invoke-interface {v4, v5, v3}, Landroidx/recyclerview/widget/AdapterHelper$Callback;->offsetPositionsForAdd(II)V
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_1
iget-object v3, p0, Landroidx/recyclerview/widget/AdapterHelper;->mOnItemProcessedCallback:Ljava/lang/Runnable;
if-eqz v3, :cond_2
invoke-interface {v3}, Ljava/lang/Runnable;->run()V
:cond_2
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_3
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
nop
:pswitch_data_0
.packed-switch 0x1
:pswitch_1
:pswitch_0
.end packed-switch
.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_3
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, 0x4
if-eq v3, v4, :cond_1
const/16 v4, 0x8
if-eq v3, v4, :cond_0
packed-switch v3, :pswitch_data_0
goto :goto_1
:pswitch_0
invoke-direct {p0, v2}, Landroidx/recyclerview/widget/AdapterHelper;->applyRemove(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
goto :goto_1
:pswitch_1
invoke-direct {p0, v2}, Landroidx/recyclerview/widget/AdapterHelper;->applyAdd(Landroidx/recyclerview/widget/AdapterHelper$UpdateOp;)V
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_1
iget-object v2, p0, Landroidx/recyclerview/widget/AdapterHelper;->mOnItemProcessedCallback:Ljava/lang/Runnable;
if-eqz v2, :cond_2
invoke-interface {v2}, Ljava/lang/Runnable;->run()V
:cond_2
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_3
iget-object v0, p0, Landroidx/recyclerview/widget/AdapterHelper;->mPendingUpdates:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
return-void
:pswitch_data_0
.packed-switch 0x1
:pswitch_1
:pswitch_0
.end packed-switch
.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