Android Animation Easing Functions. Let's make animation more real!

Overview

Android Easing Functions Build Status

This project is originally from my another project, AndroidViewAnimation, which is an animation collection, to help you make animation easier.

While, I was still unsatisfied with the animation effect.

So, I started to explore how to make it more and more real.

I found the Easing Functions made by Robert Penne, then, I implemented Easing Functions and make a lovely demo.

Demo

Usage

NineOldAndroids has been removed since version 2.0. Thanks Jake Wharton.

minSdkVersion: 11

Step 1

Gradle

implementation 'com.daimajia.easing:library:2.4@aar'

or maven

<dependency>
    <groupId>com.daimajia.easing</groupId>
    <artifactId>library</artifactId>
    <version>2.4</version>
    <type>apklib</type>
</dependency>

Step 2

Just like a glider.

AnimatorSet set = new AnimatorSet();
 set.playTogether(
         Glider.glide(Skill.BounceEaseInOut, 1200, ObjectAnimator.ofFloat(mTarget, "translationY", 0, 100))
 );

set.setDuration(1200);
set.start();

Tips

If you encounter exceptions such as ClassNotFoundExceptions (#4), please add the following to your proguard-project.txt:

-keep class com.daimajia.easing.** { *; }
-keep interface com.daimajia.easing.** { *; }

More details visit official guide.

About me

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.

Comments
  • Proguard causes `NoSuchMethodException`

    Proguard causes `NoSuchMethodException`

    Hey! Just want to say first that I really appreciate your work.

    I'm using this library in an application and found a bug when using proguard. Without any changes to the proguard.project.txt file, I get this error when trying to use the animations:

    W/System.err(22899): java.lang.NoSuchMethodException: <init> [float]
    W/System.err(22899):    at java.lang.Class.getConstructorOrMethod(Class.java:472)
    W/System.err(22899):    at java.lang.Class.getConstructor(Class.java:446)
    W/System.err(22899):    at com.daimajia.easing.Skill.a(SourceFile:104)
    W/System.err(22899):    at com.daimajia.easing.Glider.a(SourceFile:33)
    

    I worked around this by adding to my proguard-project.txt file:

    -keep class com.daimajia.easing.** { *; }
    -keep interface com.daimajia.easing.** { *; }
    

    It might be helpful to add this to documentation (like the README).

    opened by landakram 5
  • Remove icon and label in AndroidManifest

    Remove icon and label in AndroidManifest

    Remove android:icon & android:label so there won't be issue on merging manifests.

    https://github.com/daimajia/AnimationEasingFunctions/blob/master/library/src/main/AndroidManifest.xml

    opened by dannyroa 4
  • Please add a license

    Please add a license

    This repo is missing a license. Without a license, all code is copyright the author and may not be used by anyone else.

    Please use something like http://choosealicense.com/ to decide what license to use. I recommend MIT or GPL

    opened by ravidsrk 2
  • Release .aar contains ic_launcher.png in drawable-hdpi-v4

    Release .aar contains ic_launcher.png in drawable-hdpi-v4

    All resources should be namespaced. And maybe default generated resources should not be included in released builds This will cause aapt duplicate file errors if imported into a project that has a default generated ic_launcher file in a drawable-hdpi directory.

    opened by jjhorgan 2
  • Change keyword

    Change keyword "compile" to "implementation" for using library

    Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.

    It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

    I modified readme.md for this change

    opened by acious 1
  • Fix bugs in BackEaseInOut#calculate

    Fix bugs in BackEaseInOut#calculate

    Multiplying the 's' member of the class by 1.525 every time calculate was called was causing the method to be unusable. Simply removing that multiplication gives the result I would expect, and makes the code resemble the BackEaseIn and BackEaseOut methods more closely.

    opened by tdaffin 1
  • Why using TypeEvaluator instead of Interpolator in this library?

    Why using TypeEvaluator instead of Interpolator in this library?

    PropertyAnimation文档里似乎更推荐通过自定义Interpolator来控制所选属性的变化率。而TypeEvaluator的描述是:If you want to animate a type that is _unknown_ to the Android system, you can create your own evaluator by implementing the TypeEvaluator interface,似乎更加强调针对自定义类型或属性改变的情况。 自己在项目中几乎都使用Interpolator,这里不太明白,请教一下。 Thank you!:)

    opened by tankcong 1
  • build: upgrade targetSdkVersion to 29 for migrating to AndroidX

    build: upgrade targetSdkVersion to 29 for migrating to AndroidX

    According this issue we want to migrate daimajia/AndroidViewAnimations to AndroidX.

    Since daimajia/AndroidViewAnimations depends on this project, migrate this project to AndroidX first should be better.

    Actually this project can support AndroidX without migration, but we should also keep this project up to date.

    So we remove unused and outdated dependency appcompat-v7, and upgrade targetSdkVersion to 29.

    opened by mthli 0
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 0
  • anroid:allowBackup should not be used in library

    anroid:allowBackup should not be used in library

    Error:(23, 9) Execution failed for task ':wSRLandlord:processDebugManifest'.

    Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:23:9 is also present at com.daimajia.easing:library:1.0.0:12:9 value=(true) Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:21:5 to override

    opened by jarrodholliday 0
  • java.lang.NoSuchMethodError: No static method glide

    java.lang.NoSuchMethodError: No static method glide

    java.lang.NoSuchMethodError: No static method glide(Lcom/daimajia/easing/Skill;FLcom/nineoldandroids/animation/ValueAnimator;)Lcom/nineoldandroids/animation/ValueAnimator; in class Lcom/daimajia/easing/Glider; or its super classes (declaration of 'com.daimajia.easing.Glider' appears in /data/app/com.seuchild.smallseedling-EKGm8F1g0YQlzLb--O6EZw==/split_lib_dependencies_apk.apk) at com.github.omadahealth.circularbarpager.library.CircularBar.animateProgress(CircularBar.java:606) at com.seuchild.smallseedling.health.HealthActivity.onResume(HealthActivity.java:59) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1457) at android.app.Activity.performResume(Activity.java:7149) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3700) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3766) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2995) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1688) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6753) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:482) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

    I have add -keep class com.daimajia.easing.** { ; } -keep interface com.daimajia.easing.* { *; } -keepclassmembers public class * extends com.daimajia.easing.BaseEasingMethod { public (...); } to proguard-project.txt file.

    opened by 1-riverfish 1
  • How to concatenate animations

    How to concatenate animations

    Hi, I want to know how to concatenate animations, I mean:

    For example:

    1. I have two list of animations. Each list contain animations to play together. 2.I want to execute secuencially, first the list one (play together) and then execute the list two (play together).

    I'm trying to execute this situation using listeners, but I don't know why doesn't work. This is my code:

        final Point distance = new Point(Math.abs(pointPlane.distace(pointImage1).getX()), Math.abs(pointPlane.distace(pointImage1).getY()));
        AnimatorSet set = new AnimatorSet();
        set.playTogether(
                Glider.glide(Skill.Linear, 700, ObjectAnimator.ofFloat(imagePlane, "translationY", 0, -1 * distance.getY())),
                Glider.glide(Skill.Linear, 700, ObjectAnimator.ofFloat(imagePlane, "translationX", 0, distance.getX()))
        );
        set.setDuration(2000);
        set.start();
        set.addListener(new Animator.AnimatorListener() {
            @Override
            public void onAnimationStart(Animator animator) {}
    
            @Override
            public void onAnimationEnd(Animator animator) {
                imagePlane.setX(pointImage1.getX());
                imagePlane.setY(pointImage1.getY());
                final Point distance = new Point(Math.abs(pointPlane.distace(pointImage2).getX()), Math.abs(pointPlane.distace(pointImage2).getY()));
                AnimatorSet set2 = new AnimatorSet();
                set2.playTogether(
                        Glider.glide(Skill.Linear, 700, ObjectAnimator.ofFloat(imagePlane, "translationY", 0, 30)),
                        Glider.glide(Skill.Linear, 700, ObjectAnimator.ofFloat(imagePlane, "translationX", 0, 30))
                );
                set2.setDuration(2000);
                set2.start();
            }
    
            @Override
            public void onAnimationCancel(Animator animator) {}
    
            @Override
            public void onAnimationRepeat(Animator animator) {}
        });
    

    Thanks in advance!

    opened by juanm4 0
  • 不用传context的dp 转 px工具

    不用传context的dp 转 px工具

    public class DisplayUtil {

    static {
        DisplayMetrics displayMetrics = Resources.getSystem().getDisplayMetrics();
        density = displayMetrics.density;
        scaledDensity = displayMetrics.scaledDensity;
    }
    private static float density;
    private static float scaledDensity;
    
    public static int px2dip(float px){
        return (int) (px/density + 0.5f);
    }
    
    public static float dip2px(float dp){
        return dp*density;
    }
    public static int px2sp(float px){
        return (int) (px/scaledDensity + 0.5f);
    }
    public static float sp2px(float sp){
        return  sp*scaledDensity;
    }
    

    }

    opened by gb18030 0
  • How to add custom Skills without clone the project?

    How to add custom Skills without clone the project?

    Is it possible to add custom skills in my project by including the lib (without the need to clone the project and add it in the source code)?

    Thanks in advance.

    enhancement 
    opened by ejbp 1
  • How to move back pos view when animation play done?

    How to move back pos view when animation play done?

    Hi AnimationEasingFunctions, Thanks so much because your lib very great! Sorry becase my english very bad! I try to start animtorset via method playTogether But i have problem about move back View to old position! How can i do that? Please help me! Hope nice day to you guys

    opened by kentdev92 0
