Stay organized with collections
Save and categorize content based on your preferences.
AnimationUtils
open class AnimationUtils
Defines common utilities for working with animations.
Summary
Public constructors
AnimationUtils
AnimationUtils()
Public methods
currentAnimationTimeMillis
open static fun currentAnimationTimeMillis(): Long
Returns the current animation time in milliseconds. This time should be used when invoking Animation.setStartTime(long)
. Refer to android.os.SystemClock
for more information about the different available clocks. The clock used by this method is not the "wall" clock (it is not System.currentTimeMillis
).
Return |
Long |
the current animation time in milliseconds |
loadAnimation
open static fun loadAnimation(
context: Context!,
id: Int
): Animation!
Loads an Animation
object from a resource
Parameters |
context |
Context!: Application context used to access resources |
id |
Int: The resource id of the animation to load |
Return |
Animation! |
The animation object referenced by the specified id |
Exceptions |
android.content.res.Resources.NotFoundException |
when the animation cannot be loaded |
loadInterpolator
open static fun loadInterpolator(
context: Context!,
id: Int
): Interpolator!
Loads an Interpolator
object from a resource
Parameters |
context |
Context!: Application context used to access resources |
id |
Int: The resource id of the animation to load |
Return |
Interpolator! |
The interpolator object referenced by the specified id |
Exceptions |
android.content.res.Resources.NotFoundException |
|
loadLayoutAnimation
open static fun loadLayoutAnimation(
context: Context!,
id: Int
): LayoutAnimationController!
Loads a LayoutAnimationController
object from a resource
Parameters |
context |
Context!: Application context used to access resources |
id |
Int: The resource id of the animation to load |
Exceptions |
android.content.res.Resources.NotFoundException |
when the layout animation controller cannot be loaded |
makeInAnimation
open static fun makeInAnimation(
c: Context!,
fromLeft: Boolean
): Animation!
Make an animation for objects becoming visible. Uses a slide and fade effect.
Parameters |
c |
Context!: Context for loading resources |
fromLeft |
Boolean: is the object to be animated coming from the left |
makeInChildBottomAnimation
open static fun makeInChildBottomAnimation(c: Context!): Animation!
Make an animation for objects becoming visible. Uses a slide up and fade effect.
Parameters |
c |
Context!: Context for loading resources |
makeOutAnimation
open static fun makeOutAnimation(
c: Context!,
toRight: Boolean
): Animation!
Make an animation for objects becoming invisible. Uses a slide and fade effect.
Parameters |
c |
Context!: Context for loading resources |
toRight |
Boolean: is the object to be animated exiting to the right |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]