-
public class AnimatorHelper
-
-
Method Summary
Modifier and Type Method Description static voidalphaAnimator(@NonNull() List<Animator> animators, @NonNull() View view, @FloatRange(from = 0.0, to = 1.0) float alphaFrom)This is the default animator. static voidslideInFromLeftAnimator(@NonNull() List<Animator> animators, @NonNull() View view, RecyclerView recyclerView, @FloatRange(from = 0.0, to = 1.0) float percent)Item will slide from Left to Right. static voidslideInFromRightAnimator(@NonNull() List<Animator> animators, @NonNull() View view, RecyclerView recyclerView, @FloatRange(from = 0.0, to = 1.0) float percent)Item will slide from Right to Left. static voidslideInFromTopAnimator(@NonNull() List<Animator> animators, @NonNull() View view, RecyclerView recyclerView)Item will slide from Top of the screen to its natural position. static voidslideInFromBottomAnimator(@NonNull() List<Animator> animators, @NonNull() View view, RecyclerView recyclerView)Item will slide from Bottom of the screen to its natural position. static voidscaleAnimator(@NonNull() List<Animator> animators, @NonNull() View view, @FloatRange(from = 0.0, to = 1.0) float scaleFrom)Item will scale to {@code 1.0f}.static voidflipAnimator(@NonNull() List<Animator> animators, @NonNull() View view)Item will flip from {@code 0.0f}to{@code 1.0f}.static voidsetDuration(@NonNull() List<Animator> animators, @IntRange(from = 0) long duration)Adds a custom duration to the current view. -
-
Method Detail
-
alphaAnimator
static void alphaAnimator(@NonNull() List<Animator> animators, @NonNull() View view, @FloatRange(from = 0.0, to = 1.0) float alphaFrom)
This is the default animator.
- Parameters:
animators- user defined list of animatorsview- itemView to animatealphaFrom- starting alpha value
-
slideInFromLeftAnimator
static void slideInFromLeftAnimator(@NonNull() List<Animator> animators, @NonNull() View view, RecyclerView recyclerView, @FloatRange(from = 0.0, to = 1.0) float percent)
Item will slide from Left to Right.
- Parameters:
animators- user defined list of animatorsview- itemView to animatepercent- any % multiplier (between 0 and 1) of the LayoutManager Width
-
slideInFromRightAnimator
static void slideInFromRightAnimator(@NonNull() List<Animator> animators, @NonNull() View view, RecyclerView recyclerView, @FloatRange(from = 0.0, to = 1.0) float percent)
Item will slide from Right to Left.
- Parameters:
animators- user defined list of animatorsview- ItemView to animatepercent- Any % multiplier (between 0 and 1) of the LayoutManager Width
-
slideInFromTopAnimator
static void slideInFromTopAnimator(@NonNull() List<Animator> animators, @NonNull() View view, RecyclerView recyclerView)
Item will slide from Top of the screen to its natural position.
- Parameters:
animators- user defined list of animatorsview- itemView to animate
-
slideInFromBottomAnimator
static void slideInFromBottomAnimator(@NonNull() List<Animator> animators, @NonNull() View view, RecyclerView recyclerView)
Item will slide from Bottom of the screen to its natural position.
- Parameters:
animators- user defined list of animatorsview- itemView to animate
-
scaleAnimator
static void scaleAnimator(@NonNull() List<Animator> animators, @NonNull() View view, @FloatRange(from = 0.0, to = 1.0) float scaleFrom)
Item will scale to
{@code 1.0f}.- Parameters:
animators- user defined list of animatorsview- itemView to animatescaleFrom- initial scale value
-
flipAnimator
static void flipAnimator(@NonNull() List<Animator> animators, @NonNull() View view)
Item will flip from
{@code 0.0f}to{@code 1.0f}.- Parameters:
animators- user defined list of animatorsview- itemView to animate
-
setDuration
static void setDuration(@NonNull() List<Animator> animators, @IntRange(from = 0) long duration)
Adds a custom duration to the current view.
- Parameters:
animators- user defined list of animatorsduration- duration in milliseconds
-
-
-
-