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]
代码家
An Android library for member secretGFX group, This can be used to growing your apps and get more install via a simple banner view & native view and interstitial dialog.

GFX-AdPromote An Android library for member secretGFX group, This can be used to growing your apps and get more install via a simple banner view & nat

SAID MOTYA 10 Dec 25, 2022
Allows changing of hurt animation modifier, changing how much the user's camera moves after the player being hurt.

Hurt Animation Modifier Allows changing of hurt animation modifier, changing how much the user's camera moves after the player being hurt. Credit to W

null 5 May 17, 2022
A visual implementation of OSHI, to view information about the system and hardware.

MooInfo A visual implementation of OSHI, to view information about the system and hardware. Such as OS, processes, memory, CPU, disks, devices, sensor

周波 104 Jan 6, 2023
Bring back Youtube Dislike for Android (View Only)

Show Youtube Dislikes Bring back Youtube Dislikes for Android This is a simple application, that parses the data from the "returnyoutubedislike.com" A

Jesper Bak Handskemager 21 Nov 17, 2022
React native wrapper for Jitsi Meet SDK Library that rely on the native view (Activity / ViewController)

react-native-jitsi-meet-sdk React native wrapper for Jitsi Meet SDK Library. This Library implements the Jitsi SDK with a native activity on the Andro

null 7 May 2, 2022
RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

RtlMarqueeView RTL marquee text view can hande the speed of moving text can jump to the specefic position of the text at start can loop the marquee te

mehran elyasi 4 Feb 14, 2022
Tracks information (skills, inventory, bank, etc.) about a group ironman player and sends it to a website for other group members to view

Group Ironmen Tracker Plugin Website: groupiron.men Source for frontend and server: https://github.com/christoabrown/group-ironmen This plugin tracks

Christopher Brown 7 Nov 11, 2022
A simple app that allows you to view high quality aerial photos of Poland

kalucky0 Maps A simple app that allows you to view high quality aerial photos of Poland Data source: Geoportal Contributing Contributions are always w

null 6 Apr 15, 2022
A collection of design patterns implemented in Java

Design Patterns A collection of design patterns implemented in Java and referenced from this book: Design Patterns: Elements of Reusable Object-Orient

Karim Elghamry 6 Sep 5, 2022
AndroidX Media is a collection of libraries for implementing media use cases on Android

AndroidX Media AndroidX Media is a collection of libraries for implementing media use cases on Android, including local playback (via ExoPlayer) and m

Android Jetpack 311 Jan 1, 2023
A collection of JUnit rules for testing code which uses java.lang.System.

System Rules System Rules is a collection of JUnit rules for testing code which uses java.lang.System. System Lambda is an alternative to System Rules

Stefan Birkner 536 Dec 22, 2022
Collection of homework assignments I did for myself and for others while as an undergrad @ UNLV.

Mona Lisa Collection of homework assignments I did for myself and for others while as an undergrad @ UNLV. If you have questions or concerns please fe

Luis Maya Aranda 0 May 10, 2022
An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to provide high-level repository operations for Vincent Driessen's branching model.

Git Flow Integration Plus for Intellij An intelliJ plugin providing a UI layer for git-flow, which in itself is a collection of Git extensions to prov

RubinCarter 35 Nov 8, 2022
A collection of client-side tweak kits to enhance your Minecraft game experience. Tweak Minecraft and beyond!

TweakerMore A collection of client-side tweak kits for enhance your Minecraft game experience Everything is disabled by default, so you don't need to

Fallen_Breath 105 Jan 3, 2023
Curated Collection of all Low level design Questions and implementation asked in major Tech companies , Get yourself prepared for the LLD round and ace the interview.

Low level Design / Machine Coding Question Collections What is Machine Coding Round ? Machine Coding Round has become very popular interview round in

Kumaran gowthaman 619 Dec 31, 2022
A game made in Javafx that includes animation, background music, and view leaderboards

A game made in Javafx that includes animation, background music, and view leaderboards. To keep the game alive, a player has to move the ball up/down by pressing the up/down arrow so that the ball only touches different rotating obstacles with the same color. ..

Bijendar Prasad 3 Nov 19, 2022
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
Tree View; Mind map; Think map; tree map; custom view; 自定义; 树状图;思维导图;组织机构图;层次图

GysoTreeView 【中文】【English】 ⭐ If ok, give me a star ⭐ ⭐ ⭐ ⭐ ⭐ ⭐ Tree View; Mind map; Think map; tree map; 树状图;思维导图;组织机构图;层次图;树型图 A custom tree view for

怪兽N 303 Dec 30, 2022
A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.

⚡ A powerful & easy to use chart library for Android ⚡ Charts is the iOS version of this library Table of Contents Quick Start Gradle Maven Documentat

Philipp Jahoda 36k Jan 9, 2023
An Android library for member secretGFX group, This can be used to growing your apps and get more install via a simple banner view & native view and interstitial dialog.

GFX-AdPromote An Android library for member secretGFX group, This can be used to growing your apps and get more install via a simple banner view & nat

SAID MOTYA 10 Dec 25, 2022