Skip to content

Commit

Permalink
修改lib名字
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyung541 committed Oct 25, 2016
1 parent ecb4a35 commit 8ef9cd4
Show file tree
Hide file tree
Showing 16 changed files with 139 additions and 47 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

提供```playTogether()``` 同时执行多个动画和```playSequence()```顺序执行多个动画两个方法

##比与AnimatorSet异同点
##与AnimatorSet异同点

* 1 **封装了动画监听**```Animator.AnimatorListener```,不用单独再给属性动画设置监听器,直接用```addStartAction(Animator anim, Action start)``````addEndAction(Animator anim, Action end)```可以监听动画执行前和动画执行后的动作,```Action```代表了一个动作。
* 2 **动画的精准控制**:允许某个动画执行到某个点时,控制其它动画的开始
Expand Down Expand Up @@ -77,7 +77,7 @@ A先播放,B在A的值达到600的时候播放,C在B达到600时候播放
```
animSet.playFirst(A);//A作为头,最先执行
animSet.addAnimBetween(B, A, new TriggerPoint(600));
animSet.addAnimBetween(C, A, new TriggerPoint(600));
animSet.addAnimBetween(C, B, new TriggerPoint(600));
```
以上这个例子是动画的值为```Float```的情况,如果值为```Int```型也按照这种构造函数的方式传入开始点

Expand Down Expand Up @@ -111,7 +111,4 @@ animSet.addAnimWith(C, B);//添加C,和B同时执行


##最后
更多详情请看Sample项目



更多详情请看Sample项目
File renamed without changes.
120 changes: 120 additions & 0 deletions actionanimatorset/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

//def siteUrl = 'https://github.com/paulyung541/ActionAnimatorSet'
//def gitUrl = 'https://github.com/paulyung541/ActionAnimatorSet.git'
//group = "com.paulyung" // Maven Group ID for the artifact
//version = "1.0.0"

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
resourcePrefix "随便填"
defaultConfig {
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}

//install {
// repositories.mavenInstaller {
// // This generates POM.xml with proper parameters
// pom {
// project {
// packaging 'aar'
// name 'ActionAnimatorSet'
// description 'An animator operation set on Android'
// url siteUrl
// licenses {
// license {
// name 'GNU GENERAL PUBLIC LICENSE, Version 3.0'
// url 'http://www.gnu.org/philosophy/why-not-lgpl.html'
// }
// }
// developers {
// developer {
// id 'paulyung'
// name 'paulyung'
// email 'paulyung@outlook.com'
// }
// }
// scm {
// connection gitUrl
// developerConnection gitUrl
// url siteUrl
// }
// }
// }
// }
//}
//task sourcesJar(type: Jar) {
// from android.sourceSets.main.java.srcDirs
// classifier = 'sources'
//}
//task javadoc(type: Javadoc) {
// source = android.sourceSets.main.java.srcDirs
// classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
//}
//task javadocJar(type: Jar, dependsOn: javadoc) {
// classifier = 'javadoc'
// from javadoc.destinationDir
//}
//artifacts {
// archives javadocJar
// archives sourcesJar
//}
//Properties properties = new Properties()
//properties.load(project.rootProject.file('local.properties').newDataInputStream())
//bintray {
// user = properties.getProperty("bintray.user")
// key = properties.getProperty("bintray.apikey")
// configurations = ['archives']
// pkg {
// repo = "maven2"
// name = "actionanimatorset"
// websiteUrl = siteUrl
// vcsUrl = gitUrl
// licenses = ["GNU-3.0"]
// publish = true
// }
//}

ext {
bintrayRepo = 'maven'
bintrayName = 'actionanimatorset'

publishedGroupId = 'com.paulyung'
libraryName = 'actionanimatorset'
artifact = 'actionanimatorset'

libraryDescription = 'An animator operation set on Android'

siteUrl = 'https://github.com/paulyung541/ActionAnimatorSet'
gitUrl = 'https://github.com/paulyung541/ActionAnimatorSet.git'

libraryVersion = '1.0.0'

developerId = 'paulyung'
developerName = 'paulyung'
developerEmail = 'paulyung@outlook.com'

licenseName = 'GNU GENERAL PUBLIC LICENSE, Version 3.0'
licenseUrl = 'http://www.gnu.org/philosophy/why-not-lgpl.html'
allLicenses = ["GNU-3.0"]
}

apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ public boolean equals(Object o) {
return res;
}

//如果传入的不是普通类型,则需重写此方法
//在方法内判断时尽量使用 '>' 而不要使用 '='
//此时这样做,精确度不如普通类型经过计算找的那个点准确
//但是也不会差远,是距离设定值最近的那两个点的较大一个的值对应的时刻触发动画
/**
* if the param is not a value-type such as int and float etc, you must
* overwrite this method.It would be best to use '>' or '<', but not to
* use a '=',because the value could not be so accurate.
* */
public boolean whenToStart(T o) {
return false;
}

//计算什么时候和设定值最接近
//compare the set-value and calculate-value whether effective or not
private boolean calculate() {
return Math.abs(v1v2.getFirst() - value_int) < Math.abs(v1v2.getLast() - value_int);
}
Expand Down
31 changes: 0 additions & 31 deletions actionanimtorset/build.gradle

This file was deleted.

7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -16,6 +17,10 @@ allprojects {
repositories {
jcenter()
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
}
}

task clean(type: Delete) {
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':actionanimtorset')
compile project(':actionanimatorset')
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
testCompile 'junit:junit:4.12'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class AnimEvaluator implements TypeEvaluator<AnimPoint> {
@Override
public AnimPoint evaluate(float fraction, AnimPoint startValue, AnimPoint endValue) {
float x = 0f, y = 0f;
x = calculateCubic(fraction, startValue.mEndX, endValue.mCtlX1, endValue.mCtlX2, endValue.mEndX);
y = calculateCubic(fraction, startValue.mEndY, endValue.mCtlY1, endValue.mCtlY2, endValue.mEndY);
x = calculateCubic(fraction, startValue.mEndX, endValue.mCtlX1, endValue.mCtlX2, endValue.mEndX);
y = calculateCubic(fraction, startValue.mEndY, endValue.mCtlY1, endValue.mCtlY2, endValue.mEndY);

return AnimPoint.newInstance(x, y);
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':actionanimtorset', ':sample'
include ':actionanimatorset', ':sample'

0 comments on commit 8ef9cd4

Please sign in to comment.