leandroBorgesFerreira / LoadingButtonAndroid

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

Icons Flattened #170

Closed sebasira closed 3 years ago

sebasira commented 3 years ago

I'm using the exact same (copy/paste) .png from your repo and set any of them on the doneLoadingAnimation, but somehow they are all flattened.

They are not square, like they should, they are wider.

This is my from my layout:

<br.com.simplepass.loadingbutton.customViews.CircularProgressButton
        style="@style/Widget.AppCompat.Button.Colored"
        android:id="@+id/cpbStartStay"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        android:text="INICIAR ESTADÍA"
        app:finalCornerAngle="50dp"
        app:initialCornerAngle="0dp"
        app:spinning_bar_color="#FFFFFF"
        app:spinning_bar_padding="0dp"
        app:spinning_bar_width="3dp" />

And this is how I'm setting it:

button.doneLoadingAnimation(
                ContextCompat.getColor(getApplicationContext(), R.color.error_red),
                BitmapFactory.decodeResource(getResources(), R.drawable.ic_alarm_on_white_48dp));

And this is how it looks like

Screen Shot 2020-10-24 at 18 37 55
sebasira commented 3 years ago

I've figure out that the style="@style/Widget.AppCompat.Button.Colored" was causing this issue, don't know why... just trial and error.

Now it's working fine!