Package 

Class RecyclerView.SmoothScroller.Action

    • Constructor Detail

      • RecyclerView.SmoothScroller.Action

        RecyclerView.SmoothScroller.Action(int dx, int dy)
        Parameters:
        dx - Pixels to scroll horizontally
        dy - Pixels to scroll vertically
      • RecyclerView.SmoothScroller.Action

        RecyclerView.SmoothScroller.Action(int dx, int dy, int duration)
        Parameters:
        dx - Pixels to scroll horizontally
        dy - Pixels to scroll vertically
        duration - Duration of the animation in milliseconds
      • RecyclerView.SmoothScroller.Action

        RecyclerView.SmoothScroller.Action(int dx, int dy, int duration, Interpolator interpolator)
        Parameters:
        dx - Pixels to scroll horizontally
        dy - Pixels to scroll vertically
        duration - Duration of the animation in milliseconds
        interpolator - Interpolator to be used when calculating scroll position in eachanimation step
    • Method Detail

      • jumpTo

         void jumpTo(int targetPosition)

        Instead of specifying pixels to scroll, use the target position to jump using scrollToPosition.

        You may prefer using this method if scroll target is really far away and you preferto jump to a location and smooth scroll afterwards.

        Note that calling this method takes priority over other update methods such as update, setX, setY and #setInterpolator. If you call jumpTo, the other changes will not be considered for this animationframe.

        Parameters:
        targetPosition - The target item position to scroll to using instant scrolling.
      • setInterpolator

         void setInterpolator(@Nullable() Interpolator interpolator)

        Sets the interpolator to calculate scroll steps

        Parameters:
        interpolator - The interpolator to use.
      • update

         void update(@Px() int dx, @Px() int dy, int duration, @Nullable() Interpolator interpolator)

        Updates the action with given parameters.

        Parameters:
        dx - Pixels to scroll horizontally
        dy - Pixels to scroll vertically
        duration - Duration of the animation in milliseconds
        interpolator - Interpolator to be used when calculating scroll position in eachanimation step