leandroBorgesFerreira / LoadingButtonAndroid

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

doneLoadingAnimation() does not show colour or bitmap most of the time. #159

Closed KesWalker closed 4 years ago

KesWalker commented 4 years ago

When running:
btn.doneLoadingAnimation(Color.parseColor("#ff0000"), bitmap); The button will transform it's shape into a circle as it should, but will not change colour or show the bitmap provided. Strangely, this happens 90% of the time and the rest of the time it works fine :/

leandroBorgesFerreira commented 4 years ago

Hello @KesWalker. Sorry that you're having this problem. I also had this problem while using Color.parseColor("#ff0000"). Could you try ContextCompat.getColor(context, [someColor])? It works fine.

KesWalker commented 4 years ago

Hi @leandroBorgesFerreira. I've just tried that, the issue still persists :/ This is what I've tried: btn.doneLoadingAnimation(ContextCompat.getColor(getContext(),R.color.negativeRed), bitmap);

R.color.negativeRed being: <color name="negativeRed">#ff0000</color> And the getContext() returns the context of the fragment.

Note: also I am using Java and not Kotlin, I dont know whether this is a factor.

leandroBorgesFerreira commented 4 years ago

:thinking: could you provide a project where I can reproduce the problem? It would be much easier to debug it

KesWalker commented 4 years ago

@leandroBorgesFerreira I've attempted to reproduce it myself in another project, but I'm unable to do so (it's working fine in the new project) which makes me think there is something wrong in my project. I have came up with a work around for me as I do not have time to investigate further, I'll close this issue but if I can reproduce the issue later, I'll be in touch & reopen :)