Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.idea/*
.DS_Store
/build
/captures
.externalNativeBuild

56 changes: 25 additions & 31 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.unstoppable.submitbutton"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':submitbuttonview')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.unstoppable.submitbutton"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':submitbuttonview')

implementation 'androidx.appcompat:appcompat:1.0.0'
}

This file was deleted.

14 changes: 7 additions & 7 deletions app/src/main/java/com/unstoppable/submitbutton/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.view.accessibility.AccessibilityManager;
import android.widget.Button;
Expand All @@ -25,13 +25,13 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

sBtnLoading = (SubmitButton) findViewById(R.id.sbtn_loading);
sBtnProgress = (SubmitButton) findViewById(R.id.sbtn_progress);
mSwitch = (Switch) findViewById(R.id.switch1);
sBtnLoading = findViewById(R.id.sbtn_loading);
sBtnProgress = findViewById(R.id.sbtn_progress);
mSwitch = findViewById(R.id.switch1);

btnFailed = (Button) findViewById(R.id.btn_failed);
btnSucceed = (Button) findViewById(R.id.btn_succeed);
btnReset = (Button) findViewById(R.id.btn_reset);
btnFailed = findViewById(R.id.btn_failed);
btnSucceed = findViewById(R.id.btn_succeed);
btnReset = findViewById(R.id.btn_reset);

sBtnLoading.setOnClickListener(this);
sBtnProgress.setOnClickListener(this);
Expand Down

This file was deleted.

48 changes: 18 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.novoda:bintray-release:0.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
tasks.withType(Javadoc) {
options{
encoding "UTF-8"
charSet 'UTF-8'
links "http://docs.oracle.com/javase/7/docs/api"
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
buildscript {
repositories {
jcenter()
maven { url "https://maven.google.com" }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}

allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
Expand Down
12 changes: 6 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Apr 18 09:09:14 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
#Sat Oct 28 10:51:25 CDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
33 changes: 9 additions & 24 deletions submitbuttonview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
apply plugin: 'com.github.dcendents.android-maven'

group='com.github.searchy2'
version = '1.8.1'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 28

defaultConfig {
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
Expand All @@ -28,20 +27,6 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
}

publish {
userOrg = 'unstoppable'
groupId = 'com.unstoppable'
artifactId = 'submitbutton'
publishVersion = '1.1.3'
desc = 'It\'s a submit button with a fun animation for Android.'
website = 'https://github.com/Someonewow/SubmitButton'
}

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
import android.graphics.PathMeasure;
import android.graphics.Rect;
import android.graphics.RectF;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
Expand Down Expand Up @@ -450,6 +448,38 @@ public void reset() {
invalidate();
}

/**
* Set Button to Result State
*
* @param success true = result success; false = failure
*/
public void setResult(boolean success)
{
isSucceed = success;
viewState = STATE_RESULT;
if (loadingAnim != null) {
loadingAnim.cancel();
}
if (isSucceed) {
bgPaint.setColor(succeedColor);
} else {
bgPaint.setColor(failedColor);
}
bgPaint.setStyle(Paint.Style.FILL_AND_STROKE);
resultPaint.setAlpha(255);
invalidate();
}

/**
* Set Button to Loading State
*/
public void setLoading()
{
viewState = STATE_LOADING;
mWidth = mHeight;
startLoadingAnim();
}

/**
* 设置进度
*
Expand All @@ -466,6 +496,21 @@ public void setProgress(int progress) {
}


/**
* Set Button text. Redraws button if text is visible.
*
* @param text Text to display on button.
*/
public void setText(String text)
{
buttonText = text;
if (viewState == STATE_NONE)
{
init();
invalidate();
}
}

/**
* 设置动画结束回调接口
*
Expand Down

This file was deleted.