From fc63f151ea31714f785959b6d15ff04051cd84c5 Mon Sep 17 00:00:00 2001 From: Ljj <418941372@qq.com> Date: Tue, 3 Jan 2017 11:50:24 +0800 Subject: [PATCH] =?UTF-8?q?1.[bug]=20=E4=BF=AE=E5=A4=8D=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=20max=20=E4=B8=8D=E8=B5=B7=E4=BD=9C=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=202.[bug]=20=E4=BF=AE=E5=A4=8Dgone-?= =?UTF-8?q?>visible=20=E7=BB=98=E5=9B=BE=E4=B8=8D=E5=AF=B9=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bubbleseekbar/src/main/java/com/xw/repo/BubbleSeekBar.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bubbleseekbar/src/main/java/com/xw/repo/BubbleSeekBar.java b/bubbleseekbar/src/main/java/com/xw/repo/BubbleSeekBar.java index 8ef7b70..c434027 100644 --- a/bubbleseekbar/src/main/java/com/xw/repo/BubbleSeekBar.java +++ b/bubbleseekbar/src/main/java/com/xw/repo/BubbleSeekBar.java @@ -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); @@ -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; } } @@ -680,6 +680,7 @@ public int getMax() { public void setMax(int max) { mMax = max; + postInvalidate(); } public int getProgress() {