leandroBorgesFerreira / LoadingButtonAndroid

A button to substitute the ProgressDialog
MIT License
1.94k stars 214 forks source link

startAnimation() with no parameters not working #166

Open ochamods opened 3 years ago

ochamods commented 3 years ago

After calling startAnimation() with no parameters the animation doesn't start. The version I am using is 2.2.0

This is my code

<br.com.simplepass.loadingbutton.customViews.CircularProgressButton
            android:id="@+id/login_button"
            style="@style/RoundedGreenSubmitButton"
            android:layout_height="0dp"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="16dp"
            android:layout_marginBottom="16dp"
            android:text="@string/login_text"
            app:spinning_bar_color="@color/greenSubmitButtonBPay"
            app:spinning_bar_padding="8dp"
            app:spinning_bar_width="4dp"
            android:background="@drawable/button_shape_no_fill"
            app:initialCornerAngle="0dp"
            app:layout_constraintBottom_toTopOf="@+id/register_button"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0.0"
            app:layout_constraintStart_toStartOf="parent" />

This is how I am testing it with DataBinding.

 ui.loginButton.setOnClickListener {
            //login()
            ui.loginButton.startAnimation()
        }
leandroBorgesFerreira commented 3 years ago

🤔 Did you try to use this inside a linear layout instead of the constraint layout? This button doesn't work very well with constraints

ChhaiHout commented 2 years ago

If you use v2.1.5, you can call someFragmentBinding.someCircularProgressButton..startMorphAnimation() instead.