amulyakhare / TextDrawable

This light-weight library provides images with letter/text like the Gmail app. It extends the Drawable class thus can be used with existing/custom/network ImageView classes. Also included is a fluent interface for creating drawables and a customizable ColorGenerator.
MIT License
3.16k stars 622 forks source link

How to set border color? #39

Open Kolyall opened 8 years ago

Kolyall commented 8 years ago

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

How to set this border color?

jossiwolf commented 8 years ago

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

liangxianshen commented 8 years ago

borderPaint.setAntiAlias(true);

Antialiasing

roman-ku commented 7 years ago

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

jossiwolf commented 7 years ago

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

roman-ku commented 7 years ago

@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.