.class 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 = 0x8 name = "LayoutPrefetchRegistryImpl" .end annotation # instance fields .field mCount:I .field mPrefetchArray:[I .field mPrefetchDx:I .field mPrefetchDy:I # direct methods .method constructor ()V .registers 1 .line 63 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method # virtual methods .method public addPosition(II)V .registers 8 if-ltz p1, :cond_3a if-ltz p2, :cond_32 .line 119 iget v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I mul-int/lit8 v1, v0, 0x2 .line 120 iget-object v2, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I const/4 v3, 0x4 if-nez v2, :cond_16 .line 121 new-array v0, v3, [I iput-object v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I const/4 v2, -0x1 .line 122 invoke-static {v0, v2}, Ljava/util/Arrays;->fill([II)V goto :goto_23 .line 123 :cond_16 array-length v4, v2 if-lt v1, v4, :cond_23 mul-int/2addr v0, v3 .line 125 new-array v0, v0, [I iput-object v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I .line 126 array-length v3, v2 const/4 v4, 0x0 invoke-static {v2, v4, v0, v4, v3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V .line 130 :cond_23 :goto_23 iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I aput p1, v0, v1 add-int/lit8 v1, v1, 0x1 .line 131 aput p2, v0, v1 .line 133 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 .line 115 :cond_32 new-instance p1, Ljava/lang/IllegalArgumentException; const-string p2, "Pixel distance must be non-negative" invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p1 .line 111 :cond_3a new-instance p1, Ljava/lang/IllegalArgumentException; const-string p2, "Layout positions must be non-negative" invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p1 .end method .method clearPrefetchPositions()V .registers 3 .line 150 iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I if-eqz v0, :cond_8 const/4 v1, -0x1 .line 151 invoke-static {v0, v1}, Ljava/util/Arrays;->fill([II)V :cond_8 const/4 v0, 0x0 .line 153 iput v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I return-void .end method .method collectPrefetchPositionsFromView(Landroidx/recyclerview/widget/RecyclerView;Z)V .registers 7 const/4 v0, 0x0 .line 77 iput v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I .line 78 iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I if-eqz v0, :cond_b const/4 v1, -0x1 .line 79 invoke-static {v0, v1}, Ljava/util/Arrays;->fill([II)V .line 82 :cond_b iget-object v0, p1, Landroidx/recyclerview/widget/RecyclerView;->mLayout:Landroidx/recyclerview/widget/RecyclerView$LayoutManager; .line 83 iget-object v1, p1, Landroidx/recyclerview/widget/RecyclerView;->mAdapter:Landroidx/recyclerview/widget/RecyclerView$Adapter; if-eqz v1, :cond_4d if-eqz v0, :cond_4d .line 85 invoke-virtual {v0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->isItemPrefetchEnabled()Z move-result v1 if-eqz v1, :cond_4d if-eqz p2, :cond_2d .line 89 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 .line 90 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 .line 94 :cond_2d invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView;->hasPendingAdapterUpdates()Z move-result v1 if-nez v1, :cond_3c .line 95 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 .line 100 :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_4d .line 101 iget v1, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I iput v1, v0, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->mPrefetchMaxCountObserved:I .line 102 iput-boolean p2, v0, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->mPrefetchMaxObservedInInitialPrefetch:Z .line 103 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_4d return-void .end method .method lastPrefetchIncludedPosition(I)Z .registers 6 .line 137 iget-object v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchArray:[I const/4 v1, 0x0 if-eqz v0, :cond_17 .line 138 iget v0, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mCount:I mul-int/lit8 v0, v0, 0x2 move v2, v1 :goto_a if-ge v2, v0, :cond_17 .line 140 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 setPrefetchVector(II)V .registers 3 .line 72 iput p1, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchDx:I .line 73 iput p2, p0, Landroidx/recyclerview/widget/GapWorker$LayoutPrefetchRegistryImpl;->mPrefetchDy:I return-void .end method