757 lines
21 KiB
Smali
757 lines
21 KiB
Smali
.class final Landroidx/recyclerview/widget/GapWorker;
|
|
.super Ljava/lang/Object;
|
|
.source "GapWorker.java"
|
|
|
|
# interfaces
|
|
.implements Ljava/lang/Runnable;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;,
|
|
Landroidx/recyclerview/widget/GapWorker$Task;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field static final sGapWorker:Ljava/lang/ThreadLocal;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/ThreadLocal<",
|
|
"Landroidx/recyclerview/widget/GapWorker;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field static sTaskComparator:Ljava/util/Comparator;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Comparator<",
|
|
"Landroidx/recyclerview/widget/GapWorker$Task;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# instance fields
|
|
.field mFrameIntervalNs:J
|
|
|
|
.field mPostTimeNs:J
|
|
|
|
.field mRecyclerViews:Ljava/util/ArrayList;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayList<",
|
|
"Landroidx/recyclerview/widget/RecyclerView;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private mTasks:Ljava/util/ArrayList;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayList<",
|
|
"Landroidx/recyclerview/widget/GapWorker$Task;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Ljava/lang/ThreadLocal;
|
|
|
|
invoke-direct {v0}, Ljava/lang/ThreadLocal;-><init>()V
|
|
|
|
sput-object v0, Landroidx/recyclerview/widget/GapWorker;->sGapWorker:Ljava/lang/ThreadLocal;
|
|
|
|
new-instance v0, Landroidx/recyclerview/widget/GapWorker$1;
|
|
|
|
invoke-direct {v0}, Landroidx/recyclerview/widget/GapWorker$1;-><init>()V
|
|
|
|
sput-object v0, Landroidx/recyclerview/widget/GapWorker;->sTaskComparator:Ljava/util/Comparator;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method constructor <init>()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/recyclerview/widget/GapWorker;->mRecyclerViews:Ljava/util/ArrayList;
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/recyclerview/widget/GapWorker;->mTasks:Ljava/util/ArrayList;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private buildTaskList()V
|
|
.locals 11
|
|
|
|
iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker;->mRecyclerViews:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v0, :cond_1
|
|
|
|
iget-object v4, p0, Landroidx/recyclerview/widget/GapWorker;->mRecyclerViews: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/RecyclerView;
|
|
|
|
invoke-virtual {v4}, Landroidx/recyclerview/widget/RecyclerView;->getWindowVisibility()I
|
|
|
|
move-result v5
|
|
|
|
if-nez v5, :cond_0
|
|
|
|
iget-object v5, v4, Landroidx/recyclerview/widget/RecyclerView;->mPrefetchRegistry:Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;
|
|
|
|
invoke-virtual {v5, v4, v1}, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->collectPrefetchPositionsFromView(Landroidx/recyclerview/widget/RecyclerView;Z)V
|
|
|
|
iget-object v4, v4, Landroidx/recyclerview/widget/RecyclerView;->mPrefetchRegistry:Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;
|
|
|
|
iget v4, v4, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
|
|
|
|
add-int/2addr v3, v4
|
|
|
|
:cond_0
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object v2, p0, Landroidx/recyclerview/widget/GapWorker;->mTasks:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v2, v3}, Ljava/util/ArrayList;->ensureCapacity(I)V
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
if-ge v2, v0, :cond_6
|
|
|
|
iget-object v4, p0, Landroidx/recyclerview/widget/GapWorker;->mRecyclerViews: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/RecyclerView;
|
|
|
|
invoke-virtual {v4}, Landroidx/recyclerview/widget/RecyclerView;->getWindowVisibility()I
|
|
|
|
move-result v5
|
|
|
|
if-nez v5, :cond_5
|
|
|
|
iget-object v5, v4, Landroidx/recyclerview/widget/RecyclerView;->mPrefetchRegistry:Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;
|
|
|
|
iget v6, v5, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchDx:I
|
|
|
|
invoke-static {v6}, Ljava/lang/Math;->abs(I)I
|
|
|
|
move-result v6
|
|
|
|
iget v7, v5, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchDy:I
|
|
|
|
invoke-static {v7}, Ljava/lang/Math;->abs(I)I
|
|
|
|
move-result v7
|
|
|
|
add-int/2addr v6, v7
|
|
|
|
move v7, v3
|
|
|
|
const/4 v3, 0x0
|
|
|
|
:goto_2
|
|
iget v8, v5, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
|
|
|
|
mul-int/lit8 v8, v8, 0x2
|
|
|
|
if-ge v3, v8, :cond_4
|
|
|
|
iget-object v8, p0, Landroidx/recyclerview/widget/GapWorker;->mTasks:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v8}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v8
|
|
|
|
if-lt v7, v8, :cond_2
|
|
|
|
new-instance v8, Landroidx/recyclerview/widget/GapWorker$Task;
|
|
|
|
invoke-direct {v8}, Landroidx/recyclerview/widget/GapWorker$Task;-><init>()V
|
|
|
|
iget-object v9, p0, Landroidx/recyclerview/widget/GapWorker;->mTasks:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v9, v8}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_3
|
|
|
|
:cond_2
|
|
iget-object v8, p0, Landroidx/recyclerview/widget/GapWorker;->mTasks:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v8, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Landroidx/recyclerview/widget/GapWorker$Task;
|
|
|
|
:goto_3
|
|
iget-object v9, v5, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
|
|
|
|
add-int/lit8 v10, v3, 0x1
|
|
|
|
aget v9, v9, v10
|
|
|
|
if-gt v9, v6, :cond_3
|
|
|
|
const/4 v10, 0x1
|
|
|
|
goto :goto_4
|
|
|
|
:cond_3
|
|
const/4 v10, 0x0
|
|
|
|
:goto_4
|
|
iput-boolean v10, v8, Landroidx/recyclerview/widget/GapWorker$Task;->immediate:Z
|
|
|
|
iput v6, v8, Landroidx/recyclerview/widget/GapWorker$Task;->viewVelocity:I
|
|
|
|
iput v9, v8, Landroidx/recyclerview/widget/GapWorker$Task;->distanceToItem:I
|
|
|
|
iput-object v4, v8, Landroidx/recyclerview/widget/GapWorker$Task;->view:Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
iget-object v9, v5, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
|
|
|
|
aget v9, v9, v3
|
|
|
|
iput v9, v8, Landroidx/recyclerview/widget/GapWorker$Task;->position:I
|
|
|
|
add-int/lit8 v7, v7, 0x1
|
|
|
|
add-int/lit8 v3, v3, 0x2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
move v3, v7
|
|
|
|
:cond_5
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_6
|
|
iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker;->mTasks:Ljava/util/ArrayList;
|
|
|
|
sget-object v1, Landroidx/recyclerview/widget/GapWorker;->sTaskComparator:Ljava/util/Comparator;
|
|
|
|
invoke-static {v0, v1}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private flushTaskWithDeadline(Landroidx/recyclerview/widget/GapWorker$Task;J)V
|
|
.locals 3
|
|
|
|
iget-boolean v0, p1, Landroidx/recyclerview/widget/GapWorker$Task;->immediate:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-wide v0, 0x7fffffffffffffffL
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-wide v0, p2
|
|
|
|
:goto_0
|
|
iget-object v2, p1, Landroidx/recyclerview/widget/GapWorker$Task;->view:Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
iget p1, p1, Landroidx/recyclerview/widget/GapWorker$Task;->position:I
|
|
|
|
invoke-direct {p0, v2, p1, v0, v1}, Landroidx/recyclerview/widget/GapWorker;->prefetchPositionWithDeadline(Landroidx/recyclerview/widget/RecyclerView;IJ)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
iget-object v0, p1, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->mNestedRecyclerView:Ljava/lang/ref/WeakReference;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->isBound()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->isInvalid()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
iget-object p1, p1, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->mNestedRecyclerView:Ljava/lang/ref/WeakReference;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Landroidx/recyclerview/widget/GapWorker;->prefetchInnerRecyclerViewWithDeadline(Landroidx/recyclerview/widget/RecyclerView;J)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method private flushTasksWithDeadline(J)V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iget-object v1, p0, Landroidx/recyclerview/widget/GapWorker;->mTasks:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v1}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v1
|
|
|
|
if-ge v0, v1, :cond_0
|
|
|
|
iget-object v1, p0, Landroidx/recyclerview/widget/GapWorker;->mTasks:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroidx/recyclerview/widget/GapWorker$Task;
|
|
|
|
iget-object v2, v1, Landroidx/recyclerview/widget/GapWorker$Task;->view:Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-direct {p0, v1, p1, p2}, Landroidx/recyclerview/widget/GapWorker;->flushTaskWithDeadline(Landroidx/recyclerview/widget/GapWorker$Task;J)V
|
|
|
|
invoke-virtual {v1}, Landroidx/recyclerview/widget/GapWorker$Task;->clear()V
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method static isPrefetchPositionAttached(Landroidx/recyclerview/widget/RecyclerView;I)Z
|
|
.locals 5
|
|
|
|
iget-object v0, p0, Landroidx/recyclerview/widget/RecyclerView;->mChildHelper:Landroidx/recyclerview/widget/ChildHelper;
|
|
|
|
invoke-virtual {v0}, Landroidx/recyclerview/widget/ChildHelper;->getUnfilteredChildCount()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v0, :cond_1
|
|
|
|
iget-object v3, p0, Landroidx/recyclerview/widget/RecyclerView;->mChildHelper:Landroidx/recyclerview/widget/ChildHelper;
|
|
|
|
invoke-virtual {v3, v2}, Landroidx/recyclerview/widget/ChildHelper;->getUnfilteredChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v3}, Landroidx/recyclerview/widget/RecyclerView;->getChildViewHolderInt(Landroid/view/View;)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
|
|
|
|
move-result-object v3
|
|
|
|
iget v4, v3, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->mPosition:I
|
|
|
|
if-ne v4, p1, :cond_0
|
|
|
|
invoke-virtual {v3}, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->isInvalid()Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return v1
|
|
.end method
|
|
|
|
.method private prefetchInnerRecyclerViewWithDeadline(Landroidx/recyclerview/widget/RecyclerView;J)V
|
|
.locals 3
|
|
.param p1 # Landroidx/recyclerview/widget/RecyclerView;
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-boolean v0, p1, Landroidx/recyclerview/widget/RecyclerView;->mDataSetHasChangedAfterLayout:Z
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p1, Landroidx/recyclerview/widget/RecyclerView;->mChildHelper:Landroidx/recyclerview/widget/ChildHelper;
|
|
|
|
invoke-virtual {v0}, Landroidx/recyclerview/widget/ChildHelper;->getUnfilteredChildCount()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->removeAndRecycleViews()V
|
|
|
|
:cond_1
|
|
iget-object v0, p1, Landroidx/recyclerview/widget/RecyclerView;->mPrefetchRegistry:Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {v0, p1, v1}, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->collectPrefetchPositionsFromView(Landroidx/recyclerview/widget/RecyclerView;Z)V
|
|
|
|
iget v1, v0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
:try_start_0
|
|
const-string v1, "RV Nested Prefetch"
|
|
|
|
invoke-static {v1}, Landroidx/core/os/TraceCompat;->beginSection(Ljava/lang/String;)V
|
|
|
|
iget-object v1, p1, Landroidx/recyclerview/widget/RecyclerView;->mState:Landroidx/recyclerview/widget/RecyclerView$State;
|
|
|
|
iget-object v2, p1, Landroidx/recyclerview/widget/RecyclerView;->mAdapter:Landroidx/recyclerview/widget/RecyclerView$Adapter;
|
|
|
|
invoke-virtual {v1, v2}, Landroidx/recyclerview/widget/RecyclerView$State;->prepareForNestedPrefetch(Landroidx/recyclerview/widget/RecyclerView$Adapter;)V
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
iget v2, v0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
|
|
|
|
mul-int/lit8 v2, v2, 0x2
|
|
|
|
if-ge v1, v2, :cond_2
|
|
|
|
iget-object v2, v0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
|
|
|
|
aget v2, v2, v1
|
|
|
|
invoke-direct {p0, p1, v2, p2, p3}, Landroidx/recyclerview/widget/GapWorker;->prefetchPositionWithDeadline(Landroidx/recyclerview/widget/RecyclerView;IJ)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
add-int/lit8 v1, v1, 0x2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
invoke-static {}, Landroidx/core/os/TraceCompat;->endSection()V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
invoke-static {}, Landroidx/core/os/TraceCompat;->endSection()V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
return-void
|
|
.end method
|
|
|
|
.method private prefetchPositionWithDeadline(Landroidx/recyclerview/widget/RecyclerView;IJ)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
|
|
.locals 2
|
|
|
|
invoke-static {p1, p2}, Landroidx/recyclerview/widget/GapWorker;->isPrefetchPositionAttached(Landroidx/recyclerview/widget/RecyclerView;I)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
iget-object v0, p1, Landroidx/recyclerview/widget/RecyclerView;->mRecycler:Landroidx/recyclerview/widget/RecyclerView$Recycler;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:try_start_0
|
|
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->onEnterLayoutOrScroll()V
|
|
|
|
invoke-virtual {v0, p2, v1, p3, p4}, Landroidx/recyclerview/widget/RecyclerView$Recycler;->tryGetViewHolderForPositionByDeadline(IZJ)Landroidx/recyclerview/widget/RecyclerView$ViewHolder;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
invoke-virtual {p2}, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->isBound()Z
|
|
|
|
move-result p3
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
invoke-virtual {p2}, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->isInvalid()Z
|
|
|
|
move-result p3
|
|
|
|
if-nez p3, :cond_1
|
|
|
|
iget-object p3, p2, Landroidx/recyclerview/widget/RecyclerView$ViewHolder;->itemView:Landroid/view/View;
|
|
|
|
invoke-virtual {v0, p3}, Landroidx/recyclerview/widget/RecyclerView$Recycler;->recycleView(Landroid/view/View;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {v0, p2, v1}, Landroidx/recyclerview/widget/RecyclerView$Recycler;->addViewHolderToRecycledViewPool(Landroidx/recyclerview/widget/RecyclerView$ViewHolder;Z)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:cond_2
|
|
:goto_0
|
|
invoke-virtual {p1, v1}, Landroidx/recyclerview/widget/RecyclerView;->onExitLayoutOrScroll(Z)V
|
|
|
|
return-object p2
|
|
|
|
:catchall_0
|
|
move-exception p2
|
|
|
|
invoke-virtual {p1, v1}, Landroidx/recyclerview/widget/RecyclerView;->onExitLayoutOrScroll(Z)V
|
|
|
|
throw p2
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final add(Landroidx/recyclerview/widget/RecyclerView;)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker;->mRecyclerViews:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method final postFromTraversal(Landroidx/recyclerview/widget/RecyclerView;II)V
|
|
.locals 5
|
|
|
|
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->isAttachedToWindow()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-wide v0, p0, Landroidx/recyclerview/widget/GapWorker;->mPostTimeNs:J
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->getNanoTime()J
|
|
|
|
move-result-wide v0
|
|
|
|
iput-wide v0, p0, Landroidx/recyclerview/widget/GapWorker;->mPostTimeNs:J
|
|
|
|
invoke-virtual {p1, p0}, Landroidx/recyclerview/widget/RecyclerView;->post(Ljava/lang/Runnable;)Z
|
|
|
|
:cond_0
|
|
iget-object p1, p1, Landroidx/recyclerview/widget/RecyclerView;->mPrefetchRegistry:Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;
|
|
|
|
invoke-virtual {p1, p2, p3}, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->setPrefetchVector(II)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method final prefetch(J)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Landroidx/recyclerview/widget/GapWorker;->buildTaskList()V
|
|
|
|
invoke-direct {p0, p1, p2}, Landroidx/recyclerview/widget/GapWorker;->flushTasksWithDeadline(J)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final remove(Landroidx/recyclerview/widget/RecyclerView;)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker;->mRecyclerViews:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final run()V
|
|
.locals 8
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
:try_start_0
|
|
const-string v2, "RV Prefetch"
|
|
|
|
invoke-static {v2}, Landroidx/core/os/TraceCompat;->beginSection(Ljava/lang/String;)V
|
|
|
|
iget-object v2, p0, Landroidx/recyclerview/widget/GapWorker;->mRecyclerViews:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z
|
|
|
|
move-result v2
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
iput-wide v0, p0, Landroidx/recyclerview/widget/GapWorker;->mPostTimeNs:J
|
|
|
|
invoke-static {}, Landroidx/core/os/TraceCompat;->endSection()V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
:try_start_1
|
|
iget-object v2, p0, Landroidx/recyclerview/widget/GapWorker;->mRecyclerViews:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
move-wide v4, v0
|
|
|
|
:goto_0
|
|
if-ge v3, v2, :cond_2
|
|
|
|
iget-object v6, p0, Landroidx/recyclerview/widget/GapWorker;->mRecyclerViews:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v6, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
check-cast v6, Landroidx/recyclerview/widget/RecyclerView;
|
|
|
|
invoke-virtual {v6}, Landroidx/recyclerview/widget/RecyclerView;->getWindowVisibility()I
|
|
|
|
move-result v7
|
|
|
|
if-nez v7, :cond_1
|
|
|
|
invoke-virtual {v6}, Landroidx/recyclerview/widget/RecyclerView;->getDrawingTime()J
|
|
|
|
move-result-wide v6
|
|
|
|
invoke-static {v6, v7, v4, v5}, Ljava/lang/Math;->max(JJ)J
|
|
|
|
move-result-wide v4
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:cond_1
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
cmp-long v2, v4, v0
|
|
|
|
if-nez v2, :cond_3
|
|
|
|
iput-wide v0, p0, Landroidx/recyclerview/widget/GapWorker;->mPostTimeNs:J
|
|
|
|
invoke-static {}, Landroidx/core/os/TraceCompat;->endSection()V
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
:try_start_2
|
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-virtual {v2, v4, v5}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
|
|
|
|
move-result-wide v2
|
|
|
|
iget-wide v4, p0, Landroidx/recyclerview/widget/GapWorker;->mFrameIntervalNs:J
|
|
|
|
add-long/2addr v2, v4
|
|
|
|
invoke-virtual {p0, v2, v3}, Landroidx/recyclerview/widget/GapWorker;->prefetch(J)V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
iput-wide v0, p0, Landroidx/recyclerview/widget/GapWorker;->mPostTimeNs:J
|
|
|
|
invoke-static {}, Landroidx/core/os/TraceCompat;->endSection()V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v2
|
|
|
|
iput-wide v0, p0, Landroidx/recyclerview/widget/GapWorker;->mPostTimeNs:J
|
|
|
|
invoke-static {}, Landroidx/core/os/TraceCompat;->endSection()V
|
|
|
|
throw v2
|
|
|
|
return-void
|
|
.end method
|