apkfuckery/com.discord/smali/androidx/recyclerview/widget/DiffUtil$DiffResult.smali

1213 lines
29 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public Landroidx/recyclerview/widget/DiffUtil$DiffResult;
.super Ljava/lang/Object;
.source "DiffUtil.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/recyclerview/widget/DiffUtil;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "DiffResult"
.end annotation
# static fields
2019-12-06 03:29:40 +00:00
.field public static final FLAG_CHANGED:I = 0x2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final FLAG_IGNORE:I = 0x10
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final FLAG_MASK:I = 0x1f
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final FLAG_MOVED_CHANGED:I = 0x4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final FLAG_MOVED_NOT_CHANGED:I = 0x8
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final FLAG_NOT_CHANGED:I = 0x1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final FLAG_OFFSET:I = 0x5
2019-07-24 11:27:29 +00:00
.field public static final NO_POSITION:I = -0x1
# instance fields
2019-12-06 03:29:40 +00:00
.field public final mCallback:Landroidx/recyclerview/widget/DiffUtil$Callback;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mDetectMoves:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mNewItemStatuses:[I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mNewListSize:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mOldItemStatuses:[I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mOldListSize:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mSnakes:Ljava/util/List;
2019-07-24 11:27:29 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Landroidx/recyclerview/widget/DiffUtil$Snake;",
">;"
}
.end annotation
.end field
# direct methods
2019-12-06 03:29:40 +00:00
.method public constructor <init>(Landroidx/recyclerview/widget/DiffUtil$Callback;Ljava/util/List;[I[IZ)V
2019-07-24 11:27:29 +00:00
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroidx/recyclerview/widget/DiffUtil$Callback;",
"Ljava/util/List<",
"Landroidx/recyclerview/widget/DiffUtil$Snake;",
">;[I[IZ)V"
}
.end annotation
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p2, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mSnakes:Ljava/util/List;
iput-object p3, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldItemStatuses:[I
iput-object p4, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewItemStatuses:[I
iget-object p2, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldItemStatuses:[I
const/4 p3, 0x0
invoke-static {p2, p3}, Ljava/util/Arrays;->fill([II)V
iget-object p2, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewItemStatuses:[I
invoke-static {p2, p3}, Ljava/util/Arrays;->fill([II)V
iput-object p1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mCallback:Landroidx/recyclerview/widget/DiffUtil$Callback;
invoke-virtual {p1}, Landroidx/recyclerview/widget/DiffUtil$Callback;->getOldListSize()I
move-result p2
iput p2, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldListSize:I
invoke-virtual {p1}, Landroidx/recyclerview/widget/DiffUtil$Callback;->getNewListSize()I
move-result p1
iput p1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewListSize:I
iput-boolean p5, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mDetectMoves:Z
invoke-direct {p0}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->addRootSnake()V
invoke-direct {p0}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->findMatchingItems()V
return-void
.end method
.method private addRootSnake()V
.locals 3
iget-object v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mSnakes:Ljava/util/List;
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
move-result v0
const/4 v1, 0x0
if-eqz v0, :cond_0
const/4 v0, 0x0
goto :goto_0
:cond_0
iget-object v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mSnakes:Ljava/util/List;
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroidx/recyclerview/widget/DiffUtil$Snake;
:goto_0
if-eqz v0, :cond_1
iget v2, v0, Landroidx/recyclerview/widget/DiffUtil$Snake;->x:I
if-nez v2, :cond_1
iget v0, v0, Landroidx/recyclerview/widget/DiffUtil$Snake;->y:I
if-eqz v0, :cond_2
:cond_1
new-instance v0, Landroidx/recyclerview/widget/DiffUtil$Snake;
invoke-direct {v0}, Landroidx/recyclerview/widget/DiffUtil$Snake;-><init>()V
iput v1, v0, Landroidx/recyclerview/widget/DiffUtil$Snake;->x:I
iput v1, v0, Landroidx/recyclerview/widget/DiffUtil$Snake;->y:I
iput-boolean v1, v0, Landroidx/recyclerview/widget/DiffUtil$Snake;->removal:Z
iput v1, v0, Landroidx/recyclerview/widget/DiffUtil$Snake;->size:I
iput-boolean v1, v0, Landroidx/recyclerview/widget/DiffUtil$Snake;->reverse:Z
iget-object v2, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mSnakes:Ljava/util/List;
invoke-interface {v2, v1, v0}, Ljava/util/List;->add(ILjava/lang/Object;)V
:cond_2
return-void
.end method
.method private dispatchAdditions(Ljava/util/List;Landroidx/recyclerview/widget/ListUpdateCallback;III)V
.locals 6
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;",
">;",
"Landroidx/recyclerview/widget/ListUpdateCallback;",
"III)V"
}
.end annotation
iget-boolean v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mDetectMoves:Z
if-nez v0, :cond_0
invoke-interface {p2, p3, p4}, Landroidx/recyclerview/widget/ListUpdateCallback;->onInserted(II)V
return-void
:cond_0
const/4 v0, 0x1
sub-int/2addr p4, v0
:goto_0
if-ltz p4, :cond_5
iget-object v1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewItemStatuses:[I
add-int v2, p5, p4
aget v1, v1, v2
and-int/lit8 v1, v1, 0x1f
if-eqz v1, :cond_3
const/4 v3, 0x4
if-eq v1, v3, :cond_2
const/16 v4, 0x8
if-eq v1, v4, :cond_2
const/16 v3, 0x10
if-ne v1, v3, :cond_1
new-instance v1, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;
const/4 v3, 0x0
invoke-direct {v1, v2, p3, v3}, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;-><init>(IIZ)V
invoke-interface {p1, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_2
:cond_1
new-instance p1, Ljava/lang/IllegalStateException;
2019-12-06 03:29:40 +00:00
const-string p2, "unknown flag for pos "
2019-07-24 11:27:29 +00:00
const-string p3, " "
2020-05-11 19:22:21 +00:00
invoke-static {p2, v2, p3}, Lf/e/b/a/a;->b(Ljava/lang/String;ILjava/lang/String;)Ljava/lang/StringBuilder;
2019-12-06 03:29:40 +00:00
move-result-object p2
2019-07-24 11:27:29 +00:00
int-to-long p3, v1
invoke-static {p3, p4}, Ljava/lang/Long;->toBinaryString(J)Ljava/lang/String;
move-result-object p3
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:cond_2
iget-object v4, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewItemStatuses:[I
aget v4, v4, v2
shr-int/lit8 v4, v4, 0x5
invoke-static {p1, v4, v0}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->removePostponedUpdate(Ljava/util/List;IZ)Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;
move-result-object v5
iget v5, v5, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->currentPos:I
invoke-interface {p2, v5, p3}, Landroidx/recyclerview/widget/ListUpdateCallback;->onMoved(II)V
if-ne v1, v3, :cond_4
iget-object v1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mCallback:Landroidx/recyclerview/widget/DiffUtil$Callback;
invoke-virtual {v1, v4, v2}, Landroidx/recyclerview/widget/DiffUtil$Callback;->getChangePayload(II)Ljava/lang/Object;
move-result-object v1
invoke-interface {p2, p3, v0, v1}, Landroidx/recyclerview/widget/ListUpdateCallback;->onChanged(IILjava/lang/Object;)V
goto :goto_2
:cond_3
invoke-interface {p2, p3, v0}, Landroidx/recyclerview/widget/ListUpdateCallback;->onInserted(II)V
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v1
:goto_1
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_4
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;
iget v3, v2, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->currentPos:I
add-int/2addr v3, v0
iput v3, v2, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->currentPos:I
goto :goto_1
:cond_4
:goto_2
add-int/lit8 p4, p4, -0x1
goto :goto_0
:cond_5
return-void
.end method
.method private dispatchRemovals(Ljava/util/List;Landroidx/recyclerview/widget/ListUpdateCallback;III)V
.locals 8
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;",
">;",
"Landroidx/recyclerview/widget/ListUpdateCallback;",
"III)V"
}
.end annotation
iget-boolean v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mDetectMoves:Z
if-nez v0, :cond_0
invoke-interface {p2, p3, p4}, Landroidx/recyclerview/widget/ListUpdateCallback;->onRemoved(II)V
return-void
:cond_0
const/4 v0, 0x1
sub-int/2addr p4, v0
:goto_0
if-ltz p4, :cond_5
iget-object v1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldItemStatuses:[I
add-int v2, p5, p4
aget v1, v1, v2
and-int/lit8 v1, v1, 0x1f
if-eqz v1, :cond_3
const/4 v3, 0x4
if-eq v1, v3, :cond_2
const/16 v4, 0x8
if-eq v1, v4, :cond_2
const/16 v3, 0x10
if-ne v1, v3, :cond_1
new-instance v1, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;
add-int v3, p3, p4
invoke-direct {v1, v2, v3, v0}, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;-><init>(IIZ)V
invoke-interface {p1, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_2
:cond_1
new-instance p1, Ljava/lang/IllegalStateException;
2019-12-06 03:29:40 +00:00
const-string p2, "unknown flag for pos "
2019-07-24 11:27:29 +00:00
const-string p3, " "
2020-05-11 19:22:21 +00:00
invoke-static {p2, v2, p3}, Lf/e/b/a/a;->b(Ljava/lang/String;ILjava/lang/String;)Ljava/lang/StringBuilder;
2019-12-06 03:29:40 +00:00
move-result-object p2
2019-07-24 11:27:29 +00:00
int-to-long p3, v1
invoke-static {p3, p4}, Ljava/lang/Long;->toBinaryString(J)Ljava/lang/String;
move-result-object p3
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
:cond_2
iget-object v4, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldItemStatuses:[I
aget v4, v4, v2
shr-int/lit8 v4, v4, 0x5
const/4 v5, 0x0
invoke-static {p1, v4, v5}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->removePostponedUpdate(Ljava/util/List;IZ)Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;
move-result-object v5
add-int v6, p3, p4
iget v7, v5, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->currentPos:I
sub-int/2addr v7, v0
invoke-interface {p2, v6, v7}, Landroidx/recyclerview/widget/ListUpdateCallback;->onMoved(II)V
if-ne v1, v3, :cond_4
iget v1, v5, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->currentPos:I
sub-int/2addr v1, v0
iget-object v3, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mCallback:Landroidx/recyclerview/widget/DiffUtil$Callback;
invoke-virtual {v3, v2, v4}, Landroidx/recyclerview/widget/DiffUtil$Callback;->getChangePayload(II)Ljava/lang/Object;
move-result-object v2
invoke-interface {p2, v1, v0, v2}, Landroidx/recyclerview/widget/ListUpdateCallback;->onChanged(IILjava/lang/Object;)V
goto :goto_2
:cond_3
add-int v1, p3, p4
invoke-interface {p2, v1, v0}, Landroidx/recyclerview/widget/ListUpdateCallback;->onRemoved(II)V
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v1
:goto_1
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_4
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;
iget v3, v2, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->currentPos:I
sub-int/2addr v3, v0
iput v3, v2, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->currentPos:I
goto :goto_1
:cond_4
:goto_2
add-int/lit8 p4, p4, -0x1
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_5
return-void
.end method
.method private findAddition(III)V
.locals 2
iget-object v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldItemStatuses:[I
add-int/lit8 v1, p1, -0x1
aget v0, v0, v1
if-eqz v0, :cond_0
return-void
:cond_0
const/4 v0, 0x0
invoke-direct {p0, p1, p2, p3, v0}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->findMatchingItem(IIIZ)Z
return-void
.end method
.method private findMatchingItem(IIIZ)Z
.locals 8
if-eqz p4, :cond_0
add-int/lit8 p2, p2, -0x1
move v0, p1
move v1, p2
goto :goto_0
:cond_0
add-int/lit8 v0, p1, -0x1
move v1, v0
:goto_0
if-ltz p3, :cond_7
iget-object v2, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mSnakes:Ljava/util/List;
invoke-interface {v2, p3}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/recyclerview/widget/DiffUtil$Snake;
iget v3, v2, Landroidx/recyclerview/widget/DiffUtil$Snake;->x:I
iget v4, v2, Landroidx/recyclerview/widget/DiffUtil$Snake;->size:I
add-int/2addr v3, v4
2019-12-06 03:29:40 +00:00
iget v5, v2, Landroidx/recyclerview/widget/DiffUtil$Snake;->y:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr v5, v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/16 v4, 0x8
2019-07-24 11:27:29 +00:00
const/4 v6, 0x4
const/4 v7, 0x1
if-eqz p4, :cond_3
sub-int/2addr v0, v7
:goto_1
if-lt v0, v3, :cond_6
iget-object p2, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mCallback:Landroidx/recyclerview/widget/DiffUtil$Callback;
invoke-virtual {p2, v0, v1}, Landroidx/recyclerview/widget/DiffUtil$Callback;->areItemsTheSame(II)Z
move-result p2
if-eqz p2, :cond_2
iget-object p1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mCallback:Landroidx/recyclerview/widget/DiffUtil$Callback;
invoke-virtual {p1, v0, v1}, Landroidx/recyclerview/widget/DiffUtil$Callback;->areContentsTheSame(II)Z
move-result p1
if-eqz p1, :cond_1
goto :goto_2
:cond_1
2019-12-06 03:29:40 +00:00
const/4 v4, 0x4
2019-07-24 11:27:29 +00:00
:goto_2
iget-object p1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewItemStatuses:[I
shl-int/lit8 p2, v0, 0x5
or-int/lit8 p2, p2, 0x10
aput p2, p1, v1
iget-object p1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldItemStatuses:[I
shl-int/lit8 p2, v1, 0x5
2019-12-06 03:29:40 +00:00
or-int/2addr p2, v4
2019-07-24 11:27:29 +00:00
aput p2, p1, v0
return v7
:cond_2
add-int/lit8 v0, v0, -0x1
goto :goto_1
:cond_3
sub-int/2addr p2, v7
:goto_3
2019-12-06 03:29:40 +00:00
if-lt p2, v5, :cond_6
2019-07-24 11:27:29 +00:00
iget-object v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mCallback:Landroidx/recyclerview/widget/DiffUtil$Callback;
invoke-virtual {v0, v1, p2}, Landroidx/recyclerview/widget/DiffUtil$Callback;->areItemsTheSame(II)Z
move-result v0
if-eqz v0, :cond_5
iget-object p3, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mCallback:Landroidx/recyclerview/widget/DiffUtil$Callback;
invoke-virtual {p3, v1, p2}, Landroidx/recyclerview/widget/DiffUtil$Callback;->areContentsTheSame(II)Z
move-result p3
if-eqz p3, :cond_4
goto :goto_4
:cond_4
2019-12-06 03:29:40 +00:00
const/4 v4, 0x4
2019-07-24 11:27:29 +00:00
:goto_4
iget-object p3, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldItemStatuses:[I
sub-int/2addr p1, v7
shl-int/lit8 p4, p2, 0x5
or-int/lit8 p4, p4, 0x10
aput p4, p3, p1
iget-object p3, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewItemStatuses:[I
shl-int/lit8 p1, p1, 0x5
2019-12-06 03:29:40 +00:00
or-int/2addr p1, v4
2019-07-24 11:27:29 +00:00
aput p1, p3, p2
return v7
:cond_5
add-int/lit8 p2, p2, -0x1
goto :goto_3
:cond_6
iget v0, v2, Landroidx/recyclerview/widget/DiffUtil$Snake;->x:I
iget p2, v2, Landroidx/recyclerview/widget/DiffUtil$Snake;->y:I
add-int/lit8 p3, p3, -0x1
goto :goto_0
:cond_7
const/4 p1, 0x0
return p1
.end method
.method private findMatchingItems()V
.locals 9
iget v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldListSize:I
iget v1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewListSize:I
iget-object v2, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mSnakes:Ljava/util/List;
invoke-interface {v2}, Ljava/util/List;->size()I
move-result v2
const/4 v3, 0x1
sub-int/2addr v2, v3
:goto_0
if-ltz v2, :cond_4
iget-object v4, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mSnakes:Ljava/util/List;
invoke-interface {v4, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v4
check-cast v4, Landroidx/recyclerview/widget/DiffUtil$Snake;
iget v5, v4, Landroidx/recyclerview/widget/DiffUtil$Snake;->x:I
iget v6, v4, Landroidx/recyclerview/widget/DiffUtil$Snake;->size:I
add-int/2addr v5, v6
2019-12-06 03:29:40 +00:00
iget v7, v4, Landroidx/recyclerview/widget/DiffUtil$Snake;->y:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr v7, v6
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-boolean v6, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mDetectMoves:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-eqz v6, :cond_1
2019-07-24 11:27:29 +00:00
:goto_1
if-le v0, v5, :cond_0
invoke-direct {p0, v0, v1, v2}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->findAddition(III)V
add-int/lit8 v0, v0, -0x1
goto :goto_1
:cond_0
:goto_2
2019-12-06 03:29:40 +00:00
if-le v1, v7, :cond_1
2019-07-24 11:27:29 +00:00
invoke-direct {p0, v0, v1, v2}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->findRemoval(III)V
add-int/lit8 v1, v1, -0x1
goto :goto_2
:cond_1
const/4 v0, 0x0
:goto_3
iget v1, v4, Landroidx/recyclerview/widget/DiffUtil$Snake;->size:I
if-ge v0, v1, :cond_3
iget v1, v4, Landroidx/recyclerview/widget/DiffUtil$Snake;->x:I
add-int/2addr v1, v0
iget v5, v4, Landroidx/recyclerview/widget/DiffUtil$Snake;->y:I
add-int/2addr v5, v0
iget-object v6, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mCallback:Landroidx/recyclerview/widget/DiffUtil$Callback;
invoke-virtual {v6, v1, v5}, Landroidx/recyclerview/widget/DiffUtil$Callback;->areContentsTheSame(II)Z
move-result v6
if-eqz v6, :cond_2
const/4 v6, 0x1
goto :goto_4
:cond_2
const/4 v6, 0x2
:goto_4
iget-object v7, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldItemStatuses:[I
shl-int/lit8 v8, v5, 0x5
or-int/2addr v8, v6
aput v8, v7, v1
iget-object v7, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewItemStatuses:[I
shl-int/lit8 v1, v1, 0x5
or-int/2addr v1, v6
aput v1, v7, v5
add-int/lit8 v0, v0, 0x1
goto :goto_3
:cond_3
iget v0, v4, Landroidx/recyclerview/widget/DiffUtil$Snake;->x:I
iget v1, v4, Landroidx/recyclerview/widget/DiffUtil$Snake;->y:I
add-int/lit8 v2, v2, -0x1
goto :goto_0
:cond_4
return-void
.end method
.method private findRemoval(III)V
.locals 2
iget-object v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewItemStatuses:[I
add-int/lit8 v1, p2, -0x1
aget v0, v0, v1
if-eqz v0, :cond_0
return-void
:cond_0
const/4 v0, 0x1
invoke-direct {p0, p1, p2, p3, v0}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->findMatchingItem(IIIZ)Z
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public static removePostponedUpdate(Ljava/util/List;IZ)Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;
2019-07-24 11:27:29 +00:00
.locals 5
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;",
">;IZ)",
"Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;"
}
.end annotation
invoke-interface {p0}, Ljava/util/List;->size()I
move-result v0
const/4 v1, 0x1
sub-int/2addr v0, v1
:goto_0
if-ltz v0, :cond_3
invoke-interface {p0, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;
iget v3, v2, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->posInOwnerList:I
if-ne v3, p1, :cond_2
iget-boolean v3, v2, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->removal:Z
if-ne v3, p2, :cond_2
invoke-interface {p0, v0}, Ljava/util/List;->remove(I)Ljava/lang/Object;
:goto_1
invoke-interface {p0}, Ljava/util/List;->size()I
move-result p1
if-ge v0, p1, :cond_1
invoke-interface {p0, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object p1
check-cast p1, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;
iget v3, p1, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->currentPos:I
if-eqz p2, :cond_0
const/4 v4, 0x1
goto :goto_2
:cond_0
const/4 v4, -0x1
:goto_2
add-int/2addr v3, v4
iput v3, p1, Landroidx/recyclerview/widget/DiffUtil$PostponedUpdate;->currentPos:I
add-int/lit8 v0, v0, 0x1
goto :goto_1
:cond_1
return-object v2
:cond_2
add-int/lit8 v0, v0, -0x1
goto :goto_0
:cond_3
const/4 p0, 0x0
return-object p0
.end method
# virtual methods
.method public convertNewPositionToOld(I)I
.locals 3
2019-12-06 03:29:40 +00:00
.param p1 # I
.annotation build Landroidx/annotation/IntRange;
from = 0x0L
.end annotation
.end param
2019-07-24 11:27:29 +00:00
if-ltz p1, :cond_1
2019-12-06 03:29:40 +00:00
iget v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewListSize:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-ge p1, v0, :cond_1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewItemStatuses:[I
2019-07-24 11:27:29 +00:00
aget p1, v0, p1
and-int/lit8 v0, p1, 0x1f
if-nez v0, :cond_0
const/4 p1, -0x1
return p1
:cond_0
shr-int/lit8 p1, p1, 0x5
return p1
:cond_1
new-instance v0, Ljava/lang/IndexOutOfBoundsException;
2019-12-06 03:29:40 +00:00
const-string v1, "Index out of bounds - passed position = "
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const-string v2, ", new list size = "
2019-07-24 11:27:29 +00:00
2020-05-11 19:22:21 +00:00
invoke-static {v1, p1, v2}, Lf/e/b/a/a;->b(Ljava/lang/String;ILjava/lang/String;)Ljava/lang/StringBuilder;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object p1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget v1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewListSize:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
2019-07-24 11:27:29 +00:00
move-result-object p1
invoke-direct {v0, p1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public convertOldPositionToNew(I)I
.locals 3
2019-12-06 03:29:40 +00:00
.param p1 # I
.annotation build Landroidx/annotation/IntRange;
from = 0x0L
.end annotation
.end param
2019-07-24 11:27:29 +00:00
if-ltz p1, :cond_1
2019-12-06 03:29:40 +00:00
iget v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldListSize:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-ge p1, v0, :cond_1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldItemStatuses:[I
2019-07-24 11:27:29 +00:00
aget p1, v0, p1
and-int/lit8 v0, p1, 0x1f
if-nez v0, :cond_0
const/4 p1, -0x1
return p1
:cond_0
shr-int/lit8 p1, p1, 0x5
return p1
:cond_1
new-instance v0, Ljava/lang/IndexOutOfBoundsException;
2019-12-06 03:29:40 +00:00
const-string v1, "Index out of bounds - passed position = "
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const-string v2, ", old list size = "
2019-07-24 11:27:29 +00:00
2020-05-11 19:22:21 +00:00
invoke-static {v1, p1, v2}, Lf/e/b/a/a;->b(Ljava/lang/String;ILjava/lang/String;)Ljava/lang/StringBuilder;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object p1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget v1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldListSize:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
2019-07-24 11:27:29 +00:00
move-result-object p1
invoke-direct {v0, p1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public dispatchUpdatesTo(Landroidx/recyclerview/widget/ListUpdateCallback;)V
.locals 14
2019-12-06 03:29:40 +00:00
.param p1 # Landroidx/recyclerview/widget/ListUpdateCallback;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
instance-of v0, p1, Landroidx/recyclerview/widget/BatchingListUpdateCallback;
if-eqz v0, :cond_0
check-cast p1, Landroidx/recyclerview/widget/BatchingListUpdateCallback;
goto :goto_0
:cond_0
new-instance v0, Landroidx/recyclerview/widget/BatchingListUpdateCallback;
invoke-direct {v0, p1}, Landroidx/recyclerview/widget/BatchingListUpdateCallback;-><init>(Landroidx/recyclerview/widget/ListUpdateCallback;)V
move-object p1, v0
:goto_0
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iget v1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldListSize:I
iget v2, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mNewListSize:I
iget-object v3, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mSnakes:Ljava/util/List;
invoke-interface {v3}, Ljava/util/List;->size()I
move-result v3
const/4 v7, 0x1
sub-int/2addr v3, v7
move v9, v2
move v8, v3
:goto_1
if-ltz v8, :cond_5
iget-object v2, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mSnakes:Ljava/util/List;
invoke-interface {v2, v8}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v2
move-object v10, v2
check-cast v10, Landroidx/recyclerview/widget/DiffUtil$Snake;
iget v11, v10, Landroidx/recyclerview/widget/DiffUtil$Snake;->size:I
iget v2, v10, Landroidx/recyclerview/widget/DiffUtil$Snake;->x:I
add-int v12, v2, v11
iget v2, v10, Landroidx/recyclerview/widget/DiffUtil$Snake;->y:I
add-int v13, v2, v11
if-ge v12, v1, :cond_1
sub-int v5, v1, v12
move-object v1, p0
move-object v2, v0
move-object v3, p1
move v4, v12
move v6, v12
invoke-direct/range {v1 .. v6}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->dispatchRemovals(Ljava/util/List;Landroidx/recyclerview/widget/ListUpdateCallback;III)V
:cond_1
if-ge v13, v9, :cond_2
sub-int v5, v9, v13
move-object v1, p0
move-object v2, v0
move-object v3, p1
move v4, v12
move v6, v13
invoke-direct/range {v1 .. v6}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->dispatchAdditions(Ljava/util/List;Landroidx/recyclerview/widget/ListUpdateCallback;III)V
:cond_2
add-int/lit8 v11, v11, -0x1
:goto_2
if-ltz v11, :cond_4
iget-object v1, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mOldItemStatuses:[I
iget v2, v10, Landroidx/recyclerview/widget/DiffUtil$Snake;->x:I
2019-12-06 03:29:40 +00:00
add-int v3, v2, v11
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
aget v1, v1, v3
2019-07-24 11:27:29 +00:00
and-int/lit8 v1, v1, 0x1f
2019-12-06 03:29:40 +00:00
const/4 v3, 0x2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-ne v1, v3, :cond_3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int v1, v2, v11
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object v3, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mCallback:Landroidx/recyclerview/widget/DiffUtil$Callback;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr v2, v11
2019-07-24 11:27:29 +00:00
iget v4, v10, Landroidx/recyclerview/widget/DiffUtil$Snake;->y:I
add-int/2addr v4, v11
2019-12-06 03:29:40 +00:00
invoke-virtual {v3, v2, v4}, Landroidx/recyclerview/widget/DiffUtil$Callback;->getChangePayload(II)Ljava/lang/Object;
2019-07-24 11:27:29 +00:00
move-result-object v2
invoke-virtual {p1, v1, v7, v2}, Landroidx/recyclerview/widget/BatchingListUpdateCallback;->onChanged(IILjava/lang/Object;)V
:cond_3
add-int/lit8 v11, v11, -0x1
goto :goto_2
:cond_4
iget v1, v10, Landroidx/recyclerview/widget/DiffUtil$Snake;->x:I
iget v9, v10, Landroidx/recyclerview/widget/DiffUtil$Snake;->y:I
add-int/lit8 v8, v8, -0x1
goto :goto_1
:cond_5
invoke-virtual {p1}, Landroidx/recyclerview/widget/BatchingListUpdateCallback;->dispatchLastEvent()V
return-void
.end method
.method public dispatchUpdatesTo(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V
.locals 1
2019-12-06 03:29:40 +00:00
.param p1 # Landroidx/recyclerview/widget/RecyclerView$Adapter;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
new-instance v0, Landroidx/recyclerview/widget/AdapterListUpdateCallback;
invoke-direct {v0, p1}, Landroidx/recyclerview/widget/AdapterListUpdateCallback;-><init>(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V
invoke-virtual {p0, v0}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->dispatchUpdatesTo(Landroidx/recyclerview/widget/ListUpdateCallback;)V
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public getSnakes()Ljava/util/List;
2019-07-24 11:27:29 +00:00
.locals 1
2019-12-06 03:29:40 +00:00
.annotation build Landroidx/annotation/VisibleForTesting;
.end annotation
2019-07-24 11:27:29 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List<",
"Landroidx/recyclerview/widget/DiffUtil$Snake;",
">;"
}
.end annotation
iget-object v0, p0, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->mSnakes:Ljava/util/List;
return-object v0
.end method