From 0190c7e926aea21d3184c44232f2773441c8c7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=B6?= Date: Thu, 26 Jun 2014 08:43:25 +0800 Subject: [PATCH 01/78] add Jar download link --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e164936..3b98c22 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ So, I started to collect animation effects... and in two days, this project born ```groovy dependencies { compile 'com.nineoldandroids:library:2.4.0' - compile 'com.daimajia.androidanimations:library:1.0.4@aar' + compile 'com.daimajia.androidanimations:library:1.0.5@aar' } ``` or Maven @@ -30,11 +30,16 @@ or Maven com.daimajia.androidanimation library - 1.0.4 + 1.0.5 apklib ``` +or using jar: + +- [NineOldAndroids-2.4.0](http://search.maven.org/remotecontent?filepath=com/nineoldandroids/library/2.4.0/library-2.4.0.jar) +- [AndroidViewAnimations-1.0.5](http://search.maven.org/remotecontent?filepath=com/daimajia/androidanimations/library/1.0.5/library-1.0.5.jar) + ## Step 2 Just like play Yo-yo. From 2ef490609ba4f051393e7c4446b3300740e23bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=B6?= Date: Thu, 26 Jun 2014 09:46:10 +0800 Subject: [PATCH 02/78] Update demo.apk --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b98c22..6245f21 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ So, I started to collect animation effects... and in two days, this project born ![](http://ww3.sinaimg.cn/mw690/610dc034jw1ehnv2r93jpg20bx0kokjl.gif) -[Download Demo](https://github.com/daimajia/AndroidViewAnimations/releases/download/v1.0.0/Demo-v1.0.0.apk) +[Download Demo](https://github.com/daimajia/AndroidViewAnimations/releases/download/v1.0.5/demo-v1.0.5.apk) # Usage ## Step 1 From 6d4df20ce46f3d1f6dec4c064d33b72cc7375934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=B6?= Date: Thu, 26 Jun 2014 10:56:51 +0800 Subject: [PATCH 03/78] new task. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 6245f21..bc5d94e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ One day, I saw [an iOS library](https://github.com/ArtFeel/AFViewShaker), which So, I started to collect animation effects... and in two days, this project born. +### Task +- I'm implementing [Animation Easing](http://easings.net/) functions, based on [Rober Penner's Easing functions](http://www.robertpenner.com/easing/). I'll make animation much more real! 2014/6/26. If you are also interesting in this, you can help me. + # Demo ![](http://ww3.sinaimg.cn/mw690/610dc034jw1ehnv2r93jpg20bx0kokjl.gif) From 68ae0debda049e2e39edb019e3fc856e42184a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=B6?= Date: Fri, 27 Jun 2014 21:34:59 +0800 Subject: [PATCH 04/78] Easing functions --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bc5d94e..e9d1f2d 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ One day, I saw [an iOS library](https://github.com/ArtFeel/AFViewShaker), which So, I started to collect animation effects... and in two days, this project born. -### Task -- I'm implementing [Animation Easing](http://easings.net/) functions, based on [Rober Penner's Easing functions](http://www.robertpenner.com/easing/). I'll make animation much more real! 2014/6/26. If you are also interesting in this, you can help me. +2014-06-27 + +I have implemented [Animation Easing](http://easings.net/) [functions](https://github.com/daimajia/AndroidViewAnimations/tree/master/library/src/main/java/com/daimajia/androidanimations/library/easing_functions), based on [Rober Penner's Easing functions](http://www.robertpenner.com/easing/). +You can use easing functions to make your animation more real! It's pretty complex, but don't worrr, I'll add some examples later. :-D # Demo ![](http://ww3.sinaimg.cn/mw690/610dc034jw1ehnv2r93jpg20bx0kokjl.gif) From c80378c0a3aefbb08cb66349d3bfa07ef067211f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=B6?= Date: Fri, 27 Jun 2014 22:06:44 +0800 Subject: [PATCH 05/78] Remove jar download link temporally --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index e9d1f2d..daf4a50 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,6 @@ or Maven ``` -or using jar: - -- [NineOldAndroids-2.4.0](http://search.maven.org/remotecontent?filepath=com/nineoldandroids/library/2.4.0/library-2.4.0.jar) -- [AndroidViewAnimations-1.0.5](http://search.maven.org/remotecontent?filepath=com/daimajia/androidanimations/library/1.0.5/library-1.0.5.jar) - ## Step 2 Just like play Yo-yo. From 5f51df3be69fc4a017ebbdd051266c3006a28221 Mon Sep 17 00:00:00 2001 From: Vasya Date: Fri, 27 Jun 2014 17:53:36 +0300 Subject: [PATCH 06/78] SwingAnimator issue Swing animation should start from zero --- .../androidanimations/library/attention/SwingAnimator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/java/com/daimajia/androidanimations/library/attention/SwingAnimator.java b/library/src/main/java/com/daimajia/androidanimations/library/attention/SwingAnimator.java index bf55f2b..b12b1f3 100644 --- a/library/src/main/java/com/daimajia/androidanimations/library/attention/SwingAnimator.java +++ b/library/src/main/java/com/daimajia/androidanimations/library/attention/SwingAnimator.java @@ -33,7 +33,7 @@ public class SwingAnimator extends BaseViewAnimator { @Override public void prepare(View target) { getAnimatorAgent().playTogether( - ObjectAnimator.ofFloat(target, "rotation", 10, -10, 6, -6, 3, -3, 0) + ObjectAnimator.ofFloat(target, "rotation", 0, 10, -10, 6, -6, 3, -3, 0) ); } } From e02aa9fa999d5ad49775a05238172431d7e6ce16 Mon Sep 17 00:00:00 2001 From: daimajia Date: Sat, 5 Jul 2014 13:21:04 +0800 Subject: [PATCH 07/78] remove easing functions, start dependent https://github.com/daimajia/AnimationEasingFunctions/commits?author=daimajia --- .travis.yml | 71 ++++-------- README.md | 18 +-- build.gradle | 2 +- demo/build.gradle | 6 +- gradle.properties | 4 +- gradle/wrapper/gradle-wrapper.properties | 4 +- library/build.gradle | 11 +- .../easing_functions/BaseEasingMethod.java | 44 -------- .../library/easing_functions/Glider.java | 45 -------- .../library/easing_functions/Skill.java | 106 ------------------ .../easing_functions/back/BackEaseIn.java | 46 -------- .../easing_functions/back/BackEaseInOut.java | 51 --------- .../easing_functions/back/BackEaseOut.java | 45 -------- .../easing_functions/bounce/BounceEaseIn.java | 51 --------- .../bounce/BounceEaseInOut.java | 58 ---------- .../bounce/BounceEaseOut.java | 56 --------- .../easing_functions/circ/CircEaseIn.java | 39 ------- .../easing_functions/circ/CircEaseInOut.java | 40 ------- .../easing_functions/circ/CircEaseOut.java | 35 ------ .../easing_functions/cubic/CubicEaseIn.java | 40 ------- .../cubic/CubicEaseInOut.java | 45 -------- .../easing_functions/cubic/CubicEaseOut.java | 40 ------- .../elastic/ElasticEaseIn.java | 53 --------- .../elastic/ElasticEaseOut.java | 53 --------- .../easing_functions/expo/ExpoEaseIn.java | 41 ------- .../easing_functions/expo/ExpoEaseInOut.java | 45 -------- .../easing_functions/expo/ExpoEaseOut.java | 41 ------- .../easing_functions/quad/QuadEaseIn.java | 38 ------- .../easing_functions/quad/QuadEaseInOut.java | 42 ------- .../easing_functions/quad/QuadEaseOut.java | 38 ------- .../easing_functions/quint/QuintEaseIn.java | 38 ------- .../quint/QuintEaseInOut.java | 43 ------- .../easing_functions/quint/QuintEaseOut.java | 39 ------- .../easing_functions/sine/SineEaseIn.java | 39 ------- .../easing_functions/sine/SineEaseInOut.java | 38 ------- .../easing_functions/sine/SineEaseOut.java | 38 ------- .../library/specials/HingeAnimator.java | 4 +- 37 files changed, 45 insertions(+), 1402 deletions(-) delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/BaseEasingMethod.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/Glider.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/Skill.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseIn.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseInOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseIn.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseInOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseIn.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseInOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseIn.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseInOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/elastic/ElasticEaseIn.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/elastic/ElasticEaseOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseIn.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseInOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseIn.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseInOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseIn.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseInOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseIn.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseInOut.java delete mode 100644 library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseOut.java diff --git a/.travis.yml b/.travis.yml index a39602f..515d331 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,66 +1,33 @@ language: java - -branches: - only: - - dev - - master - jdk: oraclejdk7 - env: - global: - - ANDROID_SDK_VERSION="r22.6.2" - -notifications: - email: false - + matrix: + - ANDROID_TARGET=android-20 ANDROID_ABI=armeabi-v7a before_install: - - # environment info - - gradle -v - - uname -a - - # required libs for android build tools - # Update a system for ia32 libraries + # Install base Android SDK - sudo apt-get update -qq - - if [ `uname -m` = x86_64 ]; then sudo apt-get update; fi - - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch; fi - - # for gradle output style - - export TERM=dumb - - # newer version of gradle - # - wget http://services.gradle.org/distributions/gradle-1.12-bin.zip - # - unzip -qq gradle-1.12-bin.zip - # - export GRADLE_HOME=$PWD/gradle-1.11 - # - export PATH=$GRADLE_HOME/bin:$PATH - - # just to test gradle version, against our provided one - - gradle -v - - # newest android SDK - - wget http://dl.google.com/android/android-sdk_${ANDROID_SDK_VERSION}-linux.tgz - - tar -zxf android-sdk_${ANDROID_SDK_VERSION}-linux.tgz - - export ANDROID_HOME=`pwd`/android-sdk-linux + - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch > /dev/null; fi + - wget http://dl.google.com/android/android-sdk_r23-linux.tgz + - tar xzf android-sdk_r23-linux.tgz + - export ANDROID_HOME=$PWD/android-sdk-linux - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools - # manually set sdk.dir variable, according to local paths - - echo "sdk.dir=$ANDROID_HOME" > local.properties + # Gradle + - wget http://services.gradle.org/distributions/gradle-1.12-bin.zip + - unzip gradle-1.12-bin.zip + - export GRADLE_HOME=$PWD/gradle-1.12 + - export PATH=$GRADLE_HOME/bin:$PATH - # Install required components. + # Install required components # For a full list, run `android list sdk -a --extended` + # Note that sysimg-19 downloads only ARM, because only the first license query is accepted. - echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null - - echo yes | android update sdk --all --filter build-tools-19.1.0 --no-ui --force > /dev/null - - echo yes | android update sdk --filter android-19 --no-ui --force > /dev/null + - echo yes | android update sdk --all --filter build-tools-20.0.0 --no-ui --force > /dev/null + - echo yes | android update sdk --filter android-20 --no-ui --force > /dev/null + - echo yes | android update sdk --filter sys-img-x86-android-19 --no-ui --force > /dev/null - echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null - echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null - # Otherwise - #- echo yes | android update sdk -t tools,platform-tools,extra-android-support,extra-android-m2repository,android-19 --force --no-ui - - -# Let's try to build... -install: ./gradlew clean build - -script: gradle check \ No newline at end of file +install: + - ./gradlew assemble \ No newline at end of file diff --git a/README.md b/README.md index daf4a50..313f852 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,6 @@ One day, I saw [an iOS library](https://github.com/ArtFeel/AFViewShaker), which So, I started to collect animation effects... and in two days, this project born. - -2014-06-27 - -I have implemented [Animation Easing](http://easings.net/) [functions](https://github.com/daimajia/AndroidViewAnimations/tree/master/library/src/main/java/com/daimajia/androidanimations/library/easing_functions), based on [Rober Penner's Easing functions](http://www.robertpenner.com/easing/). -You can use easing functions to make your animation more real! It's pretty complex, but don't worrr, I'll add some examples later. :-D # Demo ![](http://ww3.sinaimg.cn/mw690/610dc034jw1ehnv2r93jpg20bx0kokjl.gif) @@ -20,8 +15,9 @@ You can use easing functions to make your animation more real! It's pretty compl ```groovy dependencies { - compile 'com.nineoldandroids:library:2.4.0' - compile 'com.daimajia.androidanimations:library:1.0.5@aar' + compile 'com.nineoldandroids:library:2.4.0' + compile 'com.daimajia.easing:library:1.0.0@aar' + compile 'com.daimajia.androidanimations:library:1.0.6@aar' } ``` or Maven @@ -35,7 +31,13 @@ or Maven com.daimajia.androidanimation library - 1.0.5 + 1.0.6 + apklib + + + com.daimajia.easing + library + 1.0.0 apklib ``` diff --git a/build.gradle b/build.gradle index 881b632..a51d47d 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:0.11.+' + classpath 'com.android.tools.build:gradle:0.12.+' classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10.+' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/demo/build.gradle b/demo/build.gradle index 56bd973..4baa38c 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -2,13 +2,13 @@ apply plugin: 'android-sdk-manager' apply plugin: 'android' android { - compileSdkVersion 19 - buildToolsVersion "19.1.0" + compileSdkVersion 20 + buildToolsVersion "20" defaultConfig { applicationId "com.daimajia.androidanimations" minSdkVersion 8 - targetSdkVersion 19 + targetSdkVersion 20 versionCode 1 versionName "1.0" } diff --git a/gradle.properties b/gradle.properties index d2865e5..1f1fe5f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,8 +18,8 @@ # org.gradle.parallel=true -VERSION_NAME=1.0.5 -VERSION_CODE=6 +VERSION_NAME=1.0.6 +VERSION_CODE=7 GROUP=com.daimajia.androidanimations POM_DESCRIPTION=Collect android animations diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5de946b..c3b7ed8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Sat Jun 28 18:37:32 CST 2014 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip +distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip diff --git a/library/build.gradle b/library/build.gradle index 708ea1b..a4a7f15 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,15 +1,15 @@ apply plugin: 'android-library' android { - compileSdkVersion 19 - buildToolsVersion "19.1.0" + compileSdkVersion 20 + buildToolsVersion "20.0.0" defaultConfig { applicationId "com.daimajia.androidanimations.library" minSdkVersion 8 - targetSdkVersion 19 - versionCode 6 - versionName "1.0.5" + targetSdkVersion 20 + versionCode 7 + versionName "1.0.6" } buildTypes { release { @@ -22,5 +22,6 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.nineoldandroids:library:2.4.0' + compile 'com.daimajia.easing:library:1.0.0@aar' } apply from: './gradle-mvn-push.gradle' \ No newline at end of file diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/BaseEasingMethod.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/BaseEasingMethod.java deleted file mode 100644 index b723c6e..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/BaseEasingMethod.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions; - -import android.view.animation.Interpolator; - -import com.nineoldandroids.animation.FloatEvaluator; - -public abstract class BaseEasingMethod extends FloatEvaluator implements Interpolator{ - protected float mDuration; - - - public BaseEasingMethod(float duration){ - mDuration = duration; - } - - public abstract float getInterpolation(float input); - - public void setDuration(float duration){ - mDuration = duration; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/Glider.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/Glider.java deleted file mode 100644 index c5788b2..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/Glider.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions; - -import com.nineoldandroids.animation.ObjectAnimator; -import com.nineoldandroids.animation.PropertyValuesHolder; - -public class Glider { - - public static PropertyValuesHolder glide(Skill skill, float duration, PropertyValuesHolder propertyValuesHolder){ - propertyValuesHolder.setEvaluator(skill.getMethod(duration)); - return propertyValuesHolder; - } - - public static ObjectAnimator glide(Skill skill, float duration, ObjectAnimator animator){ - BaseEasingMethod t = skill.getMethod(duration); - animator.setInterpolator(t); - animator.setEvaluator(t); - return animator; - } - - -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/Skill.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/Skill.java deleted file mode 100644 index 575387d..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/Skill.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions; - -import com.daimajia.androidanimations.library.easing_functions.back.BackEaseIn; -import com.daimajia.androidanimations.library.easing_functions.back.BackEaseInOut; -import com.daimajia.androidanimations.library.easing_functions.back.BackEaseOut; -import com.daimajia.androidanimations.library.easing_functions.bounce.BounceEaseIn; -import com.daimajia.androidanimations.library.easing_functions.bounce.BounceEaseInOut; -import com.daimajia.androidanimations.library.easing_functions.bounce.BounceEaseOut; -import com.daimajia.androidanimations.library.easing_functions.circ.CircEaseIn; -import com.daimajia.androidanimations.library.easing_functions.circ.CircEaseInOut; -import com.daimajia.androidanimations.library.easing_functions.circ.CircEaseOut; -import com.daimajia.androidanimations.library.easing_functions.cubic.CubicEaseIn; -import com.daimajia.androidanimations.library.easing_functions.cubic.CubicEaseInOut; -import com.daimajia.androidanimations.library.easing_functions.cubic.CubicEaseOut; -import com.daimajia.androidanimations.library.easing_functions.elastic.ElasticEaseIn; -import com.daimajia.androidanimations.library.easing_functions.elastic.ElasticEaseOut; -import com.daimajia.androidanimations.library.easing_functions.expo.ExpoEaseIn; -import com.daimajia.androidanimations.library.easing_functions.expo.ExpoEaseInOut; -import com.daimajia.androidanimations.library.easing_functions.expo.ExpoEaseOut; -import com.daimajia.androidanimations.library.easing_functions.quad.QuadEaseIn; -import com.daimajia.androidanimations.library.easing_functions.quad.QuadEaseInOut; -import com.daimajia.androidanimations.library.easing_functions.quad.QuadEaseOut; -import com.daimajia.androidanimations.library.easing_functions.quint.QuintEaseIn; -import com.daimajia.androidanimations.library.easing_functions.quint.QuintEaseInOut; -import com.daimajia.androidanimations.library.easing_functions.quint.QuintEaseOut; -import com.daimajia.androidanimations.library.easing_functions.sine.SineEaseIn; -import com.daimajia.androidanimations.library.easing_functions.sine.SineEaseInOut; -import com.daimajia.androidanimations.library.easing_functions.sine.SineEaseOut; - -public enum Skill { - - BackEaseIn(BackEaseIn.class), - BackEaseOut(BackEaseOut.class), - BackEaseInOut(BackEaseInOut.class), - - BounceEaseIn(BounceEaseIn.class), - BounceEaseOut(BounceEaseOut.class), - BounceEaseInOut(BounceEaseInOut.class), - - CircEaseIn(CircEaseIn.class), - CircEaseOut(CircEaseOut.class), - CircEaseInOut(CircEaseInOut.class), - - CubicEaseIn(CubicEaseIn.class), - CubicEaseOut(CubicEaseOut.class), - CubicEaseInOut(CubicEaseInOut.class), - - ElasticEaseIn(ElasticEaseIn.class), - ElasticEaseOut(ElasticEaseOut.class), - - ExpoEaseIn(ExpoEaseIn.class), - ExpoEaseOut(ExpoEaseOut.class), - ExpoEaseInOut(ExpoEaseInOut.class), - - QuadEaseIn(QuadEaseIn.class), - QuadEaseOut(QuadEaseOut.class), - QuadEaseInOut(QuadEaseInOut.class), - - QuintEaseIn(QuintEaseIn.class), - QuintEaseOut(QuintEaseOut.class), - QuintEaseInOut(QuintEaseInOut.class), - - SineEaseIn(SineEaseIn.class), - SineEaseOut(SineEaseOut.class), - SineEaseInOut(SineEaseInOut.class); - - - private Class easingMethod; - - private Skill(Class clazz) { - easingMethod = clazz; - } - - public BaseEasingMethod getMethod(float duration) { - try { - return (BaseEasingMethod)easingMethod.getConstructor(float.class).newInstance(duration); - } catch (Exception e) { - e.printStackTrace(); - throw new Error("Can not init easingMethod instance"); - } - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseIn.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseIn.java deleted file mode 100644 index 5b2d60b..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseIn.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.back; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class BackEaseIn extends BaseEasingMethod{ - - private float s = 1.70158f; - - public BackEaseIn(float duration) { - super(duration); - } - - public BackEaseIn(float duration, float back){ - this(duration); - s = back; - } - - @Override - public float getInterpolation(float input) { - return input*input*((s+1)*input - s); - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseInOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseInOut.java deleted file mode 100644 index 0c762d6..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseInOut.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.back; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class BackEaseInOut extends BaseEasingMethod{ - - private float s = 1.70158f; - - public BackEaseInOut(float duration) { - super(duration); - } - - public BackEaseInOut(float duration, float back){ - this(duration); - s = back; - } - - @Override - public float getInterpolation(float input) { - float t = input*2.0f; - - if ((t) < 1) - return (t*t*(((s*=(1.525f))+1)*t - s))/2.0f; - - return ((t-=2)*t*(((s*=(1.525f))+1)*t + s) + 2)/2.0f; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseOut.java deleted file mode 100644 index af7fa22..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/back/BackEaseOut.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.back; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class BackEaseOut extends BaseEasingMethod{ - - private float s = 1.70158f; - - public BackEaseOut(float duration) { - super(duration); - } - - public BackEaseOut(float duration, float back){ - this(duration); - s = back; - } - @Override - public float getInterpolation(float input) { - return (input-1)*input*((s+1)*input + s) + 1; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseIn.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseIn.java deleted file mode 100644 index a6b93ee..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseIn.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.bounce; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class BounceEaseIn extends BaseEasingMethod { - - private BounceEaseOut mBounceEaseOut; - - public BounceEaseIn(float duration){ - super(duration); - mBounceEaseOut = new BounceEaseOut(duration); - } - - @Override - public float getInterpolation(float input) { - return input; - } - - @Override - public Float evaluate(float fraction, Number startValue, Number endValue) { - float d = mDuration; - float t = mDuration * fraction; - float b = startValue.floatValue(); - float c = endValue.floatValue() - startValue.floatValue(); - return c - mBounceEaseOut.evaluate((d-t)/d,0,endValue) + b; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseInOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseInOut.java deleted file mode 100644 index 3080427..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseInOut.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.bounce; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class BounceEaseInOut extends BaseEasingMethod{ - - private BounceEaseOut mBounceEaseOut; - private BounceEaseIn mBounceEaseIn; - - public BounceEaseInOut(float duration){ - super(duration); - mBounceEaseIn = new BounceEaseIn(duration); - mBounceEaseOut = new BounceEaseOut(duration); - } - - @Override - public float getInterpolation(float input) { - return input; - } - - @Override - public Float evaluate(float fraction, Number startValue, Number endValue) { - float d = mDuration; - float t = mDuration * fraction; - float b = startValue.floatValue(); - float c = endValue.floatValue() - startValue.floatValue(); - - if(2*fraction < 1){ - return mBounceEaseIn.evaluate(t * 2 / d, 0, c) * .5f + b; - }else{ - return mBounceEaseOut.evaluate((t*2-d)/d, 0, c) * .5f + c*.5f + b; - } - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseOut.java deleted file mode 100644 index 546b849..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/bounce/BounceEaseOut.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.bounce; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class BounceEaseOut extends BaseEasingMethod{ - - public BounceEaseOut(float duration){ - super(duration); - } - - @Override - public float getInterpolation(float input) { - return input; - } - - @Override - public Float evaluate(float fraction, Number startValue, Number endValue) { - float d = mDuration; - float t = fraction * mDuration; - float b = startValue.floatValue(); - float c = endValue.floatValue() - startValue.floatValue(); - if ((t/=d) < (1/2.75f)) { - return c*(7.5625f*t*t) + b; - } else if (t < (2/2.75f)) { - return c*(7.5625f*(t-=(1.5f/2.75f))*t + .75f) + b; - } else if (t < (2.5/2.75)) { - return c*(7.5625f*(t-=(2.25f/2.75f))*t + .9375f) + b; - } else { - return c*(7.5625f*(t-=(2.625f/2.75f))*t + .984375f) + b; - } - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseIn.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseIn.java deleted file mode 100644 index 4faa234..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseIn.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.circ; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class CircEaseIn extends BaseEasingMethod{ - - public CircEaseIn(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - return -((float)Math.sqrt(1-input*input) - 1); - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseInOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseInOut.java deleted file mode 100644 index daad7d2..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseInOut.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.circ; - -import android.view.animation.Interpolator; - -public class CircEaseInOut implements Interpolator{ - @Override - public float getInterpolation(float input) { - float x = input * 2.0f; - if(x < 1){ - return -((float)Math.sqrt(1- x*x) -1) / 2.0f; - }else{ - x -= 2; - return ((float)Math.sqrt(1 - x*x) + 1) / 2.0f; - } - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseOut.java deleted file mode 100644 index 359ee0a..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/circ/CircEaseOut.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.circ; - -import android.view.animation.Interpolator; - -public class CircEaseOut implements Interpolator{ - @Override - public float getInterpolation(float input) { - input -= 1; - return (float)Math.sqrt(1-input*input); - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseIn.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseIn.java deleted file mode 100644 index 322ff21..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseIn.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.cubic; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class CubicEaseIn extends BaseEasingMethod{ - - public CubicEaseIn(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - return input * input * input; - } - -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseInOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseInOut.java deleted file mode 100644 index d97d730..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseInOut.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.cubic; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class CubicEaseInOut extends BaseEasingMethod { - - public CubicEaseInOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - float x = input * 2; - if(x < 1){ - return x*x*x/2; - }else{ - x -= 2; - return (x*x*x + 2)/2.0f; - } - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseOut.java deleted file mode 100644 index 668b8d2..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/cubic/CubicEaseOut.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.cubic; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class CubicEaseOut extends BaseEasingMethod { - - public CubicEaseOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - float t = input - 1; - return t * t * t + 1; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/elastic/ElasticEaseIn.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/elastic/ElasticEaseIn.java deleted file mode 100644 index 6068bbe..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/elastic/ElasticEaseIn.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.elastic; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class ElasticEaseIn extends BaseEasingMethod{ - - public ElasticEaseIn(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - return input; - } - - @Override - public Float evaluate(float fraction, Number startValue, Number endValue) { - float d = mDuration; - float t = mDuration * fraction; - float b = startValue.floatValue(); - float c = endValue.floatValue() - startValue.floatValue(); - - if (t==0) return b; if ((t/=d)==1) return b+c; - float p=d*.3f; - float a=c; - float s=p/4; - return -(a*(float)Math.pow(2,10*(t-=1)) * (float)Math.sin( (t*d-s)*(2*(float)Math.PI)/p )) + b; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/elastic/ElasticEaseOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/elastic/ElasticEaseOut.java deleted file mode 100644 index 7e232b1..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/elastic/ElasticEaseOut.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.elastic; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class ElasticEaseOut extends BaseEasingMethod{ - - public ElasticEaseOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - return input; - } - - @Override - public Float evaluate(float fraction, Number startValue, Number endValue) { - float d = mDuration; - float t = mDuration * fraction; - float b = startValue.floatValue(); - float c = endValue.floatValue() - startValue.floatValue(); - - if (t==0) return b; if ((t/=d)==1) return b+c; - float p=d*.3f; - float a=c; - float s=p/4; - return (a*(float)Math.pow(2,-10*t) * (float)Math.sin( (t*d-s)*(2*(float)Math.PI)/p ) + c + b); - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseIn.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseIn.java deleted file mode 100644 index 1139391..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseIn.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.expo; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class ExpoEaseIn extends BaseEasingMethod{ - public ExpoEaseIn(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - if(input == 0){ - return 0; - } - return (float)Math.pow(2, 10 * (input - 1)); - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseInOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseInOut.java deleted file mode 100644 index 0472964..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseInOut.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.expo; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class ExpoEaseInOut extends BaseEasingMethod{ - public ExpoEaseInOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - if(input == 1 || input == 0){ - return input; - } - float x = input * 2; - if(x < 1) - return (float)Math.pow(2, 10 * (input - 1)) / 2; - else - return (-(float)Math.pow(2, -10 * input) + 1) / 2; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseOut.java deleted file mode 100644 index f4b3fb7..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/expo/ExpoEaseOut.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.expo; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class ExpoEaseOut extends BaseEasingMethod{ - public ExpoEaseOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - if(input == 1){ - return 1; - } - return (-(float)Math.pow(2, -10 * input) + 1); - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseIn.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseIn.java deleted file mode 100644 index 86ca45b..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseIn.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.quad; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class QuadEaseIn extends BaseEasingMethod{ - public QuadEaseIn(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - return input * input; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseInOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseInOut.java deleted file mode 100644 index 27a6ccc..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseInOut.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.quad; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class QuadEaseInOut extends BaseEasingMethod{ - public QuadEaseInOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - float x = input * 2; - if(x < 1){ - return x * x / 2.0f; - } - return -((--x)*(x-2) - 1)/2.0f; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseOut.java deleted file mode 100644 index 16383c4..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quad/QuadEaseOut.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.quad; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class QuadEaseOut extends BaseEasingMethod{ - public QuadEaseOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - return -input * (input-2); - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseIn.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseIn.java deleted file mode 100644 index 8203bb2..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseIn.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.quint; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class QuintEaseIn extends BaseEasingMethod{ - public QuintEaseIn(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - return input * input * input * input * input; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseInOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseInOut.java deleted file mode 100644 index f974711..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseInOut.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.quint; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class QuintEaseInOut extends BaseEasingMethod{ - public QuintEaseInOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - float x = input * 2; - if(x < 1) - return (float)Math.pow(x,5)/2.0f; - - x -= 2; - return ((float)Math.pow(x,5) + 2)/ 2.0f; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseOut.java deleted file mode 100644 index 5a78c1c..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/quint/QuintEaseOut.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.quint; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class QuintEaseOut extends BaseEasingMethod{ - public QuintEaseOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - float x = input - 1; - return (float)Math.pow(x,5) + 1; - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseIn.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseIn.java deleted file mode 100644 index 062f167..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseIn.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.sine; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class SineEaseIn extends BaseEasingMethod{ - - public SineEaseIn(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - return (1 - (float)Math.cos(input * (Math.PI /2.0f))); - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseInOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseInOut.java deleted file mode 100644 index d57d00f..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseInOut.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.sine; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class SineEaseInOut extends BaseEasingMethod{ - public SineEaseInOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - return (float)(-(Math.cos(Math.PI*input) - 1)/2.0f); - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseOut.java b/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseOut.java deleted file mode 100644 index a0e5fbd..0000000 --- a/library/src/main/java/com/daimajia/androidanimations/library/easing_functions/sine/SineEaseOut.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2014 daimajia - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package com.daimajia.androidanimations.library.easing_functions.sine; - -import com.daimajia.androidanimations.library.easing_functions.BaseEasingMethod; - -public class SineEaseOut extends BaseEasingMethod{ - public SineEaseOut(float duration) { - super(duration); - } - - @Override - public float getInterpolation(float input) { - return (float)Math.sin(input * (Math.PI/2.0f)); - } -} diff --git a/library/src/main/java/com/daimajia/androidanimations/library/specials/HingeAnimator.java b/library/src/main/java/com/daimajia/androidanimations/library/specials/HingeAnimator.java index 63d4d46..399d430 100644 --- a/library/src/main/java/com/daimajia/androidanimations/library/specials/HingeAnimator.java +++ b/library/src/main/java/com/daimajia/androidanimations/library/specials/HingeAnimator.java @@ -27,8 +27,8 @@ import android.view.View; import com.daimajia.androidanimations.library.BaseViewAnimator; -import com.daimajia.androidanimations.library.easing_functions.Glider; -import com.daimajia.androidanimations.library.easing_functions.Skill; +import com.daimajia.easing.Glider; +import com.daimajia.easing.Skill; import com.nineoldandroids.animation.ObjectAnimator; public class HingeAnimator extends BaseViewAnimator{ From aff8f59ea79369d98fed09bef909f64ef43ecb07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=B6?= Date: Sat, 5 Jul 2014 13:32:11 +0800 Subject: [PATCH 08/78] v1.0.6 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 313f852..18d6cb2 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ So, I started to collect animation effects... and in two days, this project born [Download Demo](https://github.com/daimajia/AndroidViewAnimations/releases/download/v1.0.5/demo-v1.0.5.apk) # Usage +For making animations more real, I created another project named [Android Easing Functions](https://github.com/daimajia/AnimationEasingFunctions) which is an implementations of [easing functions](http://easings.net/) on Android. So, we need to dependent that project. + ## Step 1 ```groovy From 617fdad46d9a635badc1488aeeff7ce2e1351dc4 Mon Sep 17 00:00:00 2001 From: daimajia Date: Sat, 5 Jul 2014 13:38:57 +0800 Subject: [PATCH 09/78] fix lint error --- demo/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/demo/build.gradle b/demo/build.gradle index 4baa38c..51dfa6a 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -18,6 +18,9 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + lintOptions{ + abortOnError false + } } dependencies { From 6786e73b37eeecf782be37c0405779ca025c57c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=B6?= Date: Mon, 14 Jul 2014 10:14:15 +0800 Subject: [PATCH 10/78] add eclipse support --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 18d6cb2..98def86 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ For making animations more real, I created another project named [Android Easing ## Step 1 +#### Gralde ```groovy dependencies { compile 'com.nineoldandroids:library:2.4.0' @@ -22,7 +23,7 @@ dependencies { compile 'com.daimajia.androidanimations:library:1.0.6@aar' } ``` -or Maven +#### Maven ```xml @@ -44,6 +45,14 @@ or Maven ``` +#### Eclipse + +Download the following jars, and copy them into your `libs` directory. + +- [`NineOldAndroid-2.4.0`](https://github.com/daimajia/AndroidViewAnimations/releases/download/v1.0.6/NineOldAndroid-2.4.0.jar) +- [`AndroidEasingFunctions-1.0.0`](https://github.com/daimajia/AndroidViewAnimations/releases/download/v1.0.6/AndroidEasingFunctions-1.0.0.jar) +- [`AndroidViewAnimations-1.0.6`](https://github.com/daimajia/AndroidViewAnimations/releases/download/v1.0.6/AndroidViewAnimations-1.0.6.jar) + ## Step 2 Just like play Yo-yo. From 66abc3e0710274b503976e4e0a817ab5fc44a803 Mon Sep 17 00:00:00 2001 From: Zhangls <664271046@qq.com> Date: Tue, 15 Jul 2014 17:40:54 +0800 Subject: [PATCH 11/78] fix in the small screen. --- demo/src/main/res/layout/example.xml | 115 +++++++++++++++------------ 1 file changed, 64 insertions(+), 51 deletions(-) diff --git a/demo/src/main/res/layout/example.xml b/demo/src/main/res/layout/example.xml index 85e51d3..b9f4877 100644 --- a/demo/src/main/res/layout/example.xml +++ b/demo/src/main/res/layout/example.xml @@ -1,67 +1,79 @@ - - - - + + - + android:layout_height="wrap_content"> - - -