leandroBorgesFerreira / LoadingButtonAndroid

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

The circle shape of button when loading is not maintained when the button background is managed dynamically #195

Open Aayush-Sarikhada opened 2 months ago

Aayush-Sarikhada commented 2 months ago

Hello, thank you for the awesome library

Issue: I have a feature in my app where a loading button can change its color to grey when some conditions are not matched but button can still act like it is enabled. So i am setting the button background dynamically like this in xml.

but when the animation starts the button keeps the original corner radius and the button just goes into loading state and it does not show a fully circular button.

android:background="@{canAddToCart ? @drawable/bg_btn_cart : @drawable/bg_btn_cart_disabled, default=@drawable/bg_btn_cart}"

I have found one work around by downgrading the version to 2.0.7 . btw i was using 2.2.0