Releases(v2.0)
Owner
代码家
Zhenfund Associate, bp [email protected]
代码家
Road Runner is a library for android which allow you to make your own loading animation using a SVG image

Road Runner Road Runner is a library for android which allow you to make your own loading animation using a SVG image Sample video View in Youtube Dem

Adrián Lomas 1.2k Nov 18, 2022
Android library to make notes drop animation for music players

VusikView Min SDK 11 Screnshots How to use If you want use this library, you can download project and import it into your workspace and add the projec

Chetan Kaushik 119 Nov 29, 2022
ActSwitchAnimTool make the Animation easy to implements, and it compat the version of Android 4.0 or above.

ActSwitchAnimTool As well as we know, Android 5.0 has been support more Animation(just like ViewAnimationUtils~). Maybe some developers can implements

Acropolis 573 Nov 23, 2022
Chandrasekar Kuppusamy 799 Nov 14, 2022
A Java library that models spring dynamics and adds real world physics to your app.

Rebound About Rebound is a java library that models spring dynamics. Rebound spring models can be used to create animations that feel natural by intro

Facebook Archive 5.5k Jan 9, 2023
A Java library that models spring dynamics and adds real world physics to your app.

Rebound About Rebound is a java library that models spring dynamics. Rebound spring models can be used to create animations that feel natural by intro

