Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nekocode committed Mar 3, 2019
1 parent 6cc1fee commit 47a878f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lib-badge/src/main/java/cn/nekocode/badge/BadgeDrawable.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private static class Config {
private float paddingRight = dipToPixels(2);
private float paddingBottom = dipToPixels(2);
private float paddingCenter = dipToPixels(3);
private int storkeWidth = (int) dipToPixels(1);
private int strokeWidth = (int) dipToPixels(1);
}
private Config config;

Expand Down Expand Up @@ -136,7 +136,7 @@ public Builder padding(float l, float t, float r, float b, float c) {
}

public Builder strokeWidth(int width) {
config.storkeWidth = width;
config.strokeWidth = width;
return this;
}

Expand Down Expand Up @@ -249,7 +249,7 @@ public void setPadding(float l, float t, float r, float b, float c) {
}

public void setStrokeWidth(int width) {
config.storkeWidth = width;
config.strokeWidth = width;
}

private void measureBadge() {
Expand Down Expand Up @@ -365,9 +365,9 @@ public void draw(@NonNull Canvas canvas) {
backgroundDrawableOfText2.setBounds(
(int) (bounds.left + marginLeftAndRight + config.paddingLeft +
text1Width + config.paddingCenter / 2f),
bounds.top + marginTopAndBottom+ config.storkeWidth,
bounds.width() - marginLeftAndRight - config.storkeWidth,
bounds.bottom - marginTopAndBottom - config.storkeWidth);
bounds.top + marginTopAndBottom+ config.strokeWidth,
bounds.width() - marginLeftAndRight - config.strokeWidth,
bounds.bottom - marginTopAndBottom - config.strokeWidth);
backgroundDrawableOfText2.getPaint().setColor(config.textColor);
backgroundDrawableOfText2.draw(canvas);

Expand All @@ -381,11 +381,11 @@ public void draw(@NonNull Canvas canvas) {

case TYPE_WITH_TWO_TEXT:
backgroundDrawableOfText1.setBounds(
bounds.left + marginLeftAndRight + config.storkeWidth,
bounds.top + marginTopAndBottom+ config.storkeWidth,
bounds.left + marginLeftAndRight + config.strokeWidth,
bounds.top + marginTopAndBottom+ config.strokeWidth,
(int) (bounds.left + marginLeftAndRight + config.paddingLeft +
text1Width + config.paddingCenter / 2f - config.storkeWidth / 2f),
bounds.bottom - marginTopAndBottom - config.storkeWidth);
text1Width + config.paddingCenter / 2f - config.strokeWidth / 2f),
bounds.bottom - marginTopAndBottom - config.strokeWidth);
backgroundDrawableOfText1.getPaint().setColor(0xffFFFFFF);
backgroundDrawableOfText1.draw(canvas);

Expand All @@ -398,10 +398,10 @@ public void draw(@NonNull Canvas canvas) {

backgroundDrawableOfText2.setBounds(
(int) (bounds.left + marginLeftAndRight + config.paddingLeft +
text1Width + config.paddingCenter / 2f + config.storkeWidth / 2f),
bounds.top + marginTopAndBottom + config.storkeWidth,
bounds.width() - marginLeftAndRight - config.storkeWidth,
bounds.bottom - marginTopAndBottom - config.storkeWidth);
text1Width + config.paddingCenter / 2f + config.strokeWidth / 2f),
bounds.top + marginTopAndBottom + config.strokeWidth,
bounds.width() - marginLeftAndRight - config.strokeWidth,
bounds.bottom - marginTopAndBottom - config.strokeWidth);
backgroundDrawableOfText2.getPaint().setColor(0xffFFFFFF);
backgroundDrawableOfText2.draw(canvas);

Expand Down

0 comments on commit 47a878f

Please sign in to comment.