Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change background and text color same time? #60

Open
Bekakk opened this issue Sep 13, 2017 · 1 comment
Open

How to change background and text color same time? #60

Bekakk opened this issue Sep 13, 2017 · 1 comment

Comments

@Bekakk
Copy link

Bekakk commented Sep 13, 2017

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);
}`
@hrmck
Copy link

hrmck commented May 14, 2020

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 :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants