Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkYuan committed Jul 20, 2016
2 parents 63ae343 + f78a8c2 commit 9204d7d
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 7 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.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Spark

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# SubmitButton
A cool and elegant Submit Button

## Demo
![Markdown]()

##Attributes

```xml
<com.spark.submitbutton.SubmitButton
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Submit"
android:textColor="@color/gray"
app:sub_btn_background="@color/white"
app:sub_btn_duration="3000"
app:sub_btn_line_color="@color/green"
app:sub_btn_ripple_color="@color/green"
app:sub_btn_tick_color="@color/white" />

```

## Download

Step 1. Configure your module-level build.gradle to include the follow repository:

```gradle
repositories {
maven {
url 'https://dl.bintray.com/spark/maven'
}
}
```

Step 2. Add the dependency:

```gradle
dependencies {
compile 'me.spark:submitbutton:1.0.0'
}
```


##**Lincense**

```lincense
The MIT License (MIT)
Copyright (c) 2016 Spark
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
android:layout_height="match_parent"
android:text="Submit"
android:textColor="@color/white"
android:textSize="25sp"
android:textSize="20sp"
app:sub_btn_duration="4000" />
</LinearLayout>
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'

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

Expand Down
Binary file added pic/submitbutton.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions submitbutton/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'


group = 'me.spark' // Change this to match your package name
version = '1.0.0' // Change this to match your version number


android {
compileSdkVersion 23
Expand All @@ -23,3 +30,52 @@ dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
}


task generateSourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier 'sources'
}

task generateJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath()
.join(File.pathSeparator))
}

task generateJavadocsJar(type: Jar) {
from generateJavadocs.destinationDir
classifier 'javadoc'
}

artifacts {
// archives generateJavaDocsJar
archives generateSourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.key")
pkg {
repo = 'maven'
name = 'SubmitButton'
desc = "A cool and elegant Submit Button."

version {
name = '1.0.0'
desc = 'A cool and elegant Submit Button.'
vcsTag = 'Android,Submit,Button,Animator,Animation'
}

licenses = ['MIT']
vcsUrl = 'https://github.com/SparkYuan/SubmitButton.git'
websiteUrl = 'https://github.com/SparkYuan/SubmitButton'

labels = ['android']
publish = true
publicDownloadNumbers = true
}
configurations = ['archives']
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public class SubmitButton extends TextView {
private int mInitBtnColor;
private int mLineColor;
private int mTickColor;
private int mRippleColor;

public SubmitButton(Context context) {
super(context);
Expand Down Expand Up @@ -193,7 +192,7 @@ void init(AttributeSet attrs) {
mTickPaint.setColor(mTickColor);
mTickPaint.setStyle(Paint.Style.STROKE);
mRipplePaint = new Paint();
mRippleColor = typeArray.getColor(R.styleable.SubmitButton_sub_btn_ripple_color,
int mRippleColor = typeArray.getColor(R.styleable.SubmitButton_sub_btn_ripple_color,
ContextCompat.getColor(getContext(), R.color.sub_btn_ripple));
mRipplePaint.setColor(mRippleColor);
mRipplePaint.setAntiAlias(true);
Expand Down

0 comments on commit 9204d7d

Please sign in to comment.