Cute view animation collection.

Overview

Android View Animations Build Status

One day, I saw an iOS library, which is a view shaker, it's very beautiful. I think Android also need one, and should be better.

So, I started to collect animation effects... and in two days, this project born.

Demo

Download Demo

Usage

Since Version 2.0, NineOldAndroids has been removed. Thanks Jake Wharton.

For making animations more real, I created another project named Android Easing Functions which is an implementations of easing functions on Android. So, we need to dependent that project.

Step 1

Gradle

dependencies {
    implementation 'com.daimajia.androidanimations:library:2.4@aar'
}

Maven

<dependency>
    <groupId>com.daimajia.androidanimation</groupId>
    <artifactId>library</artifactId>
    <version>2.4</version>
</dependency>

Step 2

Just like play Yo-yo.

YoYo.with(Techniques.Tada)
    .duration(700)
    .repeat(5)
    .playOn(findViewById(R.id.edit_area));

Effects

Attension

Flash, Pulse, RubberBand, Shake, Swing, Wobble, Bounce, Tada, StandUp, Wave

Special

Hinge, RollIn, RollOut,Landing,TakingOff,DropOut

Bounce

BounceIn, BounceInDown, BounceInLeft, BounceInRight, BounceInUp

Fade

FadeIn, FadeInUp, FadeInDown, FadeInLeft, FadeInRight

FadeOut, FadeOutDown, FadeOutLeft, FadeOutRight, FadeOutUp

Flip

FlipInX, FlipOutX, FlipOutY

Rotate

RotateIn, RotateInDownLeft, RotateInDownRight, RotateInUpLeft, RotateInUpRight

RotateOut, RotateOutDownLeft, RotateOutDownRight, RotateOutUpLeft, RotateOutUpRight

Slide

SlideInLeft, SlideInRight, SlideInUp, SlideInDown

SlideOutLeft, SlideOutRight, SlideOutUp, SlideOutDown

Zoom

ZoomIn, ZoomInDown, ZoomInLeft, ZoomInRight, ZoomInUp

ZoomOut, ZoomOutDown, ZoomOutLeft, ZoomOutRight, ZoomOutUp

Welcome contribute your amazing animation effect. :-D

Thanks

Why YoYo?

YoYo is a toy, with a lot of Techniques.

About me

(2013) A student in mainland China.

Welcome to offer me an internship. If you have any new idea about this project, feel free to contact me.

(2019) Five years later, now I become an investment associate in China.

Welcome to send your business plan to me. Maybe I would have a better understanding on your startup project than others. Trust me.