Facebook Archive 5.5k Dec 18, 2022
The lib can make the ActivityOptions animations use in Android api3.1+

ActivityOptionsICS 本项目停止维护 =========== f you are thinking on customizing the animation of Activity transition then probably you would look for Activit

Kale 591 Nov 18, 2022
Automatically manipulates the duration of animations dependent on view count. Quicksand .. the more you struggle.

QuickSand When showing a really enchanting explanatory animation to your users, but you know that after a while it'll get tedious and would stop users

Paul Blundell 385 Sep 9, 2022
🍭🚀💗 Tutorials about animations with Animators, Animated Vector Drawables, Shared Transitions, and more

?????? Tutorials about animations with Animators, Animated Vector Drawables, Shared Transitions, and more

Smart Tool Factory 696 Dec 28, 2022
Web-based media manager with duplication detection, tagging, and more

reelchest ?? ??️ ??️ A basic web-based media manager. Download or upload clips,

Sebastian Aigner 7 Jan 3, 2022
☯️Sophisticated and cool intro with Material Motion Animations(No more viewpager transformer or Memory leak)

Material Intro Sophisticated and cool intro with Material Motion Animations. Who's using Material Intro? ?? Check out who's using Material Intro Inclu

Ranbir Singh 34 Sep 8, 2022
A Flutter plugin thats support share files to social media like TikTok, Instagram, Facebook, WhatsApp, Telegram and more others...

Social Share Kit A Flutter plugin that's support share files to social media like Tiktok, Instagram, Facebook, WhatsApp, Telegram and more. This plugi

Kaique Gazola 2 Sep 2, 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
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
[] 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