stevendxc / dxloadingbutton Goto Github PK
View Code? Open in Web Editor NEWAndroid material button with loading animation
License: Apache License 2.0
Android material button with loading animation
License: Apache License 2.0
dxLoadingButton.animationEndAction = fun(animationType: AnimationType): Unit {
toNextPage(string,noPhone)
return Unit
}
cannot run on nougat
How to handle the reset animation in list view while scrolling the list view in android.
How can i change button color.
I am getting this error can anyone help me what I am missing or doing wrong?
This is my error log:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.zapro.itradevehicle, PID: 1651
android.view.InflateException: Binary XML file line #149: Error inflating class com.dx.dxloadingbutton.widget.LoadingButton
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.zapro.itradevehicle.Buyer.SearchFragment.onCreateView(SearchFragment.java:85)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2184)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1298)
at android.support.v4.app.FragmentManagerImpl.moveFragmentsToInvisible(FragmentManager.java:2323)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2136)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2092)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1998)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:709)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.dx.dxloadingbutton.widget.LoadingButton" on path: DexPathList[[zip file "/data/app/com.zapro.itradevehicle-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.zapro.itradevehicle-2, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.view.LayoutInflater.createView(LayoutInflater.java:559)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.zapro.itradevehicle.Buyer.SearchFragment.onCreateView(SearchFragment.java:85)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2184)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1298)
at android.support.v4.app.FragmentManagerImpl.moveFragmentsToInvisible(FragmentManager.java:2323)
at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2136)
at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2092)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1998)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:709)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Application terminated.
Thanks
I give button font sets a color # FF95B7E4 lead to collapse, I will change to color it works here
Can it be compliled with gradle?
Hi,
I am getting the above mentioned error while syncing gradle project. I am using Gradle version 3.1.1.
How can this be fixed?
**Application level gradle**
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.myapp.login"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
api 'com.squareup.retrofit2:retrofit:2.1.0'
api 'com.squareup.retrofit2:converter-gson:2.1.0'
api "com.android.support:recyclerview-v7:27.1.1"
api 'com.google.code.gson:gson:2.8.1'
api 'com.github.StevenDXC:DxLoadingButton:2.0'
}
**Project level gradle**
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Hi @StevenDXC , thank you so much for such a good library. My question is I want to change the background with curve edges. I tried with drawable background like "app:lb_btnColor="@color/curve_signin_button_background" but it is not working. Please suggest some solution.
<com.dx.dxloadingbutton.lib.LoadingButton android:id="@+id/add" android:layout_width="fill_parent" android:layout_height="48dp" android:layout_marginBottom="8dp" android:layout_marginEnd="16dp" android:layout_marginStart="16dp" android:layout_marginTop="8dp" android:background="@drawable/round_corner_spiner" android:textColor="@android:color/white" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.501" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/linearLayout2" app:lb_btnText="Add" />
Duplicate rippleColor definitions, won't compile.
How to stop the animation by just calling a method like loadingSuccessful() instead of adding qualifier lb to the method ?
actually, I think a listener after both success and failed animation is better.
thanks.
I want to change font of button text, but there is no method for it! also my button text language is Persian and default font is not suitable for my app.
please help me :)
I mean, really? How's setText()
method not there yet? I think changing button text dynamically through Java code would be one important feature when loading has failed. Think about this, instead of resetting to "Submit" you set the text to.. ... "Try Again" or something like that. Do I make sense?
And thanks for the lib. Nice work! 👍
where is the gradle dependency?
Awesome work, loving the buttons!
Just one thing... If I do myButton.startLoading()
, I can still press the button and itl perform the onClickListener function. I've tried using setEnable
to no avail.
Please update the Readme.md file. The usage instructions are confusing.
It is supposed to be
<com.dx.dxloadingbutton.lib.LoadingButton
android:id="@+id/loading_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
app:lb_btnText ="@string/button_text"
app:rippleColor="@color/primary"
app:lb_btnColor="@color/primary"
app:lb_resetAfterFailed="true" />
Thanks for the efforts. I liked your library. Kudos.
If we call button.loadingFailed() just after calling button.startLoading() the circular animation never stops,
when i try with small delay before calling button.loadingFailed() then it works perfectly.
EDIT : version 1.5 works fine
I have added the Gradle dependency and it syncs correctly. But I get "Rendering problems". I have added the xmlns:app="http://schemas.android.com/apk/res-auto", still nothing. Also I noticed that if I go inside the buttons block and I want to use the autocomplete for "app:" it doesn't work, it says "No suggestions". Any ideas about that?
DxLoadingButton doesn't set it's width automatically to the required padding according to the text when it's layout_width is set to wrap_content.
Any chance of this to be added in the future?
Ripple effect on click button with radius go over corners.
Is there any chance for this to be fix?
And any chance that ripple effect go over the whole button?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.