Skip to content

Commit

Permalink
Enhancement: #37
Browse files Browse the repository at this point in the history
  • Loading branch information
whilu committed Dec 21, 2016
1 parent f8ce588 commit f3e573b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ Now, you have successfully created some TagViews. The following will show some m
| container_max_lines | integer | The max lines for TagContainerLayout(default 0, auto increase)
| tag_border_width | dimension | TagView Border width(default 0.5dp)
| tag_corner_radius | dimension | TagView Border radius(default 15.0dp)
| tag_horizontal_padding | dimension | Horizontal padding for TagView, include left and right padding(left and right padding are equal, default 20px)
| tag_vertical_padding | dimension | Vertical padding for TagView, include top and bottom padding(top and bottom padding are equal, default 17px)
| tag_horizontal_padding | dimension | Horizontal padding for TagView, include left and right padding(left and right padding are equal, default 10dp)
| tag_vertical_padding | dimension | Vertical padding for TagView, include top and bottom padding(top and bottom padding are equal, default 8dp)
| tag_text_size | dimension | TagView Text size(default 14sp)
| tag_bd_distance | dimension | The distance between baseline and descent(default 5.5px)
| tag_bd_distance | dimension | The distance between baseline and descent(default 2.75dp)
| tag_text_color | color | TagView text color(default #FF666666)
| tag_border_color | color | TagView border color(default #88F44336)
| tag_background_color | color | TagView background color(default #33F44336)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public class TagContainerLayout extends ViewGroup {
/** Text direction(support:TEXT_DIRECTION_RTL & TEXT_DIRECTION_LTR, default TEXT_DIRECTION_LTR)*/
private int mTagTextDirection = View.TEXT_DIRECTION_LTR;

/** Horizontal padding for TagView, include left & right padding(left & right padding are equal, default 20px)*/
private int mTagHorizontalPadding = 20;
/** Horizontal padding for TagView, include left & right padding(left & right padding are equal, default 10dp)*/
private int mTagHorizontalPadding = 10;

/** Vertical padding for TagView, include top & bottom padding(top & bottom padding are equal, default 17px)*/
private int mTagVerticalPadding = 17;
/** Vertical padding for TagView, include top & bottom padding(top & bottom padding are equal, default 8dp)*/
private int mTagVerticalPadding = 8;

/** TagView border color(default #88F44336)*/
private int mTagBorderColor = Color.parseColor("#88F44336");
Expand All @@ -102,8 +102,8 @@ public class TagContainerLayout extends ViewGroup {
/** TagView drag state(default STATE_IDLE)*/
private int mTagViewState = ViewDragHelper.STATE_IDLE;

/** The distance between baseline and descent(default 5.5px)*/
private float mTagBdDistance = 5.5f;
/** The distance between baseline and descent(default 2.75dp)*/
private float mTagBdDistance = 2.75f;

/** OnTagClickListener for TagView*/
private TagView.OnTagClickListener mOnTagClickListener;
Expand Down Expand Up @@ -176,7 +176,7 @@ private void init(Context context, AttributeSet attrs, int defStyleAttr){
mBorderRadius = attributes.getDimension(R.styleable.AndroidTagView_container_border_radius,
dp2px(context, mBorderRadius));
mTagBdDistance = attributes.getDimension(R.styleable.AndroidTagView_tag_bd_distance,
mTagBdDistance);
dp2px(context, mTagBdDistance));
mBorderColor = attributes.getColor(R.styleable.AndroidTagView_container_border_color,
mBorderColor);
mBackgroundColor = attributes.getColor(R.styleable.AndroidTagView_container_background_color,
Expand All @@ -193,9 +193,10 @@ private void init(Context context, AttributeSet attrs, int defStyleAttr){
mTagBorderRadius = attributes.getDimension(
R.styleable.AndroidTagView_tag_corner_radius, dp2px(context, mTagBorderRadius));
mTagHorizontalPadding = (int) attributes.getDimension(
R.styleable.AndroidTagView_tag_horizontal_padding, mTagHorizontalPadding);
R.styleable.AndroidTagView_tag_horizontal_padding,
dp2px(context, mTagHorizontalPadding));
mTagVerticalPadding = (int) attributes.getDimension(
R.styleable.AndroidTagView_tag_vertical_padding, mTagVerticalPadding);
R.styleable.AndroidTagView_tag_vertical_padding, dp2px(context, mTagVerticalPadding));
mTagTextSize = attributes.getDimension(R.styleable.AndroidTagView_tag_text_size,
sp2px(context, mTagTextSize));
mTagBorderColor = attributes.getColor(R.styleable.AndroidTagView_tag_border_color,
Expand Down

0 comments on commit f3e573b

Please sign in to comment.