Skip to content

Commit

Permalink
upate demo to andoridX, fix crash error
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangdong.cheng committed May 21, 2020
1 parent 61d3d03 commit 6de6ae1
Show file tree
Hide file tree
Showing 43 changed files with 45 additions and 39 deletions.
Empty file modified LICENSE
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DxLoadingButton

android button view with loading animation,and load successful/failed animation
android button to loading view with animation,and load successful/failed animation


[![](https://jitpack.io/v/StevenDXC/DxLoadingButton.svg)](https://jitpack.io/#StevenDXC/DxLoadingButton)
Expand Down
Empty file modified app/.gitignore
100644 → 100755
Empty file.
11 changes: 8 additions & 3 deletions app/build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ android {
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
buildToolsVersion = '29.0.3'
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.12'
implementation project(':library')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
Expand Down
Empty file modified app/proguard-rules.pro
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions app/src/androidTest/java/com/dx/dxloadingbutton/ExampleInstrumentedTest.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.dx.dxloadingbutton;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Empty file modified app/src/main/AndroidManifest.xml
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion app/src/main/java/com/dx/dxloadingbutton/DemoActivity.kt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import android.graphics.LinearGradient
import android.graphics.Shader
import android.graphics.Typeface
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.view.View
import android.widget.Toast
import com.dx.dxloadingbutton.demo.LoginDemoActivity
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/dx/dxloadingbutton/demo/LoginDemoActivity.kt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.dx.dxloadingbutton.demo
import android.animation.Animator
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.view.View
import android.view.ViewAnimationUtils
import android.view.animation.AccelerateDecelerateInterpolator
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/dx/dxloadingbutton/demo/SecondActivity.kt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.dx.dxloadingbutton.demo

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity

import com.dx.dxloadingbutton.R

Expand Down
16 changes: 13 additions & 3 deletions app/src/main/res/layout/activity_demo.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
android:layout_height="match_parent">


<android.support.v7.widget.AppCompatEditText
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/edit_user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:hint="@string/user_name"/>

<android.support.v7.widget.AppCompatEditText
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/edit_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -39,7 +39,17 @@
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
app:lb_btnText ="@string/button_text"
app:lb_min_height="48dp"/>
app:lb_min_height="48dp"
app:lb_btnColor="@color/colorAccent"
app:lb_btnDisabledColor="@color/colorPrimaryDark"
app:lb_btnRippleAlpha="0.6"
app:lb_btnRippleColor="#000000"
app:lb_cornerRadius="20dp"
app:lb_disabledTextColor="#cccccc"
app:lb_resetAfterFailed="true"
app:lb_rippleEnable="true"
app:lb_textColor="#cccccc"
/>

</LinearLayout>

Expand Down
5 changes: 2 additions & 3 deletions app/src/main/res/layout/activity_main.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="10sp"
android:text="successful"/>
android:text="success"/>

<Button
style="?android:buttonBarButtonStyle"
Expand Down Expand Up @@ -59,7 +58,7 @@
android:layout_marginRight="32dp"
app:lb_resetAfterFailed="true"
app:lb_btnRippleColor="#000000"
app:lb_btnText="@string/button_text"
app:lb_btnText="#FF95B7E4"
/>


Expand Down
Empty file modified app/src/main/res/layout/activity_second.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified app/src/main/res/values-w820dp/dimens.xml
100644 → 100755
Empty file.
10 changes: 0 additions & 10 deletions app/src/main/res/values/attrs.xml

This file was deleted.

Empty file modified app/src/main/res/values/colors.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/values/dimens.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/values/strings.xml
100644 → 100755
Empty file.
Empty file modified app/src/main/res/values/styles.xml
100644 → 100755
Empty file.
Empty file modified app/src/test/java/com/dx/dxloadingbutton/ExampleUnitTest.java
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.21'
ext.kotlin_version = '1.3.72'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
100644 → 100755
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
Empty file modified gradle/wrapper/gradle-wrapper.jar
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Jun 20 16:19:59 CST 2019
#Thu May 21 11:15:46 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
Empty file modified gradlew.bat
100644 → 100755
Empty file.
Empty file modified image/loadingButton.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified image/loadingButton2.gif
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified image/loadingButton_shader.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified library/.gitignore
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions library/build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
versionCode 1
versionName "1.0"

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

}
buildTypes {
Expand All @@ -24,11 +24,11 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.13'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
repositories {
Expand Down
Empty file modified library/proguard-rules.pro
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions library/src/androidTest/java/com/dx/dxloadingbutton/lib/ExampleInstrumentedTest.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.dx.dxloadingbutton.lib;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Empty file modified library/src/main/AndroidManifest.xml
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion library/src/main/java/com/dx/dxloadingbutton/lib/LoadingButton.kt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class LoadingButton @JvmOverloads constructor(
rippleColor = ta.getColor(R.styleable.LoadingButton_lb_btnRippleColor, Color.BLACK)
rippleEnable = ta.getBoolean(R.styleable.LoadingButton_lb_rippleEnable, true)
mRippleAlpha = ta.getFloat(R.styleable.LoadingButton_lb_btnRippleAlpha, 0.3f)
mButtonCorner = ta.getFloat(R.styleable.LoadingButton_lb_cornerRadius, 2 * mDensity)
mButtonCorner = ta.getDimension(R.styleable.LoadingButton_lb_cornerRadius, 2 * mDensity)
mMinHeight = ta.getDimension(R.styleable.LoadingButton_lb_min_height, defaultMinHeight)
ta.recycle()
}
Expand Down
6 changes: 3 additions & 3 deletions library/src/main/res/values/attrs.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<declare-styleable name="LoadingButton">
<attr name="lb_btnColor" format="reference|color" />
<attr name="lb_btnText" format="reference|string" />
<attr name="lb_textColor" format="reference|string" />
<attr name="lb_textColor" format="reference|color" />
<attr name="lb_resetAfterFailed" format="boolean" />
<attr name="lb_rippleEnable" format="boolean" />
<attr name="lb_btnRippleColor" format="reference|color" />
<attr name="lb_btnRippleAlpha" format="float" />
<attr name="lb_cornerRadius" format="float" />
<attr name="lb_cornerRadius" format="dimension" />
<attr name="lb_min_height" format="dimension" />
<attr name="lb_btnDisabledColor" format="reference|color" />
<attr name="lb_disabledTextColor" format="reference|string" />
<attr name="lb_disabledTextColor" format="reference|color" />
</declare-styleable>
</resources>
Empty file modified library/src/main/res/values/strings.xml
100644 → 100755
Empty file.
Empty file.
Empty file modified settings.gradle
100644 → 100755
Empty file.

0 comments on commit 6de6ae1

Please sign in to comment.