Comments
  • NullPointerException when the animation end

    NullPointerException when the animation end

    i have download your demo,and run it ,but when i touch one list item,it is broken.and show the NullPointerException . i found if i set repeat 1,it is ok,but if i set others ,it is broken. q5ax3gc wryoddwl 70k ly

    bug 
    opened by csr91706 24
  • Custom Animations

    Custom Animations

    Greetings,

    I have been browsing the code for a few hours, and I couldn't find a way to use the library with custom animations, meaning that we are limited by the animations provided in the Techniques enum.

    Is there any way I can extends BaseViewAnimator to provide custom (programmer defined) animations to be used within the library or do I need to roll old fashioned animations manually?

    Thanks Robert

    opened by robertoestivill 10
  • How to set the center point of animations?

    How to set the center point of animations?

    Hi. This is a very nice library to use animation in android. But why it is different effect in my project ?such as DropOutAnimation. I import it by gradle. Can you help me to use if you have time ? Thanks

    opened by TommyTC 8
  • launcher icon?

    launcher icon?

    Hello, First i wanted to say thanks for the library, it is truly useful. I do have 1 question though. After adding this library to my project my app icon reverts back to the stock android icon. My icon is named ic_launcher2, and the manifest merger forces me to change it to ic_launcher. After that my icon no longer shows up, and the android one does. Any ideas why and how to fix it? I'm using Android studio btw.

    Thanks Karsten.

    opened by Karsten12 7
  • Fade in rather than intended animation when view first displayed

    Fade in rather than intended animation when view first displayed

    I'm trying to use SlideInLeft when the visibility is set for a particular view. for some inexplicable reason, the first time this code executes, the view fades in rather than slides in, I thought perhaps if could be an issue with android:animateLayoutChanges="true", however I have explicitly set it to false.

    Any ideas? I've tried various hacks to achieve the desired behavior, but nothing has thus far worked.

        public void setNewLabelVisible(boolean isVisible) {
            this.layoutNewLabel.setVisibility(isVisible ? VISIBLE : INVISIBLE);
            if (isVisible) {
                YoYo.with(Techniques.SlideInLeft)
                        .duration(1000)
                        .playOn(layoutNewLabel);
            }
        }
    
    opened by HolySamosa 6
  • Interpolators have no effect

    Interpolators have no effect

    I tried a lot of interpolators and None of them have any effect on the animations. I'm doing it this way:

    YoYo.with(Techniques.SlideOutDown)
        .duration(200)
        .interpolate(new BounceInterpolator())    // Nothing works here
        .withListener(new Animator.AnimatorListener() {
        @Override
        public void onAnimationStart(Animator animation) { }
    
            @Override
            public void onAnimationEnd(Animator animation) { }
    
            @Override
            public void onAnimationCancel(Animator animation) { }
    
            @Override
            public void onAnimationRepeat(Animator animation) { }
        })
        .playOn(view);
    

    I think it might be related to AnimationComposer not calling BaseViewAnimator's setInterpolator().

    opened by SudhanshuAggarwal 6
  • Apply a software license to your code

    Apply a software license to your code

    As it stands, it is a copyright violation (in most countries) for anyone to use your code, as you have not licensed it.

    Please consider applying a license to your project, such as the Apache Software License 2.0, to state the terms under which people can use your code. You will see the Apache license used by most libraries for Android, including the NineOldAndroids project upon which your library depends.

    opened by commonsguy 6
  • Rejected by

    Rejected by "Google Play Store"

    Hi Daimajia, thanks for an awesome library. While adding the library in my project "Google Play Store" rejects my app with the following message "We detected that at least one APK version in your recent upload isn’t using Android Pay correctly. Including APK version(s) 208 in your submission could cause your app to be rejected for violating our Payments policy". I know that AndroidViewAnimations is nothing to do with "Android Pay" up to my knowledge. Kindly help me to resolve the issue. Thanks in advance.

    opened by excitepv 5
  • Progard profiles

    Progard profiles

    Hi

    When I use Progards, your library couldn't be referenced.

    I have already added -keep class com.daimajia.androidanimations.** { *; } into proguard-rules, but it doesn't work. Is there anyone know how to fix this?

    opened by rex3du 5
  • New animation

    New animation

    Please add to the library move animation. For example there is an image on the screen and invisible container. The image should move in the container. Thanks!

    wontfix 
    opened by crysan 5
  • my app stop when reach to this yoyo code

    my app stop when reach to this yoyo code

    When the application executes the code, the app stops and throws this error.

    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/daimajia/easing/Skill;
    at com.daimajia.androidanimations.library.specials.in.DropOutAnimator.prepare(DropOutAnimator.java:15)
            at com.daimajia.androidanimations.library.BaseViewAnimator.setTarget(BaseViewAnimator.java:54)
            at com.daimajia.androidanimations.library.YoYo.play(YoYo.java:254)
            at com.daimajia.androidanimations.library.YoYo.access$1500(YoYo.java:38)
            at com.daimajia.androidanimations.library.YoYo$AnimationComposer.playOn(YoYo.java:215)
            at home.lernesto.budgetquick.StartActivity.onResume(StartActivity.java:48)
            at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1361)
            at android.app.Activity.performResume(Activity.java:7344)
            at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3763)
            at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3828)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3036)
            at android.app.ActivityThread.-wrap11(Unknown Source:0)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
            at android.os.Handler.dispatchMessage(Handler.java:105)
            at android.os.Looper.loop(Looper.java:164)
            at android.app.ActivityThread.main(ActivityThread.java:6938)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
         Caused by: java.lang.ClassNotFoundException: Didn't find class "com.daimajia.easing.Skill" on path: DexPathList[[zip file "/data/app/home.lernesto.budgetquick-L0NXYaChdp1szfwFsYZ6YQ==/base.apk"],nativeLibraryDirectories=[/data/app/home.lernesto.budgetquick-L0NXYaChdp1szfwFsYZ6YQ==/lib/arm64, /system/lib64, /system/vendor/lib64]]
            at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
            at com.daimajia.androidanimations.library.specials.in.DropOutAnimator.prepare(DropOutAnimator.java:15) 
            at com.daimajia.androidanimations.library.BaseViewAnimator.setTarget(BaseViewAnimator.java:54) 
            at com.daimajia.androidanimations.library.YoYo.play(YoYo.java:254) 
            at com.daimajia.androidanimations.library.YoYo.access$1500(YoYo.java:38) 
            at com.daimajia.androidanimations.library.YoYo$AnimationComposer.playOn(YoYo.java:215) 
            at home.lernesto.budgetquick.StartActivity.onResume(StartActivity.java:48) 
            at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1361) 
            at android.app.Activity.performResume(Activity.java:7344) 
            at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3763) 
            at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3828) 
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3036) 
            at android.app.ActivityThread.-wrap11(Unknown Source:0) 
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) 
            at android.os.Handler.dispatchMessage(Handler.java:105) 
            at android.os.Looper.loop(Looper.java:164) 
            at android.app.ActivityThread.main(ActivityThread.java:6938) 
            at java.lang.reflect.Method.invoke(Native Method) 
            at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 
    

    An here my code. public class StartActivity extends AppCompatActivity { // Constant private static final int TIME_LIFE_ACTIVITY = 2500; private static final int TIME_ANIMATION= 2000;

    // Visual Variables private View imgvAppName;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_start);
    

    // To link file XML imgvAppName = findViewById(R.id.imgv_app_name);

        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                startActivity(new Intent(StartActivity.this, MainActivity.class));
                finish();
            }
        };
    
        Timer timer = new Timer();
        timer.schedule(task, TIME_LIFE_ACTIVITY);
    }
    
    @Override
    protected void onResume() {
        super.onResume();
        YoYo.with(Techniques.DropOut).duration(TIME_ANIMATION).playOn(imgvAppName);
    }
    
    opened by nokyslash 4
  • access YoYoString make animation auto run

    access YoYoString make animation auto run

    I got some trouble when try to use YoYoString to control animation. When i assign YoYoString, the animation auto run. Can some one explain me the problem, sorry for my bad english

    opened by dphoanghiep1998 1
  • Compiles without problem but crashes on phone with

    Compiles without problem but crashes on phone with "there is a bug" error message

    App loads in phone but when pressing the button to start animation program crashes and closes. The phone displays message that the app "has a bug" and crashed. I've checked code against many online tutorials and cannot locate the issue.

    MainActivity.java

    package com.example.textreader6;
    
    import androidx.appcompat.app.AppCompatActivity;
    
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    import android.widget.TextView;
    
    import com.daimajia.androidanimations.library.Techniques;
    import com.daimajia.androidanimations.library.YoYo;
    
    public class MainActivity extends AppCompatActivity {
        Button button;
        TextView textView;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            button = findViewById(R.id.btn);
            textView = findViewById(R.id.textview);
    
            button.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    YoYo.with(Techniques.Swing).duration(1000).repeat(1).playOn(textView);
                }
            });
        }
    }
    

    build.gradle:

    dependencies {
    
        implementation 'androidx.appcompat:appcompat:1.4.1'
        implementation 'com.google.android.material:material:1.6.0'
        implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    
        implementation 'com.daimajia.easing:library:2.0@aar'
        implementation 'com.daimajia.androidanimations:library:2.3@aar'
    
        testImplementation 'junit:junit:4.13.2'
        androidTestImplementation 'androidx.test.ext:junit:1.1.3'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    }
    

    activity_main.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="vertical"
        tools:context=".MainActivity">
    
        <TextView
            android:id="@+id/textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:text="Hello World!"
            android:textSize="30sp" />
    
        <Button
            android:id="@+id/btn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentBottom="true"
            android:text="Button" />
    </RelativeLayout>
    
    opened by kiteandwindsurfer 2
  • Animation not working in Kotlin

    Animation not working in Kotlin

    Hi! This is my code. I want to play an animation on the fab every time it is pressed but for some reason, it is not doing anything.

    _binding!!.floatingActionButton.setOnClickListener{
                YoYo.with(Techniques.Shake)
                    .duration(700)
                    .repeat(5)
                    .playOn(_binding!!.floatingActionButton)
            }
    
    opened by dominik686 0
  • Library Unresolved when called in Version Catalog Gradle 7

    Library Unresolved when called in Version Catalog Gradle 7

    @daimajia I get an error:

    • Failed to resolve: com.daimajia.easing:library:2.4@aar
    • Failed to resolve: com.daimajia.androidanimations:library:2.4@aar when using this library with new version catalog on gradle 7+

    I think it's related to aar being deprecated, if I used it without version catalog it's working fine

    image

    Originally posted by @JosephSanjaya in https://github.com/daimajia/AndroidViewAnimations/issues/12#issuecomment-921344169

    opened by JosephSanjaya 1
  • SECURITY.md

    SECURITY.md

    Security Policy

    Supported Versions

    Use this section to tell people about which versions of your project are currently being supported with security updates.

    | Version | Supported | | ------- | ------------------ | | 5.1.x | :white_check_mark: | | 5.0.x | :x: | | 4.0.x | :white_check_mark: | | < 4.0 | :x: |

    Reporting a Vulnerability

    Use this section to tell people how to report a vulnerability.

    Tell them where to go, how often they can expect to get an update on a reported vulnerability, what to expect if the vulnerability is accepted or declined, etc.

    opened by Garciaa94 1
