Coder Social home page Coder Social logo

stevendxc / dxloadingbutton Goto Github PK

View Code? Open in Web Editor NEW
393.0 393.0 81.0 628 KB

Android material button with loading animation

License: Apache License 2.0

Java 6.63% Kotlin 93.37%
android animation button-widget java kotlin loading-animation material-design ui

dxloadingbutton's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dxloadingbutton's Issues

Nougat

dxLoadingButton.animationEndAction = fun(animationType: AnimationType): Unit {
toNextPage(string,noPhone)
return Unit
}

cannot run on nougat

Probem when soft input open

I use android 9 and this test is on genymotion.

when i set windowSoftInputMode to adjustResize the button will shrink. when click on it small circle turns.

When soft input is closed. it's good

screenshot-۲۰۱۹-۰۵-۲۵_۱۲ ۲۵ ۴۰ ۵۵۶

When soft input is open

screenshot-۲۰۱۹-۰۵-۲۵_۱۲ ۲۳ ۱۰ ۵۹۵

I have a problem in this library

when in used this library it does not work.... please help and i also used this in androidx and it layout does not supported.... please see my image and help me.. sir
help

Error inflating class com.dx.dxloadingbutton.widget.LoadingButton

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

Failed to resolve: com.github.StevenDXC:DxLoadingButton:2.0

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
}

Change background of button

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.

Problem background button

<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" />

screenshot_1530838807

DxLoading Button Animation

How to stop the animation by just calling a method like loadingSuccessful() instead of adding qualifier lb to the method ?

setTypeface method

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 :)

No method to set text dynamically in Java code!!

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! 👍

Usage in Readme.md is Outdated

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.

loadingFailed not working

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

Rendering problems.

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?

Width as wrap_content

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!

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.