Closed msrd0 closed 7 years ago
Hello @msrd0. I just fixed this issue, using a fork of this project by @jguerinet. The version 1.8.3 contains the fix.
You can check this link for a example of use with Anko DSL: https://github.com/leandroBorgesFerreira/LoadingButtonAndroid/blob/master/app/src/main/java/br/com/simplepass/loadingbutton/AnkoActivity.kt
@leandroBorgesFerreira I've been meaning to PR that fix back into your project, thanks for getting to it first. I've got a couple of other fixes (namely, being able to set the attributes programmatically) that I'll PR into your repo in the next couple of days.
@jguerinet Sounds good, for now I have copied the source code and made the mParams
public, but not the best solution
Running your code on an Android 6 Device with Kotlin and Anko, I get the following error:
I tried delivering
StateListDrawable.getCurrent()
as background resource, but still no luck:This is my code for integration with anko:
Looking at the source code, it seems that you are only looking for the type of the Drawable if the passed AttributeSet is not null. While this is the case when inflating from xml layout, programmatically creating the button will hit that bug.