Skip to content

Commit c407692

Browse files
committed
update build files
1 parent 817af41 commit c407692

File tree

22 files changed

+750
-2
lines changed

22 files changed

+750
-2
lines changed

.idea/gradle.xml

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ buildscript {
66
}
77
dependencies {
88
classpath 'com.android.tools.build:gradle:2.1.0'
9-
9+
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
10+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
1011
// NOTE: Do not place your application dependencies here; they belong
1112
// in the individual module build.gradle files
1213
}

particletextview/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

particletextview/build.gradle

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
apply plugin: 'com.android.library'
2+
apply plugin: 'com.github.dcendents.android-maven'
3+
apply plugin: 'com.jfrog.bintray'
4+
5+
version = "0.0.2"
6+
7+
ext {
8+
bintrayRepo = 'maven'
9+
bintrayName = 'ParticleTextView'
10+
11+
publishedGroupId = 'com.yasic.library'
12+
libraryName = 'ParticleTextView'
13+
artifact = 'particleTextView'
14+
15+
libraryDescription = ''
16+
17+
siteUrl = 'https://github.com/Yasic/ParticleTextView'
18+
gitUrl = 'https://github.com/Yasic/ParticleTextView.git'
19+
20+
libraryVersion = '0.0.1'
21+
22+
developerId = 'yasic'
23+
developerName = 'yasic'
24+
developerEmail = '[email protected]'
25+
26+
licenseName = 'The Apache Software License, Version 2.0'
27+
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
28+
allLicenses = ["Apache-2.0"]
29+
}
30+
31+
android {
32+
compileSdkVersion 23
33+
buildToolsVersion "23.0.3"
34+
resourcePrefix "yasic__"
35+
36+
defaultConfig {
37+
minSdkVersion 15
38+
targetSdkVersion 23
39+
versionCode 1
40+
versionName "1.0"
41+
}
42+
buildTypes {
43+
release {
44+
minifyEnabled false
45+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
46+
}
47+
}
48+
}
49+
50+
dependencies {
51+
compile fileTree(dir: 'libs', include: ['*.jar'])
52+
testCompile 'junit:junit:4.12'
53+
compile 'com.android.support:appcompat-v7:23.3.0'
54+
compile 'io.reactivex:rxandroid:1.1.0'
55+
}
56+
57+
group = "yasic.library.ParticleTextView"
58+
59+
install {
60+
repositories.mavenInstaller {
61+
// This generates POM.xml with proper parameters
62+
pom {
63+
project {
64+
packaging 'aar' // Add your description here
65+
name 'ParticleTextView'
66+
description 'Android Customize View'
67+
url siteUrl // Set your license
68+
licenses {
69+
license {
70+
name 'The Apache Software License, Version 2.0'
71+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
72+
}
73+
}
74+
developers {
75+
developer {
76+
id 'yasic'
77+
name 'yasic'
78+
79+
}
80+
}
81+
scm {
82+
connection gitUrl
83+
developerConnection gitUrl
84+
url siteUrl
85+
}
86+
}
87+
}
88+
}
89+
}
90+
91+
task sourcesJar(type: Jar) {
92+
from android.sourceSets.main.java.srcDirs
93+
classifier = 'sources'
94+
}
95+
task javadoc(type: Javadoc) {
96+
source = android.sourceSets.main.java.srcDirs
97+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
98+
}
99+
task javadocJar(type: Jar, dependsOn: javadoc) {
100+
classifier = 'javadoc'
101+
from javadoc.destinationDir
102+
}
103+
artifacts {
104+
archives javadocJar
105+
archives sourcesJar
106+
}
107+
108+
Properties properties = new Properties()
109+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
110+
bintray {
111+
user = properties.getProperty("bintray.user")
112+
key = properties.getProperty("bintray.apikey")
113+
configurations = ['archives']
114+
pkg {
115+
repo = "maven"
116+
name = "ParticleTextView"
117+
websiteUrl = siteUrl
118+
vcsUrl = gitUrl
119+
licenses = ["Apache-2.0"]
120+
publish = true
121+
}
122+
}

