Skip to content

Commit

Permalink
1.[bug] 修复动态设置 max 不起作用的问题
Browse files Browse the repository at this point in the history
2.[bug] 修复gone->visible 绘图不对的问题
  • Loading branch information
VankaIn committed Jan 3, 2017
1 parent 46af6f3 commit fc63f15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bubbleseekbar/src/main/java/com/xw/repo/BubbleSeekBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
setMeasuredDimension(resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec), height);

mLeft = getPaddingLeft() + mThumbRadiusOnDragging;
mRight = getWidth() - getPaddingRight() - mThumbRadiusOnDragging;
mRight = getMeasuredWidth() - getPaddingRight() - mThumbRadiusOnDragging;

if (isShowText) {
mPaint.setTextSize(mTextSize);
Expand All @@ -259,7 +259,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
text = String.valueOf(mMax);
mPaint.getTextBounds(text, 0, text.length(), mRectText);
max = Math.max(mThumbRadiusOnDragging, mRectText.width() / 2f);
mRight = getWidth() - getPaddingRight() - max;
mRight = getMeasuredWidth() - getPaddingRight() - max;
}
}

Expand Down Expand Up @@ -680,6 +680,7 @@ public int getMax() {

public void setMax(int max) {
mMax = max;
postInvalidate();
}

public int getProgress() {
Expand Down

0 comments on commit fc63f15

Please sign in to comment.