TextDrawable icon indicating copy to clipboard operation
TextDrawable copied to clipboard

How to change background and text color same time?

Open Bekakk opened this issue 8 years ago • 1 comments

Hi I'm using your Repo.I try to change background and text color same time.How I can do this? Here is my source

` public void setDrawableText(String text, int fontSize, int textColor,int backgroundColor) { drawable = TextDrawable.builder(). beginConfig(). fontSize(fontSize).toUpperCase(). useFont(typeface). endConfig(). buildRound(text, textColor);

    if (imageView != null && drawable != null)
        imageView.setImageDrawable(drawable);
}`

Bekakk avatar Sep 13 '17 20:09 Bekakk

you could try

public void setDrawableText(String text, int fontSize, int textColor,int backgroundColor) {
drawable = TextDrawable.builder()
.beginConfig()
.fontSize(fontSize).toUpperCase().useFont(typeface).textColor(textColor)
.endConfig()
.buildRound(text, backgroundColor);
if (imageView != null && drawable != null)
        imageView.setImageDrawable(drawable);
}

p.s. first time to use markdown, sorry if it looked terrible :/

hrmck avatar May 14 '20 17:05 hrmck