particletextview/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /home/yasic/Android/Sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.github.yasic.particletextview;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.github.yasic.particletextview">
3+
4+
<application
5+
android:allowBackup="true"
6+
android:label="@string/app_name"
7+
android:supportsRtl="true">
8+
9+
</application>
10+
11+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.github.yasic.particletextview.MovingStrategy;
2+
3+
import com.github.yasic.particletextview.Object.Particle;
4+
5+
public class BidiverticalStrategy extends MovingStrategy {
6+
@Override
7+
public void setMovingPath(Particle particle, int rangeWidth, int rangeHeight, double[] targetPosition) {
8+
Double[][] path = new Double[4][2];
9+
path[0][0] = rangeWidth * Math.random();
10+
path[0][1] = (Math.random() < 0.5) ? Double.valueOf(-particle.getRadius()) : Double.valueOf(rangeHeight + particle.getRadius());
11+
path[1][0] = targetPosition[0];
12+
path[1][1] = targetPosition[1];
13+
path[2][0] = rangeWidth * Math.random();
14+
path[2][1] = (Math.random() < 0.5) ? Double.valueOf(-particle.getRadius()) : Double.valueOf(rangeHeight + particle.getRadius());
15+
path[3][0] = targetPosition[0];
16+
path[3][1] = targetPosition[1];
17+
particle.setPath(path);
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.github.yasic.particletextview.MovingStrategy;
2+
3+
import com.github.yasic.particletextview.Object.Particle;
4+
5+
public class BidizontalStrategy extends MovingStrategy {
6+
@Override
7+
public void setMovingPath(Particle particle, int rangeWidth, int rangeHeight, double[] targetPosition) {
8+
Double[][] path = new Double[4][2];
9+
path[0][0] = (Math.random() < 0.5)?Double.valueOf(-particle.getRadius()) : Double.valueOf(rangeWidth + particle.getRadius());
10+
path[0][1] = Math.random() * rangeHeight;
11+
path[1][0] = targetPosition[0];
12+
path[1][1] = targetPosition[1];
13+
path[2][0] = (Math.random() < 0.5)?Double.valueOf(-particle.getRadius()) : Double.valueOf(rangeWidth + particle.getRadius());
14+
path[2][1] = Math.random() * rangeHeight;
15+
path[3][0] = targetPosition[0];
16+
path[3][1] = targetPosition[1];
17+
particle.setPath(path);
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.github.yasic.particletextview.MovingStrategy;
2+
3+
import com.github.yasic.particletextview.Object.Particle;
4+
5+
public class CornerStrategy extends MovingStrategy {
6+
7+
@Override
8+
public void setMovingPath(Particle particle, int rangeWidth, int rangeHeight, double[] targetPosition) {
9+
Double[][] path = new Double[4][2];
10+
path[0][0] = (double) ((Math.random() < 0.5) ? 0 : rangeWidth);
11+
if (path[0][0] == 0){
12+
path[0][0] -= Math.random() * rangeWidth/10;
13+
} else {
14+
path[0][0] += Math.random() * rangeWidth/10;
15+
}
16+
path[0][1] = (double) ((Math.random() < 0.5) ? 0 : rangeHeight);
17+
if (path[0][1] == 0){
18+
path[0][1] -= Math.random() * rangeHeight/10;
19+
} else {
20+
path[0][1] += Math.random() * rangeHeight/10;
21+
}
22+
path[1][0] = targetPosition[0];
23+
path[1][1] = targetPosition[1];
24+
path[2][0] = Double.valueOf(rangeWidth/2);
25+
path[2][1] = Double.valueOf(rangeHeight/2);
26+
path[3][0] = targetPosition[0];
27+
path[3][1] = targetPosition[1];
28+
particle.setPath(path);
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.github.yasic.particletextview.MovingStrategy;
2+
3+
import com.github.yasic.particletextview.Object.Particle;
4+
5+
public class HorizontalStrategy extends MovingStrategy {
6+
@Override
7+
public void setMovingPath(Particle particle, int rangeWidth, int rangeHeight, double[] targetPosition) {
8+
Double[][] path = new Double[4][2];
9+
path[0][0] = Double.valueOf(-particle.getRadius());
10+
path[0][1] = Math.random() * rangeHeight;
11+
path[1][0] = targetPosition[0];
12+
path[1][1] = targetPosition[1];
13+
path[2][0] = Double.valueOf(rangeWidth + particle.getRadius());
14+
path[2][1] = Math.random() * rangeHeight;
15+
path[3][0] = targetPosition[0];
16+
path[3][1] = targetPosition[1];
17+
particle.setPath(path);
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.github.yasic.particletextview.MovingStrategy;
2+
3+
import com.github.yasic.particletextview.Object.Particle;
4+
5+
public abstract class MovingStrategy {
6+
public abstract void setMovingPath(Particle particle, int rangeWidth, int rangeHeight, double[] targetPosition);
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.github.yasic.particletextview.MovingStrategy;
2+
3+
import com.github.yasic.particletextview.Object.Particle;
4+
5+
public class RandomMovingStrategy extends MovingStrategy{
6+
7+
@Override
8+
public void setMovingPath(Particle particle, int rangeWidth, int rangeHeight, double[] targetPosition) {
9+
Double[][] path = new Double[2][2];
10+
path[0][0] = Math.random() * rangeWidth;
11+
path[0][1] = Math.random() * rangeHeight;
12+
path[1][0] = targetPosition[0];
13+
path[1][1] = targetPosition[1];
14+
particle.setPath(path);
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.github.yasic.particletextview.MovingStrategy;
2+
3+
import com.github.yasic.particletextview.Object.Particle;
4+
5+
public class VerticalStrategy extends MovingStrategy{
6+
@Override
7+
public void setMovingPath(Particle particle, int rangeWidth, int rangeHeight, double[] targetPosition) {
8+
Double[][] path = new Double[4][2];
9+
path[0][0] = rangeWidth * Math.random();
10+
path[0][1] = Double.valueOf(-particle.getRadius());
11+
path[1][0] = targetPosition[0];
12+
path[1][1] = targetPosition[1];
13+
path[2][0] = rangeWidth * Math.random();
14+
path[2][1] = Double.valueOf(rangeHeight + particle.getRadius());
15+
path[3][0] = targetPosition[0];
16+
path[3][1] = targetPosition[1];
17+
particle.setPath(path);
18+
}
19+
}

0 commit comments

Comments
 (0)