Skip to content

Commit 2fa5062

Browse files
committed
update
1 parent 9917f1f commit 2fa5062

File tree

29 files changed

+289
-8
lines changed

29 files changed

+289
-8
lines changed

.travis.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
language: java
2+
jdk: oraclejdk7
3+
env:
4+
matrix:
5+
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
6+
7+
before_install:
8+
# Install base Android SDK
9+
- sudo apt-get update -qq
10+
- if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch > /dev/null; fi
11+
- wget http://dl.google.com/android/android-sdk_r22.3-linux.tgz
12+
- tar xzf android-sdk_r22.3-linux.tgz
13+
- export ANDROID_HOME=$PWD/android-sdk-linux
14+
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
15+
16+
# Gradle
17+
- wget http://services.gradle.org/distributions/gradle-1.9-bin.zip
18+
- unzip gradle-1.9-bin.zip
19+
- export GRADLE_HOME=$PWD/gradle-1.9
20+
- export PATH=$GRADLE_HOME/bin:$PATH
21+
22+
# Install required components
23+
# For a full list, run `android list sdk -a --extended`
24+
# Note that sysimg-19 downloads only ARM, because only the first license query is accepted.
25+
- echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null
26+
- echo yes | android update sdk --all --filter build-tools-19.0.3 --no-ui --force > /dev/null
27+
- echo yes | android update sdk --filter android-19 --no-ui --force > /dev/null
28+
- echo yes | android update sdk --filter sysimg-19 --no-ui --force > /dev/null
29+
- echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null
30+
- echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null
31+
32+
install:
33+
- ./gradlew assemble

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Android View Animations [![Build Status](https://travis-ci.org/daimajia/AndroidAnimations)](https://travis-ci.org/daimajia/AndroidAnimations)
2+
3+
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.
4+
5+
So, I started to collect animation effects... and in two days, this project born.
6+
7+
# Demo
8+
9+
![](http://ww3.sinaimg.cn/mw690/610dc034jw1ehnv2r93jpg20bx0kokjl.gif)
10+
11+
# Usage
12+
13+
## Step 1
14+
15+
```groovy
16+
dependencies {
17+
compile 'com.nineoldandroids:library:2.4.0'
18+
compile 'com.daimajia.androidanimations:library:1.0.0@aar'
19+
}
20+
```
21+
or Maven
22+
23+
```xml
24+
<dependency>
25+
<groupId>com.nineoldandroids</groupId>
26+
<artifactId>library</artifactId>
27+
<version>2.4.0</version>
28+
</dependency>
29+
<dependency>
30+
<groupId>com.daimajia.androidanimation</groupId>
31+
<artifactId>library</artifactId>
32+
<version>1.0.0</version>
33+
<type>apklib</type>
34+
</dependency>
35+
```
36+
37+
## Step2
38+
39+
Just like play Yo-yo.
40+
41+
```java
42+
YoYo.play(YoYo.Techniques.Shake,findViewById(R.id.eidtor));
43+
```
44+
45+
### Effects
46+
#### attension
47+
`Flash`, `Pulse`, `RubberBand`, `Shake`, `Swing`, `Wobble`, `Bounce`, `Tada`
48+
49+
#### Special
50+
`Hinge`, `RollIn`, `RollOut`
51+
52+
#### Bounce
53+
`BounceIn`, `BounceInDown`, `BounceInLeft`, `BounceInRight`, `BounceInUp`
54+
55+
#### Fade
56+
`FadeIn`, `FadeInDown`, `FadeInLeft`, `FadeInRight`
57+
`FadeOut`, `FadeOutDown`, `FadeOutLeft`, `FadeOutRight`, `FadeOutUp`
58+
59+
#### Flip
60+
`FlipInX`, `FlipOutX`, `FlipOutY`
61+
62+
#### Rotate
63+
`RotateIn`, `RotateInDownLeft`, `RotateInDownRight`, `RotateInUpLeft`, `RotateInUpRight`
64+
`RotateOut`, `RotateOutDownLeft`, `RotateOutDownRight`, `RotateOutUpLeft`, `RotateOutUpRight`
65+
66+
#### Slide
67+
`SlideInLeft`, `SlideInRight`, `SlideInUp`, `SlideInDown`
68+
`SlideOutLeft`, `SlideOutRight`, `SlideOutUp`, `SlideOutDown`
69+
70+
#### Zoom
71+
`ZoomIn`, `ZoomInDown`, `ZoomInLeft`, `ZoomInRight`, `ZoomInUp`
72+
`ZoomOut`, `ZoomOutDown`, `ZoomOutLeft`, `ZoomOutRight`, `ZoomOutUp`
73+
74+
Welcome contribute your amazing animation effect. :-D
75+
76+
#About me
77+
78+
A student in mainland China.
79+
80+
Welcome to [offer me an internship](mailto:[email protected]).
81+
If you have any new idea about this project, feel free to [contact me](mailto:[email protected]).

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
}
77
dependencies {
88
classpath 'com.android.tools.build:gradle:0.11.+'
9-
9+
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10.+'
1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files
1212
}
File renamed without changes.

app/build.gradle renamed to demo/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
apply plugin: 'android-sdk-manager'
12
apply plugin: 'android'
23

34
android {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

gradle.properties

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,20 @@
1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
18+
# org.gradle.parallel=true
19+
20+
21+
VERSION_NAME=1.0.0
22+
VERSION_CODE=1
23+
GROUP=com.daimajia.androidanimations
24+
25+
POM_DESCRIPTION=Collect android animations
26+
POM_URL=https://github.com/daimajia/AndroidAnimations
27+
POM_SCM_URL=https://github.com/daimajia/AndroidAnimations
28+
POM_SCM_CONNECTION=scm:https://github.com/daimajia/AndroidAnimations.git
29+
POM_SCM_DEV_CONNECTION=scm:https://github.com/daimajia/AndroidAnimations.git
30+
POM_LICENCE_NAME=MIT
31+
POM_LICENCE_URL=http://opensource.org/licenses/MIT
32+
POM_LICENCE_DIST=repo
33+
POM_DEVELOPER_ID=daimajia
34+
POM_DEVELOPER_NAME=daimajia

library/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ android {
99
minSdkVersion 8
1010
targetSdkVersion 19
1111
versionCode 1
12-
versionName "1.0"
12+
versionName "1.0.0"
1313
}
1414
buildTypes {
1515
release {
@@ -24,3 +24,4 @@ dependencies {
2424
compile 'com.android.support:appcompat-v7:19.+'
2525
compile 'com.nineoldandroids:library:2.4.0'
2626
}
27+
apply from: './gradle-mvn-push.gradle'

library/gradle-mvn-push.gradle

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
/*
2+
* Copyright 2013 Chris Banes
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
apply plugin: 'maven'
18+
apply plugin: 'signing'
19+
20+
def isReleaseBuild() {
21+
return VERSION_NAME.contains("SNAPSHOT") == false
22+
}
23+
24+
def getReleaseRepositoryUrl() {
25+
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
26+
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
27+
}
28+
29+
def getSnapshotRepositoryUrl() {
30+
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
31+
: "https://oss.sonatype.org/content/repositories/snapshots/"
32+
}
33+
34+
def getRepositoryUsername() {
35+
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
36+
}
37+
38+
def getRepositoryPassword() {
39+
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
40+
}
41+
42+
afterEvaluate { project ->
43+
uploadArchives {
44+
repositories {
45+
mavenDeployer {
46+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
47+
48+
pom.groupId = GROUP
49+
pom.artifactId = POM_ARTIFACT_ID
50+
pom.version = VERSION_NAME
51+
52+
repository(url: getReleaseRepositoryUrl()) {
53+
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
54+
}
55+
snapshotRepository(url: getSnapshotRepositoryUrl()) {
56+
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
57+
}
58+
59+
pom.project {
60+
name POM_NAME
61+
packaging POM_PACKAGING
62+
description POM_DESCRIPTION
63+
url POM_URL
64+
65+
scm {
66+
url POM_SCM_URL
67+
connection POM_SCM_CONNECTION
68+
developerConnection POM_SCM_DEV_CONNECTION
69+
}
70+
71+
licenses {
72+
license {
73+
name POM_LICENCE_NAME
74+
url POM_LICENCE_URL
75+
distribution POM_LICENCE_DIST
76+
}
77+
}
78+
79+
developers {
80+
developer {
81+
id POM_DEVELOPER_ID
82+
name POM_DEVELOPER_NAME
83+
}
84+
}
85+
}
86+
}
87+
}
88+
}
89+
90+
signing {
91+
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
92+
sign configurations.archives
93+
}
94+
95+
task apklib(type: Zip){
96+
appendix = extension = 'apklib'
97+
98+
from 'AndroidManifest.xml'
99+
into('res') {
100+
from 'res'
101+
}
102+
into('src') {
103+
from 'src'
104+
}
105+
}
106+
107+
task androidJavadocs(type: Javadoc) {
108+
source = android.sourceSets.main
109+
classpath += project.files(android.getBootClasspath() .join(File.pathSeparator))
110+
}
111+
112+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
113+
classifier = 'javadoc'
114+
from androidJavadocs.destinationDir
115+
}
116+
117+
task androidSourcesJar(type: Jar) {
118+
classifier = 'sources'
119+
from android.sourceSets.main
120+
}
121+
122+
artifacts {
123+
archives androidSourcesJar
124+
archives androidJavadocsJar
125+
archives apklib
126+
}
127+
}

library/gradle.properties

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Settings specified in this file will override any Gradle settings
5+
# configured through the IDE.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14+
15+
# When configured, Gradle will run in incubating parallel mode.
16+
# This option should only be used with decoupled projects. More details, visit
17+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18+
# org.gradle.parallel=true
19+
20+
POM_NAME=AndroidAnimations Library
21+
POM_ARTIFACT_ID=library
22+
POM_PACKAGING=aar

library/src/main/java/com/daimajia/androidanimations/library/BaseViewAnimator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public BaseViewAnimator setDuration(long duration){
5959
return this;
6060
}
6161

62-
public BaseViewAnimator setStartDeley(long delay){
62+
public BaseViewAnimator setStartDelay(long delay){
6363
getAnimatorAgent().setStartDelay(delay);
6464
return this;
6565
}

library/src/main/java/com/daimajia/androidanimations/library/YoYo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ public static void play(Techniques name, View target, Animator.AnimatorListener.
164164
}
165165

166166
public static void play(Techniques name, View target,long delay,long duration){
167-
name.getAnimator().setDuration(duration).setStartDeley(delay).animate(target);
167+
name.getAnimator().setDuration(duration).setStartDelay(delay).animate(target);
168168
}
169169

170170
public static void play(Techniques name, View target,long delay,long duration,Interpolator interpolator){
171-
name.getAnimator().setDuration(duration).setStartDeley(delay).setInterpolator(interpolator).animate(target);
171+
name.getAnimator().setDuration(duration).setStartDelay(delay).setInterpolator(interpolator).animate(target);
172172
}
173173

174174
public static void play(Techniques name, View target, long delay, long duration, Interpolator interpolator, Animator.AnimatorListener ... listeners){
@@ -178,7 +178,7 @@ public static void play(Techniques name, View target, long delay, long duration,
178178
}
179179
animator.setDuration(duration);
180180
animator.setInterpolator(interpolator);
181-
animator.setStartDeley(delay);
181+
animator.setStartDelay(delay);
182182
animator.animate(target);
183183
}
184184
}

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include ':app', ':library'
1+
include ':library', 'demo'

0 commit comments

Comments
 (0)