leandroBorgesFerreira / LoadingButtonAndroid

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

revertAnimation changes button appearance #149

Closed Milchschlumpf closed 4 years ago

Milchschlumpf commented 4 years ago

Before the first click, the button has round corners. When I call revertAnimation the button changes his appearance without round corners. Tested it without anything special. No background. Just the normal button.

leandroBorgesFerreira commented 4 years ago

Can you provide the code for the xml?

Milchschlumpf commented 4 years ago

Sure:

<br.com.simplepass.loadingbutton.customViews.CircularProgressButton android:id="@+id/btnLogin" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:text="@string/login" android:backgroundTint="@color/colorAccent" android:textColor="@color/white" android:onClick="@{() -> handlers.onLoginClick()}" app:spinning_bar_color="#FFF"/>

You can see the same behavior in your sample app. Look at "Test 4" Button before and after you clicked it.

leandroBorgesFerreira commented 4 years ago

You didn't set the app:finalCornerAngle in the XML. Just include app:finalCornerAngle="50dp" and it will work as expected.

hyyu commented 4 years ago

@leandroBorgesFerreira I found the solution for my problem here but it isn't logic.

I set the background as a rounded drawable and when the button reverts it becomes straight but keeps the color.

Why would i set initial and final rounded corners if I use an already rounded drawable to customize the button?