Package 

Interface AnimatedViewHolder


  • 
    public interface AnimatedViewHolder
    
                        

    Interface for {@code itemView} addition/removal animation.

    Used by {@code FlexibleItemAnimator} when notify events occur. If any of these methods are implemented, the ItemAnimator extending FlexibleItemAnimator is skipped in favour of this ViewHolder implementation.

    • Method Summary

      Modifier and Type Method Description
      abstract boolean preAnimateAddImpl() Prepares the View for Add Animation.
      abstract boolean preAnimateRemoveImpl() Prepares the View for Remove Animation.
      abstract boolean animateAddImpl(ViewPropertyAnimatorListener listener, long addDuration, int index) Animates this ViewHolder with this specific Add Animation.
      abstract boolean animateRemoveImpl(ViewPropertyAnimatorListener listener, long removeDuration, int index) Animates this ViewHolder with this specific Remove Animation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • preAnimateAddImpl

         abstract boolean preAnimateAddImpl()

        Prepares the View for Add Animation. If this method is implemented and returns {@code true}, then this method is performed against {@code FlexibleItemAnimator#preAnimateAddImpl(RecyclerView.ViewHolder)} which will be ignored.

        Default value is {@code false}.

      • preAnimateRemoveImpl

         abstract boolean preAnimateRemoveImpl()

        Prepares the View for Remove Animation. If this method is implemented and returns {@code true}, then this method is performed against {@code FlexibleItemAnimator#preAnimateRemoveImpl(RecyclerView.ViewHolder)} which will be ignored.

        Default value is {@code false}.

      • animateAddImpl

         abstract boolean animateAddImpl(ViewPropertyAnimatorListener listener, long addDuration, int index)

        Animates this ViewHolder with this specific Add Animation.

        By returning {@code true} this ViewHolder will perform customized animation, while byreturning {@code false} generic animation is applied also for this ViewHolder.

        Parameters:
        listener - should assign to {@code ViewCompat.animate().setListener(listener)}
        addDuration - duration of add animation
        index - order of execution, starts with 0
      • animateRemoveImpl

         abstract boolean animateRemoveImpl(ViewPropertyAnimatorListener listener, long removeDuration, int index)

        Animates this ViewHolder with this specific Remove Animation.

        By returning {@code true} this ViewHolder will perform customized animation, while byreturning {@code false} generic animation is applied also for this ViewHolder.

        Parameters:
        listener - should assign to {@code ViewCompat.animate().setListener(listener)}
        removeDuration - duration of remove animation
        index - order of execution, starts with 0 @return {@code true} to animate with thisimplementation, {@code false} to use the generic animation.