Skip to content

Commit 8b4bb28

Browse files
committed
支持重新设置颜色及高度
1 parent fa1ad6c commit 8b4bb28

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

library/src/main/java/com/github/gzuliyujiang/library/.gitkeep

Whitespace-only changes.

library/src/main/java/com/github/gzuliyujiang/progressbar/EnhancedProgressBar.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ public EnhancedProgressBar(Context context, AttributeSet attrs, int defStyle) {
7575
init(context, attrs);
7676
}
7777

78+
public void setBarColor(int mReachedBarColor, int mUnReachedBarColor) {
79+
this.mReachedBarColor = mReachedBarColor;
80+
this.mUnReachedBarColor = mUnReachedBarColor;
81+
invalidate();
82+
}
83+
84+
public void setBarHeight(int mReachedBarHeight, int mUnReachedBarHeight) {
85+
this.mBarHeight = Math.max(mReachedBarHeight, mUnReachedBarHeight);
86+
this.mReachedBarHeight = mReachedBarHeight;
87+
this.mUnReachedBarHeight = mUnReachedBarHeight;
88+
requestLayout();
89+
invalidate();
90+
}
91+
7892
private void init(Context context, AttributeSet attrs) {
7993
if (attrs != null) {
8094
final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.EnhancedProgressBar);

0 commit comments

Comments
 (0)