Class AnimationUtils
- java.lang.Object
-
- com.yoti.mobile.android.common.ui.widgets.utils.AnimationUtils
-
public class AnimationUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAnimationUtils.AnimateToTransparentListenerstatic classAnimationUtils.AnimationListenerAdapterThis adapter class provides empty implementations of the methods fromAnimation.AnimationListener.static classAnimationUtils.OnAnimationEndstatic classAnimationUtils.OnAnimationLoopstatic classAnimationUtils.OnAnimationStartstatic classAnimationUtils.OnTransitionStart
-
Field Summary
Fields Modifier and Type Field Description static floatANIMATION_PLAY_SPEEDstatic floatANIMATION_REVERSE_PLAY_SPEED
-
Constructor Summary
Constructors Constructor Description AnimationUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidanimateAlpha(android.view.View view, float startAlpha, float targetAlpha, long duration)static voidanimateAlpha(android.view.View view, float startAlpha, float targetAlpha, long duration, android.animation.Animator.AnimatorListener animatorListener)static java.lang.RunnableanimateFromJson(com.airbnb.lottie.LottieAnimationView view, java.lang.String jsonFileName)Animates a view using a json animation file immediately.static java.lang.RunnableanimateFromJson(com.airbnb.lottie.LottieAnimationView view, java.lang.String jsonFileName, boolean reversed)Animates a view using a json animation file immediately.static java.lang.RunnableanimateFromJson(com.airbnb.lottie.LottieAnimationView view, java.lang.String jsonFileName, long delay)Animates a view using a json animation file after a certain delay.static java.lang.RunnableanimateFromJson(com.airbnb.lottie.LottieAnimationView view, java.lang.String jsonFileName, long delay, boolean reversed)Animates a view using a json animation file.static voidanimateTextSize(android.widget.TextView view, int startTextSize, int targetTextSize, long duration)static voidanimateToTransparent(android.view.View view, long duration, int endVisibilityState)Animates the view from an opaque state to a transparent state and then sets it's visibility to the specified state.static voidanimateToTransparent(android.view.View view, long duration, int endVisibilityState, AnimationUtils.AnimateToTransparentListener onAnimationEndCallback)Animates the view from an opaque state to a transparent state and then sets it's visibility to the specified state.static booleanareSystemAnimationsEnabled(android.content.Context context)Gets a value indicating whether system animations are enabled or not.
-
-
-
Field Detail
-
ANIMATION_PLAY_SPEED
public static final float ANIMATION_PLAY_SPEED
- See Also:
- Constant Field Values
-
ANIMATION_REVERSE_PLAY_SPEED
public static final float ANIMATION_REVERSE_PLAY_SPEED
- See Also:
- Constant Field Values
-
-
Method Detail
-
animateAlpha
public static void animateAlpha(android.view.View view, float startAlpha, float targetAlpha, long duration)
-
animateAlpha
public static void animateAlpha(android.view.View view, float startAlpha, float targetAlpha, long duration, android.animation.Animator.AnimatorListener animatorListener)
-
animateFromJson
public static java.lang.Runnable animateFromJson(com.airbnb.lottie.LottieAnimationView view, java.lang.String jsonFileName)Animates a view using a json animation file immediately.- Parameters:
view- to animatejsonFileName- animation- Returns:
- true if animation played, false otherwise
-
animateFromJson
public static java.lang.Runnable animateFromJson(com.airbnb.lottie.LottieAnimationView view, java.lang.String jsonFileName, long delay)Animates a view using a json animation file after a certain delay.- Parameters:
view- to animatejsonFileName- animationdelay- ms before starting animation- Returns:
- true if animation played, false otherwise
-
animateFromJson
public static java.lang.Runnable animateFromJson(com.airbnb.lottie.LottieAnimationView view, java.lang.String jsonFileName, boolean reversed)Animates a view using a json animation file immediately. The animation will be reversed.- Parameters:
view- to animatejsonFileName- animationreversed- true if the animation should be reversed, false otherwise- Returns:
- true if animation played, false otherwise
-
animateFromJson
public static java.lang.Runnable animateFromJson(com.airbnb.lottie.LottieAnimationView view, java.lang.String jsonFileName, long delay, boolean reversed)Animates a view using a json animation file.- Parameters:
view- to animatejsonFileName- animationdelay- ms before starting animationreversed- true if the animation should be reversed, false otherwise- Returns:
- true if animation played, false otherwise
-
animateTextSize
public static void animateTextSize(android.widget.TextView view, int startTextSize, int targetTextSize, long duration)
-
animateToTransparent
public static void animateToTransparent(@NonNull android.view.View view, long duration, int endVisibilityState)Animates the view from an opaque state to a transparent state and then sets it's visibility to the specified state.- Parameters:
view- The view that will become transparent.duration- The duration of the animation.endVisibilityState- The visibility state that the view will be set to after the animation.
-
animateToTransparent
public static void animateToTransparent(@NonNull android.view.View view, long duration, int endVisibilityState, @Nullable AnimationUtils.AnimateToTransparentListener onAnimationEndCallback)Animates the view from an opaque state to a transparent state and then sets it's visibility to the specified state.- Parameters:
view- The view that will become transparent.duration- The duration of the animation.endVisibilityState- The visibility state that the view will be set to after the animation.
-
areSystemAnimationsEnabled
public static boolean areSystemAnimationsEnabled(@NonNull android.content.Context context)Gets a value indicating whether system animations are enabled or not.- Parameters:
context- The current context.- Returns:
- True if animations are enabled, otherwise false.
-
-