311 lines
10 KiB
Smali
311 lines
10 KiB
Smali
.class public Landroidx/recyclerview/widget/AsyncListDiffer;
|
|
.super Ljava/lang/Object;
|
|
.source "AsyncListDiffer.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/recyclerview/widget/AsyncListDiffer$MainThreadExecutor;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/lang/Object;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final sMainThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
|
|
# instance fields
|
|
.field final mConfig:Landroidx/recyclerview/widget/AsyncDifferConfig;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroidx/recyclerview/widget/AsyncDifferConfig<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private mList:Ljava/util/List;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field final mMainThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
.field mMaxScheduledGeneration:I
|
|
|
|
.field private mReadOnlyList:Ljava/util/List;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final mUpdateCallback:Landroidx/recyclerview/widget/ListUpdateCallback;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Landroidx/recyclerview/widget/AsyncListDiffer$MainThreadExecutor;
|
|
|
|
invoke-direct {v0}, Landroidx/recyclerview/widget/AsyncListDiffer$MainThreadExecutor;-><init>()V
|
|
|
|
sput-object v0, Landroidx/recyclerview/widget/AsyncListDiffer;->sMainThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroidx/recyclerview/widget/ListUpdateCallback;Landroidx/recyclerview/widget/AsyncDifferConfig;)V
|
|
.locals 1
|
|
.param p1 # Landroidx/recyclerview/widget/ListUpdateCallback;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroidx/recyclerview/widget/AsyncDifferConfig;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroidx/recyclerview/widget/ListUpdateCallback;",
|
|
"Landroidx/recyclerview/widget/AsyncDifferConfig<",
|
|
"TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mReadOnlyList:Ljava/util/List;
|
|
|
|
iput-object p1, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mUpdateCallback:Landroidx/recyclerview/widget/ListUpdateCallback;
|
|
|
|
iput-object p2, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mConfig:Landroidx/recyclerview/widget/AsyncDifferConfig;
|
|
|
|
invoke-virtual {p2}, Landroidx/recyclerview/widget/AsyncDifferConfig;->getMainThreadExecutor()Ljava/util/concurrent/Executor;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p2}, Landroidx/recyclerview/widget/AsyncDifferConfig;->getMainThreadExecutor()Ljava/util/concurrent/Executor;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mMainThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
sget-object p1, Landroidx/recyclerview/widget/AsyncListDiffer;->sMainThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
iput-object p1, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mMainThreadExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroidx/recyclerview/widget/RecyclerView$Adapter;Landroidx/recyclerview/widget/DiffUtil$ItemCallback;)V
|
|
.locals 1
|
|
.param p1 # Landroidx/recyclerview/widget/RecyclerView$Adapter;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroidx/recyclerview/widget/DiffUtil$ItemCallback;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroidx/recyclerview/widget/RecyclerView$Adapter;",
|
|
"Landroidx/recyclerview/widget/DiffUtil$ItemCallback<",
|
|
"TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Landroidx/recyclerview/widget/AdapterListUpdateCallback;
|
|
|
|
invoke-direct {v0, p1}, Landroidx/recyclerview/widget/AdapterListUpdateCallback;-><init>(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V
|
|
|
|
new-instance p1, Landroidx/recyclerview/widget/AsyncDifferConfig$Builder;
|
|
|
|
invoke-direct {p1, p2}, Landroidx/recyclerview/widget/AsyncDifferConfig$Builder;-><init>(Landroidx/recyclerview/widget/DiffUtil$ItemCallback;)V
|
|
|
|
invoke-virtual {p1}, Landroidx/recyclerview/widget/AsyncDifferConfig$Builder;->build()Landroidx/recyclerview/widget/AsyncDifferConfig;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, v0, p1}, Landroidx/recyclerview/widget/AsyncListDiffer;-><init>(Landroidx/recyclerview/widget/ListUpdateCallback;Landroidx/recyclerview/widget/AsyncDifferConfig;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public getCurrentList()Ljava/util/List;
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"TT;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mReadOnlyList:Ljava/util/List;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method latchList(Ljava/util/List;Landroidx/recyclerview/widget/DiffUtil$DiffResult;)V
|
|
.locals 0
|
|
.param p1 # Ljava/util/List;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroidx/recyclerview/widget/DiffUtil$DiffResult;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"TT;>;",
|
|
"Landroidx/recyclerview/widget/DiffUtil$DiffResult;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
iput-object p1, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mList:Ljava/util/List;
|
|
|
|
invoke-static {p1}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mReadOnlyList:Ljava/util/List;
|
|
|
|
iget-object p1, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mUpdateCallback:Landroidx/recyclerview/widget/ListUpdateCallback;
|
|
|
|
invoke-virtual {p2, p1}, Landroidx/recyclerview/widget/DiffUtil$DiffResult;->dispatchUpdatesTo(Landroidx/recyclerview/widget/ListUpdateCallback;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public submitList(Ljava/util/List;)V
|
|
.locals 4
|
|
.param p1 # Ljava/util/List;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"TT;>;)V"
|
|
}
|
|
.end annotation
|
|
|
|
iget v0, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mMaxScheduledGeneration:I
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
iput v0, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mMaxScheduledGeneration:I
|
|
|
|
iget-object v1, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mList:Ljava/util/List;
|
|
|
|
if-ne p1, v1, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v2, 0x0
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->size()I
|
|
|
|
move-result p1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mList:Ljava/util/List;
|
|
|
|
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mReadOnlyList:Ljava/util/List;
|
|
|
|
iget-object v0, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mUpdateCallback:Landroidx/recyclerview/widget/ListUpdateCallback;
|
|
|
|
invoke-interface {v0, v2, p1}, Landroidx/recyclerview/widget/ListUpdateCallback;->onRemoved(II)V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
if-nez v1, :cond_2
|
|
|
|
iput-object p1, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mList:Ljava/util/List;
|
|
|
|
invoke-static {p1}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mReadOnlyList:Ljava/util/List;
|
|
|
|
iget-object v0, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mUpdateCallback:Landroidx/recyclerview/widget/ListUpdateCallback;
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->size()I
|
|
|
|
move-result p1
|
|
|
|
invoke-interface {v0, v2, p1}, Landroidx/recyclerview/widget/ListUpdateCallback;->onInserted(II)V
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
iget-object v2, p0, Landroidx/recyclerview/widget/AsyncListDiffer;->mConfig:Landroidx/recyclerview/widget/AsyncDifferConfig;
|
|
|
|
invoke-virtual {v2}, Landroidx/recyclerview/widget/AsyncDifferConfig;->getBackgroundThreadExecutor()Ljava/util/concurrent/Executor;
|
|
|
|
move-result-object v2
|
|
|
|
new-instance v3, Landroidx/recyclerview/widget/AsyncListDiffer$1;
|
|
|
|
invoke-direct {v3, p0, v1, p1, v0}, Landroidx/recyclerview/widget/AsyncListDiffer$1;-><init>(Landroidx/recyclerview/widget/AsyncListDiffer;Ljava/util/List;Ljava/util/List;I)V
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
|
|
|
|
return-void
|
|
.end method
|