Skip to content

Commit

Permalink
Merge pull request #10 from VankaIn/fix
Browse files Browse the repository at this point in the history
修复2个 bug
  • Loading branch information
woxingxiao authored Jan 3, 2017
2 parents 0f63bb1 + fc63f15 commit 546d86d
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 @@ -692,6 +692,7 @@ public int getMax() {

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

public int getProgress() {
Expand Down

0 comments on commit 546d86d

Please sign in to comment.