Skip to content

Commit

Permalink
Permit Client Border Color
Browse files Browse the repository at this point in the history
  • Loading branch information
niedzielski committed Feb 23, 2015
1 parent 558677e commit e5d2a28
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private TextDrawable(Builder builder) {
// border paint settings
borderThickness = builder.borderThickness;
borderPaint = new Paint();
borderPaint.setColor(getDarkerShade(color));
borderPaint.setColor(builder.borderColor == null ? getDarkerShade(color) : builder.borderColor);
borderPaint.setStyle(Paint.Style.STROKE);
borderPaint.setStrokeWidth(borderThickness);

Expand Down Expand Up @@ -144,6 +144,8 @@ public static class Builder implements IConfigBuilder, IShapeBuilder, IBuilder {

private int borderThickness;

private Integer borderColor;

private int width;

private int height;
Expand All @@ -167,6 +169,7 @@ private Builder() {
color = Color.GRAY;
textColor = Color.WHITE;
borderThickness = 0;
borderColor = null;
width = -1;
height = -1;
shape = new RectShape();
Expand Down Expand Up @@ -196,6 +199,11 @@ public IConfigBuilder withBorder(int thickness) {
return this;
}

public IConfigBuilder withBorderColor(int color) {
this.borderColor = color;
return this;
}

public IConfigBuilder useFont(Typeface font) {
this.font = font;
return this;
Expand Down Expand Up @@ -281,6 +289,8 @@ public interface IConfigBuilder {

public IConfigBuilder withBorder(int thickness);

public IConfigBuilder withBorderColor(int color);

public IConfigBuilder useFont(Typeface font);

public IConfigBuilder fontSize(int size);
Expand Down Expand Up @@ -313,4 +323,4 @@ public static interface IShapeBuilder {

public TextDrawable buildRound(String text, int color);
}
}
}

0 comments on commit e5d2a28

Please sign in to comment.