Skip to content

Guide · Open source

How to use AndroidViewAnimations: install and play effects

Updated · written with AI from the project's own documentation and checked against our catalogue data

AndroidViewAnimations is an open-source Android library that provides a collection of named view animation effects, such as fades, slides, zooms, bounces and flips. This guide shows Android developers how to add it to a Gradle project, play an effect on a view with a chained call, and choose from the available effect names. By the end you will be able to add a named animation to a button, card or text view without writing animation code from scratch.

Android View Animationsdaimajia/AndroidViewAnimations · ★ 12.4k · MIT

Quick start

  1. 1Check prerequisites. Make sure you have Android Studio or a Gradle-based Android project.
  2. 2Add the Gradle dependency. Add implementation 'com.daimajia.androidanimations:library:2.4@aar' to your module's dependencies block.
  3. 3Follow the easing dependency note. Review the README's usage section, which says the project depends on Android Easing Functions.
  4. 4Find your target view. Get the view you want to animate, for example with findViewById and its resource id.
  5. 5Pick an effect name. Choose a technique from the README's named list, such as Tada, FadeInUp or ZoomIn.
  6. 6Chain the call and play it. Use YoYo.with(Techniques.YourEffect), set duration and repeat if needed, then call playOn with the view.

What AndroidViewAnimations is and who it suits

The library collects pre-built animation effects that you apply to Android views. Instead of writing animation code yourself, you pick an effect by name and play it on a view. The project's README says it relies on a companion project, Android Easing Functions, to make motion look more natural, so that dependency is part of the setup.

It suits developers who want quick entrance or attention animations, developers prototyping a UI who need placeholder motion, and teams that want a simple, named set of effects. It is less suited to apps that need complex, custom animation sequences, because the README shows a single chained call and no advanced timeline features.

Install AndroidViewAnimations with Gradle

The README lists two dependency formats. For a Gradle-based Android project, add the dependency to your module's dependencies block. The README also shows a Maven form if your build uses Maven.

Because the README says the library depends on the Android Easing Functions project, check the README's usage section for that dependency before you build.

  • Prerequisites: Android Studio or a Gradle-based Android project
  • Gradle dependency from the README: implementation 'com.daimajia.androidanimations:library:2.4@aar'
dependencies { implementation 'com.daimajia.androidanimations:library:2.4@aar' }

Play your first animation with YoYo

The README's example is written as 'Just like play Yo-yo.' You start with YoYo.with, pass a technique from the Techniques set, optionally set the duration and repeat count, and call playOn with the target view.

In the README example the view is found with findViewById and the id R.id.edit_area. Replace that id with the id of your own view. The duration is given in milliseconds and the repeat count is a number of repeats.

  • YoYo.with(...) takes a technique name, such as Tada
  • duration(700) sets the length of the animation
  • repeat(5) sets how many times it repeats
  • playOn(view) starts it on the view you pass in
YoYo.with(Techniques.Tada) .duration(700) .repeat(5) .playOn(findViewById(R.id.edit_area));

Choose an effect from the named list

The README groups the effects into categories. Attention effects include Flash, Pulse, RubberBand, Shake, Swing, Wobble, Bounce, Tada, StandUp and Wave. Other groups cover Special, Bounce, Fade, Flip, Rotate, Slide and Zoom.

Fade, slide and zoom each include in and out variants. For example, the README lists FadeIn, FadeInUp, FadeOutDown, SlideInLeft, SlideOutRight, ZoomIn and ZoomOutUp. The Flip group is shorter and lists FlipInX, FlipOutX and FlipOutY.

  • Attention: Flash, Pulse, RubberBand, Shake, Swing, Wobble, Bounce, Tada, StandUp, Wave
  • Special: Hinge, RollIn, RollOut, Landing, TakingOff, DropOut
  • Fade: FadeIn family and FadeOut family
  • Slide: SlideInLeft, SlideInRight, SlideInUp, SlideInDown and matching SlideOut names
  • Zoom: ZoomIn family and ZoomOut family

Check compatibility before you rely on it

The metadata for this project shows its last push in August 2021. The source material does not confirm how the library behaves on newer Android versions, so test on the Android versions your app supports before shipping.

If you need a library that is actively maintained, or animations that go beyond a single named effect, compare the options listed below before committing.

  • Test on the Android versions your app targets
  • Confirm the easing dependency builds with your project setup
  • Consider Lottie Android, Animate.css or AFViewShaker if they fit better

What people use it for

  • Adding a Tada or Pulse attention effect to a call-to-action button
  • Animating a card in with FadeInUp or SlideInUp
  • Using ZoomIn on a text view as a simple entrance effect
  • Prototyping screen motion with placeholder effects before writing custom code

Frequently asked questions

Is AndroidViewAnimations free to use?

The project is released under the MIT licence, as stated in the item's licence field. MIT is a permissive open-source licence, but check the licence text itself before you rely on it in a commercial product.

What do I need to use AndroidViewAnimations?

The README's install method is a Gradle dependency, so you need Android Studio or a Gradle-based Android project. The library targets Android only.

How do I install AndroidViewAnimations?

Add implementation 'com.daimajia.androidanimations:library:2.4@aar' to your Gradle dependencies. The README also shows a Maven dependency if you use Maven.

How do I play an animation on a view?

Call YoYo.with(Techniques.Tada) with your chosen effect, optionally set duration and repeat, then call playOn with your view. The README example uses findViewById with a view id.

Does AndroidViewAnimations work with newer Android versions?

The source does not confirm this. The metadata shows the last push in August 2021, so test on the Android versions your app supports.

What are the alternatives to AndroidViewAnimations?

The comparable projects listed are Lottie Android, Animate.css and AFViewShaker. AFViewShaker and Animate.css are also credited in the README's thanks section as sources of inspiration.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

AndroidViewAnimations suits Android developers who want quick, named entrance or attention effects on buttons, cards or text, and prototypes that need placeholder motion. Pick another option if you need an actively maintained library, complex animation sequences, or support you can verify on newer Android versions.

Install options & downloads