TextDrawable icon indicating copy to clipboard operation
TextDrawable copied to clipboard

Random color doesn't work

Open rodrinac opened this issue 7 years ago • 1 comments

Hi, This is the code I have private val textBuilder = TextDrawable.builder() private val colorGenerator = ColorGenerator.MATERIAL;

fun String.toTextDrawable() : TextDrawable {
    return textBuilder.buildRound(
            this[0].toString(),
            colorGenerator.randomColor
    )
}

The generated drawable has aways a gray background.

rodrinac avatar Nov 02 '18 22:11 rodrinac

I faced something similar today and wasted 30 minutes looking in the wrong place. Turns out I was using :tint in my XML to color the imageview gray. Remove that property fixed the issue for me.

buildbro avatar Jul 02 '19 19:07 buildbro