Owner
代码家
Zhenfund Associate, bp [email protected]
代码家
💳 Bank Card View is a simple and elegant card view with Flip animation.

Visualização de cartão bancário ?? Bank Card View é uma visualização de cartão simples e elegante com animação Flip. Versões Selecione a língua : Engl

Geovani Amaral 10 Dec 12, 2022
💳 Bank Card View is a simple and elegant card view with Flip animation.

Visualização de cartão bancário ?? Bank Card View é uma visualização de cartão simples e elegante com animação Flip. Versões Selecione a língua : Engl

Geovani Amaral 9 Aug 26, 2022
Android Animation Easing Functions. Let's make animation more real!

Android Easing Functions This project is originally from my another project, AndroidViewAnimation, which is an animation collection, to help you make

代码家 2.5k Jan 4, 2023
Customizable bounce animation for any view like in Clash Royale app

Bounceview-Android Customizable bounce animation for any view updation Getting Started In your build.gradle dependencies { implementation 'hari.bo

Hariprasanth S 149 Nov 18, 2022
Deprecated in favour of https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html

Deprecated: use https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html instead. android-cubic-bezier-in

Codesoup 161 Jan 1, 2023
A customised EditText view serving the purpose of taking numeric One Time Password from a user. With stunning animation, and high customizability.

PassCodeText A customised EditText view serving the purpose of taking numeric One Time Password from a user. With stunning animation, and high customi

Swapnil Tiwari 107 Nov 16, 2022
Animation View to Highlight particular Views 🎯 for Android

TargetView Animation View to Highlight particular Views ?? for Android, it can be Used with Views that you see important (Like CountDownTimer), And al

Anas Altair 53 Aug 7, 2021
Android Library to create Lottie animation view dialog easily with a lot of customization

LottieDialog Android Library to create Lottie animation view dialog easily with a lot of customization Why you should use Lottie Dialog You have no li

Amr Hesham 39 Oct 7, 2022
Android Library to create Lottie animation view dialog easily with a lot of customization

Android Library to create Lottie animation view dialog easily with a lot of customization

Amr Hesham 39 Oct 7, 2022
FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title

FadingToolbar is an animation library which fades out your footer view in a ScrollView/RecyclerView and fades in a toolbar title (analogue of the LargeTitle animation in iOS)

Hanna 9 Nov 3, 2022
A view pager indicator view to deal with a large amount of pages.

Attention I'm not going to support this anymore. Just use a better solution, e.g. this one Indefinite-Pager-Indicator BubblePagerIndicator A view page

Bogdan Kornev 134 Aug 18, 2022
A beautiful ripple animation for your app

Android Ripple Background A beautiful ripple animation for your app. You can easily change its color, speed of wave, one ripple or multiple ripples. S

Yao Yu 2.2k Dec 31, 2022
A component for flip animation on Android, which is similar to the effect in Flipboard iPhone/Android

android-flip Aphid FlipView is a UI component to accomplish the flipping animation like Flipboard does. A pre-built demo APK file for Android OS 2.2+

Bo 2.8k Dec 21, 2022
ArcAnimator helps to create arc transition animation: 2.3.+

ArcAnimator ArcAnimator helps to create arc transition animation: 14+ | ArcAnimator Demo | TransitionLoop Demo* *TransitionLoop Prototype by Min-Sang

Asyl Isakov 1.2k Dec 20, 2022
[] Android library for using the Honeycomb animation API on all versions of the platform back to 1.0!

DEPRECATED NineOldAndroids is deprecated. No new development will be taking place. Existing versions will (of course) continue to function. New applic

Jake Wharton 4.5k Jan 9, 2023
DuGuang 1k Dec 14, 2022
A motion-driven animation framework for Android.

Backboard A motion-driven animation framework for Android. backboard is a framework on top of rebound that makes it easier to use by coupling it to vi

Tumblr 1.7k Dec 30, 2022
Android library to control Transition animates. A simple way to create a interactive animation.

TransitionPlayer Android library to control Transition animates. A simple way to create a interactive animation. Demo1 SimpleTransition Code: ....

林法鑫 1.2k Dec 17, 2022
Collect android animation

Interactive-animation 描述:收集android上开源的酷炫的交互动画和视觉效果。 1.交互篇 2.视觉篇 交互篇 1.SlidingUpPanelLayout 项目介绍:他的库提供了一种简单的方式来添加一个可拖动滑动面板(由谷歌音乐推广,谷歌地图和Rdio)你的Android应

Ra 749 Dec 14, 2022