Skip to content

Commit

Permalink
Optimize the cracking
Browse files Browse the repository at this point in the history
Optimize the cracking
  • Loading branch information
ldoublem committed Aug 5, 2016
1 parent dae5d2a commit 04c1f95
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions ThumbUplib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,88 @@ dependencies {
compile 'com.android.support:appcompat-v7:24.1.1'
testCompile 'junit:junit:4.12'
}


apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = "0.1"
def siteUrl = 'https://github.com/ldoublem/ThumbUp' // project homepage
def gitUrl = 'https://github.com/ldoublem/ThumbUp.git' // project git
group = "com.ldoublem.thumbUplib"


install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
name 'A nice thumb up control'//一些描述
url siteUrl
licenses {
license {
name 'The Apache software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {//开发者信息
id ''
name 'ldoublem'
email '[email protected]'
}
}
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
}

javadoc {
options{
encoding 'UTF-8'
charSet 'UTF-8'
author true
}
}

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 = "maven"
name = "thumbUplib" // project name in maven
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}
26 changes: 7 additions & 19 deletions ThumbUplib/src/main/java/com/ldoublem/thumbUplib/ThumbUpView.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ private void drawBrokenLove(Canvas canvasMain, float mAnimatedBrokenValue) {
float fristY = (float) (0.17 * realHeight) + rectFlove.top;
float lastX = (float) (0.5 * realWidth) + rectFlove.left;
float lastY = (float) (realHeight * 0.8 + rectFlove.top);
float secondX = lastX + realWidth / 10f;
float secondX = lastX + realWidth / 14f;
float secondY = fristY + (lastY - fristY) / 4f;
float thirdX = lastX - realWidth / 10f;
float thirdY = fristY + (lastY - fristY) / 2f;
float thirdX = lastX - realWidth / 12f;
float thirdY = fristY + (lastY - fristY) / 2.5f;

// if (mBitmapBrokenLeftLove == null) {

Expand Down Expand Up @@ -293,12 +293,12 @@ private void drawBrokenLine(Canvas canvas, float mAnimatedBrokenValue) {
float lastY = (float) (realHeight * 0.8 + rectFlove.top);


float secondX = lastX + realWidth / 10f;
float secondX = lastX + realWidth / 14f;
float secondY = fristY + (lastY - fristY) / 4f;


float thirdX = lastX - realWidth / 10f;
float thirdY = fristY + (lastY - fristY) / 2f;
float thirdX = lastX - realWidth / 12f;
float thirdY = fristY + (lastY - fristY) / 2.5f;


Path line = new Path();
Expand Down Expand Up @@ -395,19 +395,7 @@ private void drawDrops(Canvas canvas, float mAnimatedBrokenValue) {

);

// if (mAnimatedBrokenValue > 0.5f) {
//
// canvas.drawCircle(rectFlove.centerX() -
// rectFlove.width() / 4-dip2px(8),
// rectFlove.centerY() + rectFlove.height() / 10 +
// rectFlove.height() / 3 * mAnimatedBrokenValue,
// dip2px(3)+dip2px(2)* (1 - mAnimatedBrokenValue),
// mPaintLike
//
// );
//
//
// }



canvas.drawCircle(rectFlove.centerX() +
Expand Down
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ dependencies {
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
testCompile 'junit:junit:4.12'
compile project(':ThumbUplib')
// compile 'com.ldoublem.thumbUplib:ThumbUplib:0.1'

}
2 changes: 1 addition & 1 deletion app/src/main/java/com/ldoublem/thumbUp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected void onCreate(Bundle savedInstanceState) {


tpv3.setLikeType(ThumbUpView.LikeType.broken);
tpv3.setCracksColor(Color.rgb(22, 33, 44));
tpv3.setCracksColor(Color.WHITE);
tpv3.setFillColor(Color.rgb(11, 200, 77));
tpv3.setEdgeColor(Color.rgb(33, 3, 219));
tpv3.setOnThumbUp(new ThumbUpView.OnThumbUp() {
Expand Down
3 changes: 2 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.0-alpha6'

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down

0 comments on commit 04c1f95

Please sign in to comment.