Skip to content

Commit

Permalink
Merge pull request stefanjauker#11 from wangzhengyi/master
Browse files Browse the repository at this point in the history
Fix spelling error
  • Loading branch information
stefanjauker committed Sep 30, 2015
2 parents 0b357ea + 8eb9251 commit c2cfb6f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions BadgeView/src/com/jauker/widget/BadgeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,14 @@ private void init() {
setBadgeCount(0);
}

@SuppressWarnings("deprecation")
public void setBackground(int dipRadius, int badgeColor) {
int radius = dip2Px(dipRadius);
float[] radiusArray = new float[] { radius, radius, radius, radius, radius, radius, radius, radius };

RoundRectShape roundRect = new RoundRectShape(radiusArray, null, null);
ShapeDrawable bgDrawable = new ShapeDrawable(roundRect);
bgDrawable.getPaint().setColor(badgeColor);
setBackgroundDrawable(bgDrawable);
setBackground(bgDrawable);
}

/**
Expand Down Expand Up @@ -223,7 +222,7 @@ public void setTargetView(View target) {
target.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

parentContainer.addView(badgeContainer, groupIndex, parentlayoutParams);
parentContainer.addView(badgeContainer, groupIndex, parentLayoutParams);
badgeContainer.addView(target);

badgeContainer.addView(this);
Expand Down

0 comments on commit c2cfb6f

Please sign in to comment.