doneLoadingAnimation() does not show colour or bitmap most of the time.
KesWalker opened this issue · 4 comments
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 :/
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.
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.
🤔 could you provide a project where I can reproduce the problem? It would be much easier to debug it
@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 :)