Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #121

Open
wants to merge 108 commits into
base: ease
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
0190c7e
add Jar download link
daimajia Jun 26, 2014
2ef4906
Update demo.apk
daimajia Jun 26, 2014
6d4df20
new task.
daimajia Jun 26, 2014
29ea62b
Merge pull request #10 from daimajia/ease
daimajia Jun 27, 2014
68ae0de
Easing functions
daimajia Jun 27, 2014
c80378c
Remove jar download link temporally
daimajia Jun 27, 2014
5f51df3
SwingAnimator issue
krossovochkin Jun 27, 2014
da680a8
Merge pull request #11 from krossovochkin/patch-1
daimajia Jun 27, 2014
e02aa9f
remove easing functions, start dependent https://github.com/daimajia/…
daimajia Jul 5, 2014
dd802e4
Merge branch 'master' of https://github.com/daimajia/AndroidViewAnima…
daimajia Jul 5, 2014
aff8f59
v1.0.6
daimajia Jul 5, 2014
617fdad
fix lint error
daimajia Jul 5, 2014
52dddde
Merge branch 'master' of https://github.com/daimajia/AndroidViewAnima…
daimajia Jul 5, 2014
6786e73
add eclipse support
daimajia Jul 14, 2014
66abc3e
fix in the small screen.
Jul 15, 2014
bc14e60
Merge pull request #14 from ihrthk/patch-1
daimajia Jul 15, 2014
1508ef8
fix #16 , add a new class YoYoRope
daimajia Aug 5, 2014
e50fd6a
Merge branch 'master' of https://github.com/daimajia/AndroidViewAnima…
daimajia Aug 5, 2014
722395d
replace rope to string
daimajia Aug 5, 2014
a03d531
replace protect to public
daimajia Aug 5, 2014
ac8b27d
v1.0.7
daimajia Aug 5, 2014
1c007fb
add AnimatorSet Builder
daimajia Aug 5, 2014
74b3ae3
v1.0.8
daimajia Aug 5, 2014
5ec5e7b
v1.0.8
daimajia Aug 5, 2014
8559b05
animation enhancement
daimajia Aug 6, 2014
c8723b9
v1.0.9
daimajia Aug 6, 2014
74c052e
small fix
daimajia Aug 6, 2014
948976e
fix jar and javadoc problem
daimajia Aug 6, 2014
dc8a136
small fix
daimajia Aug 8, 2014
a2167ff
Merge branch 'fix'
daimajia Aug 8, 2014
5779446
a better sample
daimajia Aug 8, 2014
7928b4f
v1.1.0
daimajia Aug 8, 2014
a9376d1
Update README.md
daimajia Aug 8, 2014
a2759cc
Update README.md
daimajia Aug 8, 2014
bd0f533
new Animator born, DropOutAnimator
daimajia Aug 8, 2014
4e0db1b
Merge branch 'master' of https://github.com/daimajia/AndroidViewAnima…
daimajia Aug 8, 2014
25c3dcc
v1.1.1
daimajia Aug 8, 2014
7c66c6b
fix duration errors
daimajia Aug 8, 2014
d4b96ae
new animators, Landing and TakingOff
daimajia Aug 8, 2014
2933cd0
v1.1.2
daimajia Aug 8, 2014
4269996
Update README.md
daimajia Aug 9, 2014
2c5f8c3
README text-fix: Gralde to Gradle
Aug 9, 2014
274ab87
Merge pull request #17 from nic/master
daimajia Aug 9, 2014
1a0aa28
upload new demo gif
daimajia Aug 9, 2014
f6c25d1
Update MyActivity.java
Aug 23, 2014
9fc5ef3
Merge pull request #20 from callofdutyops/master
daimajia Aug 23, 2014
4795317
Update MyActivity.java
gs053507 Aug 28, 2014
d01bc1e
Merge pull request #21 from gs053507/patch-1
daimajia Aug 28, 2014
8b41ec8
Update README.md
daimajia Sep 7, 2014
223b3f2
fix #28
daimajia Nov 20, 2014
3381263
fix #28
daimajia Nov 20, 2014
8ded772
v1.1.3
daimajia Dec 1, 2014
ffe72b4
Added Gitter badge
gitter-badger Dec 14, 2014
21ea093
Merge pull request #32 from gitter-badger/gitter-badge
daimajia Dec 14, 2014
6229019
add ObjectAnimators to AnimatorSet before call AnimatorSet set* methods
uknownothingsnow Dec 23, 2014
a44fa6d
rm unused args
uknownothingsnow Dec 23, 2014
920ce4a
Merge pull request #35 from lzyzsd/master
daimajia Dec 23, 2014
025e7a7
Update README.md
daimajia Dec 29, 2014
109729d
Exposing AnimatorListener methods in AnimationComposer
robertoestivill Mar 10, 2015
2ba1f66
fix FlipInY
dashhunds Mar 20, 2015
61dd4a8
upgrade gradle version
geminiwen May 3, 2015
6c18f39
Merge pull request #53 from coffeesherk/master
daimajia May 4, 2015
824d85f
update gradle wrapper to 2.3
geminiwen May 4, 2015
ac7896f
update travis.yml
daimajia May 4, 2015
0b40f23
Merge pull request #54 from daimajia/travis
daimajia May 4, 2015
99854c9
Merge remote-tracking branch 'daimajia/master'
geminiwen May 4, 2015
2def8a7
Merge branch '48'
geminiwen May 4, 2015
681d4dc
Merge pull request #48 from dashhunds/master
geminiwen May 4, 2015
70015c0
Merge remote-tracking branch 'daimajia/master'
geminiwen May 4, 2015
f108949
Merge pull request #46 from robertoestivill/animator_callbacks
daimajia May 4, 2015
7a8b4c5
update travis
geminiwen May 4, 2015
1bab170
update
geminiwen May 4, 2015
8859b6f
update
geminiwen May 4, 2015
6f52873
upgrade build tools
geminiwen May 4, 2015
a2c19c6
update gradle wrapper config:
geminiwen May 4, 2015
0dddce4
Merge pull request #55 from coffeesherk/master
geminiwen May 4, 2015
143c421
Immediate animation moved in on onWindowFocusChanged
alexnix Feb 16, 2016
3811501
Updated easing dependency
antonio-ivanovski Aug 15, 2016
0406a93
Merge pull request #76 from alexnix/master
geminiwen Dec 28, 2016
f020820
Merge pull request #86 from toteto/patch-1
daimajia Feb 15, 2017
d13dc83
Remove nineoldandroids.
daimajia Feb 16, 2017
66e14a0
Update demo
daimajia Feb 16, 2017
5ff9dfb
Version to 2.0
daimajia Feb 16, 2017
cf8e351
merge
daimajia Feb 16, 2017
afee57b
Update readme.
daimajia Feb 16, 2017
b4000ec
fix missing R.txt when building.
daimajia Feb 16, 2017
5542c58
update travis file.
daimajia Feb 16, 2017
6f9e978
fix travis badge wrong url.
daimajia Feb 16, 2017
782c928
no more eclipse.[C
Feb 21, 2017
a7b6ea4
Support YoYo repeat method. fix #22
Feb 21, 2017
6cc5684
add repeat method readme.
Feb 21, 2017
25f832a
upgrade to v2.1
Feb 21, 2017
3416179
support pivot reset. fix #74
Feb 21, 2017
89b980a
update to v2.2
Feb 21, 2017
2f515f3
Fix broken Markdown headings
bryant1410 Apr 17, 2017
ea1ae8a
Merge pull request #104 from bryant1410/master
daimajia May 3, 2017
b64da8d
Fix 'gitter badge' github mkdn syntax.
imknown May 5, 2017
0b036c2
Merge pull request #106 from imknown/pr-gitter-badge-mkdn
daimajia May 6, 2017
182175a
Fix crash on android 4.4 when animator repeat.
Jun 28, 2017
c364ec1
Update README.md
chongzhe Jul 11, 2017
a9ccf2c
Merge pull request #113 from chongzhe/patch-1
daimajia Jul 11, 2017
a446101
Merge pull request #110 from Tinker-S/master
daimajia Jul 17, 2017
0a74d40
update to v2.3
daimajia Jul 17, 2017
a536482
update toolchain configuration
daimajia May 31, 2019
ff90580
Merge branch 'master' of https://github.com/daimajia/AndroidViewAnima…
daimajia May 31, 2019
cb3653a
update readme, update my status right now.
daimajia May 31, 2019
2dc7d4d
refactor: migrating to AndroidX
mthli Aug 24, 2020
6a35c46
Merge pull request #158 from daimajia/androidx
daimajia Aug 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 12 additions & 66 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,12 @@
language: java

branches:
only:
- dev
- master

jdk: oraclejdk7

env:
global:
- ANDROID_SDK_VERSION="r22.6.2"

notifications:
email: false


before_install:

# environment info
- gradle -v
- uname -a

# required libs for android build tools
# Update a system for ia32 libraries
- 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
- 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

# Install required components.
# For a full list, run `android list sdk -a --extended`
- 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 --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
language: android
android:
components:
- tools
- platform-tools
- build-tools-25.0.2
- android-25
- extra-android-support
- extra
- extra-android-m2repository
script:
- ./gradlew assembleDebug
43 changes: 26 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
# Android View Animations [![Build Status](https://travis-ci.org/daimajia/AndroidViewAnimations.svg)](https://travis-ci.org/daimajia/AndroidAnimations)
# Android View Animations [![Build Status](https://travis-ci.org/daimajia/AndroidViewAnimations.svg)](https://travis-ci.org/daimajia/AndroidViewAnimations)

One day, I saw [an iOS library](https://github.com/ArtFeel/AFViewShaker), which is a view shaker, it's very beautiful. I think Android also need one, and should be better.

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

# Demo

![](http://ww3.sinaimg.cn/mw690/610dc034jw1ehnv2r93jpg20bx0kokjl.gif)
![](http://ww3.sinaimg.cn/mw690/610dc034gw1ej75mi2w77g20c30jb4qr.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.1.2/AndroidViewAnimations-1.1.2.apk)
# Usage

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

For making animations more real, I created another project named [Android Easing Functions](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

#### Gradle
```groovy
dependencies {
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.androidanimations:library:1.0.4@aar'
implementation 'com.daimajia.androidanimations:library:2.4@aar'
}
```
or Maven
#### Maven

```xml
<dependency>
<groupId>com.nineoldandroids</groupId>
<artifactId>library</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.daimajia.androidanimation</groupId>
<artifactId>library</artifactId>
<version>1.0.4</version>
<type>apklib</type>
<version>2.4</version>
</dependency>
```

Expand All @@ -42,6 +40,7 @@ Just like play Yo-yo.
```java
YoYo.with(Techniques.Tada)
.duration(700)
.repeat(5)
.playOn(findViewById(R.id.edit_area));
```

Expand All @@ -50,7 +49,7 @@ YoYo.with(Techniques.Tada)
`Flash`, `Pulse`, `RubberBand`, `Shake`, `Swing`, `Wobble`, `Bounce`, `Tada`, `StandUp`, `Wave`

#### Special
`Hinge`, `RollIn`, `RollOut`
`Hinge`, `RollIn`, `RollOut`,`Landing`,`TakingOff`,`DropOut`

#### Bounce
`BounceIn`, `BounceInDown`, `BounceInLeft`, `BounceInRight`, `BounceInUp`
Expand Down Expand Up @@ -80,14 +79,24 @@ YoYo.with(Techniques.Tada)

Welcome contribute your amazing animation effect. :-D

#Thanks
# Thanks

- [AFViewShaker](https://github.com/ArtFeel/AFViewShaker)
- [Animate.css](https://github.com/daneden/animate.css)

#About me
# Why YoYo?

A student in mainland China.
YoYo is a [toy](https://en.wikipedia.org/wiki/Yo-yo), with a lot of [Techniques](./library/src/main/java/com/daimajia/androidanimations/library/Techniques.java).

# About me

(2013)
A student in mainland China.

Welcome to [offer me an internship](mailto:[email protected]).
If you have any new idea about this project, feel free to [contact me](mailto:[email protected]).

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

Welcome to send your business plan to [me](mailto:[email protected]). Maybe I would have a better understanding on your startup project than others. Trust me.
14 changes: 6 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
mavenCentral()
jcenter()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:0.11.+'
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
classpath 'com.android.tools.build:gradle:4.0.1'
}
}

allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
}
27 changes: 14 additions & 13 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
apply plugin: 'android-sdk-manager'
apply plugin: 'android'
apply plugin: 'com.android.application'

android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
compileSdkVersion COMPILE_SDK_VERSION.toInteger()

defaultConfig {
applicationId "com.daimajia.androidanimations"
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "1.0"
applicationId GROUP
minSdkVersion MIN_SDK_VERSION.toInteger()
targetSdkVersion TARGET_SDK_VERSION.toInteger()
versionCode VERSION_CODE.toInteger()
versionName VERSION_NAME
}

buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions{
abortOnError false
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.nineoldandroids:library:2.4.0'
compile project(':library')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':library')
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public View getView(final int position, View convertView, ViewGroup parent) {
int start = o.getClass().getName().lastIndexOf(".") + 1;
String name = o.getClass().getName().substring(start);
t.setText(name);
v.setTag(o);
v.setTag(Techniques.values()[position]);
return v;
}
}
63 changes: 56 additions & 7 deletions demo/src/main/java/com/daimajia/androidanimations/MyActivity.java
Original file line number Diff line number Diff line change
@@ -1,39 +1,88 @@
package com.daimajia.androidanimations;

import android.animation.Animator;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;

import com.daimajia.androidanimations.library.BaseViewAnimator;
import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo;

public class MyActivity extends Activity {

private ListView mListView;
private EffectAdapter mAdapter;
private View mTarget;
private YoYo.YoYoString rope;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
mListView = (ListView)findViewById(R.id.list_items);

mListView = (ListView) findViewById(R.id.list_items);
mTarget = findViewById(R.id.hello_world);

mAdapter = new EffectAdapter(this);
mListView.setAdapter(mAdapter);

mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
((BaseViewAnimator) (view.getTag())).setDuration(800)
.setInterpolator(new AccelerateInterpolator())
.animate(mTarget);
if (rope != null) {
rope.stop(true);
}
Techniques technique = (Techniques) view.getTag();
rope = YoYo.with(technique)
.duration(1200)
.repeat(YoYo.INFINITE)
.pivot(YoYo.CENTER_PIVOT, YoYo.CENTER_PIVOT)
.interpolate(new AccelerateDecelerateInterpolator())
.withListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {

}

@Override
public void onAnimationEnd(Animator animation) {
}

@Override
public void onAnimationCancel(Animator animation) {
Toast.makeText(MyActivity.this, "canceled previous animation", Toast.LENGTH_SHORT).show();
}

@Override
public void onAnimationRepeat(Animator animation) {

}
})
.playOn(mTarget);
}
});
findViewById(R.id.hello_world).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (rope != null) {
rope.stop(true);
}
}
});
}

@Override
public void onWindowFocusChanged(boolean hasFocus) {
if (hasFocus) {
rope = YoYo.with(Techniques.FadeIn).duration(1000).playOn(mTarget);// after start,just click mTarget view, rope is not init
}
}


Expand All @@ -51,7 +100,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
startActivity(new Intent(this,ExampleActivity.class));
startActivity(new Intent(this, ExampleActivity.class));
return true;
}
return super.onOptionsItemSelected(item);
Expand Down
12 changes: 10 additions & 2 deletions demo/src/main/res/layout/activity_my.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand All @@ -8,17 +9,24 @@
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MyActivity">

<LinearLayout
android:id="@+id/wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:gravity="center"
android:layout_weight="1"
android:padding="30dp"
android:textSize="40sp"
android:id="@+id/hello_world"
android:text="@string/hello_world"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<ListView
android:id="@+id/list_items"
android:layout_below="@+id/hello_world"
android:layout_below="@+id/wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
</RelativeLayout>
Loading