GapWorker$LayoutPrefetchRegistryImpl.smali
.class public Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;
.super Ljava/lang/Object;
.source "GapWorker.java"
# interfaces
.implements Landroidx/recyclerview/widget/RecyclerView$LayoutManager$LayoutPrefetchRegistry;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/recyclerview/widget/GapWorker;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "LayoutPrefetchRegistryImpl"
.end annotation
# instance fields
.field public mCount:I
.field public mPrefetchArray:[I
.field public mPrefetchDx:I
.field public mPrefetchDy:I
# direct methods
.method static constructor <clinit>()V
.registers 1
return-void
.end method
.method public constructor <init>()V
.registers 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public addPosition(II)V
.registers 8
if-ltz p1, :cond_3b
if-ltz p2, :cond_33
iget v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
mul-int/lit8 v0, v0, 0x2
iget-object v1, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
if-nez v1, :cond_16
const/4 v1, 0x4
new-array v1, v1, [I
iput-object v1, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
const/4 v2, -0x1
invoke-static {v1, v2}, Ljava/util/Arrays;->fill([II)V
goto :goto_24
:cond_16
array-length v2, v1
if-lt v0, v2, :cond_24
mul-int/lit8 v2, v0, 0x2
new-array v2, v2, [I
iput-object v2, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
array-length v3, v1
const/4 v4, 0x0
invoke-static {v1, v4, v2, v4, v3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
:cond_24
:goto_24
iget-object v1, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
aput p1, v1, v0
add-int/lit8 v0, v0, 0x1
aput p2, v1, v0
iget p1, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
add-int/lit8 p1, p1, 0x1
iput p1, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
return-void
:cond_33
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "Pixel distance must be non-negative"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
:cond_3b
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "Layout positions must be non-negative"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public clearPrefetchPositions()V
.registers 3
iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
if-eqz v0, :cond_8
const/4 v1, -0x1
invoke-static {v0, v1}, Ljava/util/Arrays;->fill([II)V
:cond_8
const/4 v0, 0x0
iput v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
return-void
.end method
.method public collectPrefetchPositionsFromView(Landroidx/recyclerview/widget/RecyclerView;Z)V
.registers 7
const/4 v0, 0x0
iput v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
if-eqz v0, :cond_b
const/4 v1, -0x1
invoke-static {v0, v1}, Ljava/util/Arrays;->fill([II)V
:cond_b
iget-object v0, p1, Landroidx/recyclerview/widget/RecyclerView;->mLayout:Landroidx/recyclerview/widget/RecyclerView$LayoutManager;
iget-object v1, p1, Landroidx/recyclerview/widget/RecyclerView;->mAdapter:Landroidx/recyclerview/widget/RecyclerView$Adapter;
if-eqz v1, :cond_4b
if-eqz v0, :cond_4b
invoke-virtual {v0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->isItemPrefetchEnabled()Z
move-result v1
if-eqz v1, :cond_4b
if-eqz p2, :cond_2d
iget-object v1, p1, Landroidx/recyclerview/widget/RecyclerView;->mAdapterHelper:Landroidx/recyclerview/widget/AdapterHelper;
invoke-virtual {v1}, Landroidx/recyclerview/widget/AdapterHelper;->hasPendingUpdates()Z
move-result v1
if-nez v1, :cond_3c
iget-object v1, p1, Landroidx/recyclerview/widget/RecyclerView;->mAdapter:Landroidx/recyclerview/widget/RecyclerView$Adapter;
invoke-virtual {v1}, Landroidx/recyclerview/widget/RecyclerView$Adapter;->getItemCount()I
move-result v1
invoke-virtual {v0, v1, p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->collectInitialPrefetchPositions(ILandroidx/recyclerview/widget/RecyclerView$LayoutManager$LayoutPrefetchRegistry;)V
goto :goto_3c
:cond_2d
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->hasPendingAdapterUpdates()Z
move-result v1
if-nez v1, :cond_3c
iget v1, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchDx:I
iget v2, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchDy:I
iget-object v3, p1, Landroidx/recyclerview/widget/RecyclerView;->mState:Landroidx/recyclerview/widget/RecyclerView$State;
invoke-virtual {v0, v1, v2, v3, p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->collectAdjacentPrefetchPositions(IILandroidx/recyclerview/widget/RecyclerView$State;Landroidx/recyclerview/widget/RecyclerView$LayoutManager$LayoutPrefetchRegistry;)V
:cond_3c
:goto_3c
iget v1, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
iget v2, v0, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->mPrefetchMaxCountObserved:I
if-le v1, v2, :cond_4b
iput v1, v0, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->mPrefetchMaxCountObserved:I
iput-boolean p2, v0, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->mPrefetchMaxObservedInInitialPrefetch:Z
iget-object p1, p1, Landroidx/recyclerview/widget/RecyclerView;->mRecycler:Landroidx/recyclerview/widget/RecyclerView$Recycler;
invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView$Recycler;->updateViewCacheSize()V
:cond_4b
return-void
.end method
.method public lastPrefetchIncludedPosition(I)Z
.registers 6
iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
const/4 v1, 0x0
if-eqz v0, :cond_17
iget v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I
mul-int/lit8 v0, v0, 0x2
const/4 v2, 0x0
:goto_a
if-ge v2, v0, :cond_17
iget-object v3, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I
aget v3, v3, v2
if-ne v3, p1, :cond_14
const/4 p1, 0x1
return p1
:cond_14
add-int/lit8 v2, v2, 0x2
goto :goto_a
:cond_17
return v1
.end method
.method public setPrefetchVector(II)V
.registers 3
iput p1, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchDx:I
iput p2, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchDy:I
return-void
.end method