.class public abstract Landroidx/recyclerview/widget/RecyclerView$SmoothScroller; .super Ljava/lang/Object; .source "RecyclerView.java" # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Landroidx/recyclerview/widget/RecyclerView; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x409 name = "SmoothScroller" .end annotation .annotation system Ldalvik/annotation/MemberClasses; value = { Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$ScrollVectorProvider;, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action; } .end annotation # instance fields .field private mLayoutManager:Landroidx/recyclerview/widget/RecyclerView$LayoutManager; .field private mPendingInitialRun:Z .field private mRecyclerView:Landroidx/recyclerview/widget/RecyclerView; .field private final mRecyclingAction:Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action; .field private mRunning:Z .field private mStarted:Z .field private mTargetPosition:I .field private mTargetView:Landroid/view/View; # direct methods .method public constructor ()V .locals 2 .line 12718 invoke-direct {p0}, Ljava/lang/Object;->()V const/4 v0, -0x1 iput v0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetPosition:I .line 12719 new-instance v0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action; const/4 v1, 0x0 invoke-direct {v0, v1, v1}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action;->(II)V iput-object v0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclingAction:Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action; return-void .end method # virtual methods .method public computeScrollVectorForPosition(I)Landroid/graphics/PointF; .locals 1 .line 12776 invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->getLayoutManager()Landroidx/recyclerview/widget/RecyclerView$LayoutManager; move-result-object p0 .line 12777 instance-of v0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$ScrollVectorProvider; if-eqz v0, :cond_0 .line 12778 check-cast p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$ScrollVectorProvider; .line 12779 invoke-interface {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$ScrollVectorProvider;->computeScrollVectorForPosition(I)Landroid/graphics/PointF; move-result-object p0 return-object p0 .line 12781 :cond_0 new-instance p0, Ljava/lang/StringBuilder; const-string p1, "You should override computeScrollVectorForPosition when the LayoutManager does not implement " invoke-direct {p0, p1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V const-class p1, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$ScrollVectorProvider; .line 12782 invoke-virtual {p1}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String; move-result-object p1 invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 const-string p1, "RecyclerView" .line 12781 invoke-static {p1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I const/4 p0, 0x0 return-object p0 .end method .method public findViewByPosition(I)Landroid/view/View; .locals 0 iget-object p0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclerView:Landroidx/recyclerview/widget/RecyclerView; .line 12913 iget-object p0, p0, Landroidx/recyclerview/widget/RecyclerView;->mLayout:Landroidx/recyclerview/widget/RecyclerView$LayoutManager; invoke-virtual {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->findViewByPosition(I)Landroid/view/View; move-result-object p0 return-object p0 .end method .method public getChildCount()I .locals 0 iget-object p0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclerView:Landroidx/recyclerview/widget/RecyclerView; .line 12906 iget-object p0, p0, Landroidx/recyclerview/widget/RecyclerView;->mLayout:Landroidx/recyclerview/widget/RecyclerView$LayoutManager; invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->getChildCount()I move-result p0 return p0 .end method .method public getChildPosition(Landroid/view/View;)I .locals 0 iget-object p0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclerView:Landroidx/recyclerview/widget/RecyclerView; .line 12899 invoke-virtual {p0, p1}, Landroidx/recyclerview/widget/RecyclerView;->getChildLayoutPosition(Landroid/view/View;)I move-result p0 return p0 .end method .method public getLayoutManager()Landroidx/recyclerview/widget/RecyclerView$LayoutManager; .locals 0 iget-object p0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mLayoutManager:Landroidx/recyclerview/widget/RecyclerView$LayoutManager; return-object p0 .end method .method public getTargetPosition()I .locals 0 iget p0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetPosition:I return p0 .end method .method public instantScrollToPosition(I)V .locals 0 .annotation runtime Ljava/lang/Deprecated; .end annotation iget-object p0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclerView:Landroidx/recyclerview/widget/RecyclerView; .line 12922 invoke-virtual {p0, p1}, Landroidx/recyclerview/widget/RecyclerView;->scrollToPosition(I)V return-void .end method .method public isPendingInitialRun()Z .locals 0 iget-boolean p0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mPendingInitialRun:Z return p0 .end method .method public isRunning()Z .locals 0 iget-boolean p0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRunning:Z return p0 .end method .method protected normalize(Landroid/graphics/PointF;)V .locals 2 .line 12940 iget p0, p1, Landroid/graphics/PointF;->x:F iget v0, p1, Landroid/graphics/PointF;->x:F mul-float/2addr p0, v0 iget v0, p1, Landroid/graphics/PointF;->y:F iget v1, p1, Landroid/graphics/PointF;->y:F mul-float/2addr v0, v1 add-float/2addr p0, v0 float-to-double v0, p0 invoke-static {v0, v1}, Ljava/lang/Math;->sqrt(D)D move-result-wide v0 double-to-float p0, v0 .line 12942 iget v0, p1, Landroid/graphics/PointF;->x:F div-float/2addr v0, p0 iput v0, p1, Landroid/graphics/PointF;->x:F .line 12943 iget v0, p1, Landroid/graphics/PointF;->y:F div-float/2addr v0, p0 iput v0, p1, Landroid/graphics/PointF;->y:F return-void .end method .method onAnimation(II)V .locals 5 iget-object v0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclerView:Landroidx/recyclerview/widget/RecyclerView; iget v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetPosition:I const/4 v2, -0x1 if-eq v1, v2, :cond_0 if-nez v0, :cond_1 .line 12850 :cond_0 invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->stop()V :cond_1 iget-boolean v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mPendingInitialRun:Z const/4 v2, 0x0 if-eqz v1, :cond_3 iget-object v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetView:Landroid/view/View; if-nez v1, :cond_3 iget-object v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mLayoutManager:Landroidx/recyclerview/widget/RecyclerView$LayoutManager; if-eqz v1, :cond_3 iget v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetPosition:I .line 12859 invoke-virtual {p0, v1}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->computeScrollVectorForPosition(I)Landroid/graphics/PointF; move-result-object v1 if-eqz v1, :cond_3 .line 12860 iget v3, v1, Landroid/graphics/PointF;->x:F const/4 v4, 0x0 cmpl-float v3, v3, v4 if-nez v3, :cond_2 iget v3, v1, Landroid/graphics/PointF;->y:F cmpl-float v3, v3, v4 if-eqz v3, :cond_3 .line 12861 :cond_2 iget v3, v1, Landroid/graphics/PointF;->x:F .line 12862 invoke-static {v3}, Ljava/lang/Math;->signum(F)F move-result v3 float-to-int v3, v3 iget v1, v1, Landroid/graphics/PointF;->y:F .line 12863 invoke-static {v1}, Ljava/lang/Math;->signum(F)F move-result v1 float-to-int v1, v1 .line 12861 invoke-virtual {v0, v3, v1, v2}, Landroidx/recyclerview/widget/RecyclerView;->scrollStep(II[I)V :cond_3 const/4 v1, 0x0 iput-boolean v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mPendingInitialRun:Z iget-object v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetView:Landroid/view/View; if-eqz v1, :cond_5 .line 12872 invoke-virtual {p0, v1}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->getChildPosition(Landroid/view/View;)I move-result v1 iget v3, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetPosition:I if-ne v1, v3, :cond_4 iget-object v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetView:Landroid/view/View; .line 12873 iget-object v2, v0, Landroidx/recyclerview/widget/RecyclerView;->mState:Landroidx/recyclerview/widget/RecyclerView$State; iget-object v3, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclingAction:Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action; invoke-virtual {p0, v1, v2, v3}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->onTargetFound(Landroid/view/View;Landroidx/recyclerview/widget/RecyclerView$State;Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action;)V iget-object v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclingAction:Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action; .line 12874 invoke-virtual {v1, v0}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action;->runIfNecessary(Landroidx/recyclerview/widget/RecyclerView;)V .line 12875 invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->stop()V goto :goto_0 :cond_4 const-string v1, "RecyclerView" const-string v3, "Passed over target position while smooth scrolling." .line 12877 invoke-static {v1, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I iput-object v2, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetView:Landroid/view/View; :cond_5 :goto_0 iget-boolean v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRunning:Z if-eqz v1, :cond_6 .line 12882 iget-object v1, v0, Landroidx/recyclerview/widget/RecyclerView;->mState:Landroidx/recyclerview/widget/RecyclerView$State; iget-object v2, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclingAction:Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action; invoke-virtual {p0, p1, p2, v1, v2}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->onSeekTargetStep(IILandroidx/recyclerview/widget/RecyclerView$State;Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action;)V iget-object p1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclingAction:Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action; .line 12883 invoke-virtual {p1}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action;->hasJumpTarget()Z move-result p1 iget-object p2, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclingAction:Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action; .line 12884 invoke-virtual {p2, v0}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action;->runIfNecessary(Landroidx/recyclerview/widget/RecyclerView;)V if-eqz p1, :cond_6 iget-boolean p1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRunning:Z if-eqz p1, :cond_6 const/4 p1, 0x1 iput-boolean p1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mPendingInitialRun:Z .line 12889 iget-object p0, v0, Landroidx/recyclerview/widget/RecyclerView;->mViewFlinger:Landroidx/recyclerview/widget/RecyclerView$ViewFlinger; invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$ViewFlinger;->postOnAnimation()V :cond_6 return-void .end method .method protected onChildAttachedToWindow(Landroid/view/View;)V .locals 2 .line 12926 invoke-virtual {p0, p1}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->getChildPosition(Landroid/view/View;)I move-result v0 invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->getTargetPosition()I move-result v1 if-ne v0, v1, :cond_0 iput-object p1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetView:Landroid/view/View; .line 12928 sget-boolean p0, Landroidx/recyclerview/widget/RecyclerView;->sVerboseLoggingEnabled:Z if-eqz p0, :cond_0 const-string p0, "RecyclerView" const-string p1, "smooth scroll target view has been attached" .line 12929 invoke-static {p0, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I :cond_0 return-void .end method .method protected abstract onSeekTargetStep(IILandroidx/recyclerview/widget/RecyclerView$State;Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action;)V .end method .method protected abstract onStart()V .end method .method protected abstract onStop()V .end method .method protected abstract onTargetFound(Landroid/view/View;Landroidx/recyclerview/widget/RecyclerView$State;Landroidx/recyclerview/widget/RecyclerView$SmoothScroller$Action;)V .end method .method public setTargetPosition(I)V .locals 0 iput p1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetPosition:I return-void .end method .method start(Landroidx/recyclerview/widget/RecyclerView;Landroidx/recyclerview/widget/RecyclerView$LayoutManager;)V .locals 2 .line 12737 iget-object v0, p1, Landroidx/recyclerview/widget/RecyclerView;->mViewFlinger:Landroidx/recyclerview/widget/RecyclerView$ViewFlinger; invoke-virtual {v0}, Landroidx/recyclerview/widget/RecyclerView$ViewFlinger;->stop()V iget-boolean v0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mStarted:Z if-eqz v0, :cond_0 .line 12740 new-instance v0, Ljava/lang/StringBuilder; const-string v1, "An instance of " invoke-direct {v0, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class; move-result-object v1 invoke-virtual {v1}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " was started more than once. Each instance of" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 .line 12741 invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class; move-result-object v1 invoke-virtual {v1}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String; move-result-object v1 invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 const-string v1, " is intended to only be used once. You should create a new instance for each use." invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 const-string v1, "RecyclerView" .line 12740 invoke-static {v1, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I :cond_0 iput-object p1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclerView:Landroidx/recyclerview/widget/RecyclerView; iput-object p2, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mLayoutManager:Landroidx/recyclerview/widget/RecyclerView$LayoutManager; iget p2, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetPosition:I const/4 v0, -0x1 if-eq p2, v0, :cond_1 .line 12751 iget-object p1, p1, Landroidx/recyclerview/widget/RecyclerView;->mState:Landroidx/recyclerview/widget/RecyclerView$State; iget p2, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetPosition:I iput p2, p1, Landroidx/recyclerview/widget/RecyclerView$State;->mTargetPosition:I const/4 p1, 0x1 iput-boolean p1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRunning:Z iput-boolean p1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mPendingInitialRun:Z .line 12754 invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->getTargetPosition()I move-result p2 invoke-virtual {p0, p2}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->findViewByPosition(I)Landroid/view/View; move-result-object p2 iput-object p2, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetView:Landroid/view/View; .line 12755 invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->onStart()V iget-object p2, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclerView:Landroidx/recyclerview/widget/RecyclerView; .line 12756 iget-object p2, p2, Landroidx/recyclerview/widget/RecyclerView;->mViewFlinger:Landroidx/recyclerview/widget/RecyclerView$ViewFlinger; invoke-virtual {p2}, Landroidx/recyclerview/widget/RecyclerView$ViewFlinger;->postOnAnimation()V iput-boolean p1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mStarted:Z return-void .line 12749 :cond_1 new-instance p0, Ljava/lang/IllegalArgumentException; const-string p1, "Invalid target position" invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p0 .end method .method protected final stop()V .locals 3 iget-boolean v0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRunning:Z if-nez v0, :cond_0 return-void :cond_0 const/4 v0, 0x0 iput-boolean v0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRunning:Z .line 12806 invoke-virtual {p0}, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->onStop()V iget-object v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclerView:Landroidx/recyclerview/widget/RecyclerView; .line 12807 iget-object v1, v1, Landroidx/recyclerview/widget/RecyclerView;->mState:Landroidx/recyclerview/widget/RecyclerView$State; const/4 v2, -0x1 iput v2, v1, Landroidx/recyclerview/widget/RecyclerView$State;->mTargetPosition:I const/4 v1, 0x0 iput-object v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetView:Landroid/view/View; iput v2, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mTargetPosition:I iput-boolean v0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mPendingInitialRun:Z iget-object v0, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mLayoutManager:Landroidx/recyclerview/widget/RecyclerView$LayoutManager; .line 12812 invoke-virtual {v0, p0}, Landroidx/recyclerview/widget/RecyclerView$LayoutManager;->onSmoothScrollerStopped(Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;)V iput-object v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mLayoutManager:Landroidx/recyclerview/widget/RecyclerView$LayoutManager; iput-object v1, p0, Landroidx/recyclerview/widget/RecyclerView$SmoothScroller;->mRecyclerView:Landroidx/recyclerview/widget/RecyclerView; return-void .end method