TextDrawable icon indicating copy to clipboard operation
TextDrawable copied to clipboard

How to set border color?

Open Kolyall opened this issue 10 years ago • 5 comments

TextDrawable.builder() .beginConfig() .withBorder(4) /* thickness in px */ .toUpperCase() .endConfig() .buildRound("AB", color);

How to set this border color?

Kolyall avatar Jan 18 '16 09:01 Kolyall

As far as I know, this option has not been provided yet. I modified the library a bit, and now you can set the border color. You can either set the color as a String or as a Color.

TextDrawable itemdrawable = TextDrawable.builder()
                .beginConfig()
                .withBorder(4, "#009688") /* thickness in px */
                 // or
                .withBorder(4, Color.GREEN)
                .endConfig()
                .buildRound("AB", color);

Change the code of TextDrawable.java to this: https://gist.github.com/jossiwolf/3333379af7901771fc75

jossiwolf avatar Jan 20 '16 22:01 jossiwolf

borderPaint.setAntiAlias(true);

Antialiasing

liangxianshen avatar Jul 11 '16 11:07 liangxianshen

@jossiwolf Anyway you can create a pull request for border color modification?

roman-ku avatar Jan 04 '17 01:01 roman-ku

@roman-ku Sure, I'll do it in the next few days.

jossiwolf avatar Jan 04 '17 03:01 jossiwolf

@jossiwolf Actually don't bother, the maintainer has several open pull requests (one of them already being border color), and he hasn't merged any of them.

roman-ku avatar Jan 04 '17 06:01 roman-ku