Skip to content

Commit

Permalink
修复代码动态设置分割线无效的bug(新增setDividerLineType()动态设置分割线)
Browse files Browse the repository at this point in the history
  • Loading branch information
lygttpod committed Apr 12, 2019
1 parent 784e032 commit 1aa88f3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 220
versionName "2.2.0"
versionCode 221
versionName "2.2.1"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
29 changes: 8 additions & 21 deletions library/src/main/java/com/allen/library/SuperTextView.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ public class SuperTextView extends RelativeLayout {
/**
* 分割线的类型
*/
private static final int NONE = 0;
private static final int TOP = 1;
private static final int BOTTOM = 2;
private static final int BOTH = 3;
public static final int NONE = 0;
public static final int TOP = 1;
public static final int BOTTOM = 2;
public static final int BOTH = 3;
private static final int default_Divider = BOTTOM;

private int default_Margin = 10;
Expand Down Expand Up @@ -2198,25 +2198,12 @@ private void setTextGravity(BaseTextView baseTextView, int gravity) {
}

/**
* 设置上边分割线显示状态
*
* @param isShow isShow
* @return this
*/
public SuperTextView isShowTopDivider(boolean isShow) {
mIsShowTopDivider = isShow;
invalidate();
return this;
}

/**
* 设置下边分割线显示状态
*
* @param isShow isShow
* 代码动态设置分割线显示类型
* @param dividerType TOP、BOTTOM、BOTH、NONE
* @return this
*/
public SuperTextView isShowBottomDivider(boolean isShow) {
mIsShowBottomDivider = isShow;
public SuperTextView setDividerLineType(int dividerType) {
mDividerLineType = dividerType;
invalidate();
return this;
}
Expand Down

0 comments on commit 1aa88f3

Please sign in to comment.