Skip to content

Commit

Permalink
Merge pull request hackware1993#132 from otwayz/bugfix-scale-navigato…
Browse files Browse the repository at this point in the history
…r-measure

Fix the measure bug
  • Loading branch information
hackware1993 authored Oct 7, 2018
2 parents 4a380d9 + a31b0f3 commit ec20414
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ private int measureWidth(int widthMeasureSpec) {
break;
case MeasureSpec.AT_MOST:
case MeasureSpec.UNSPECIFIED:
result = (mCircleCount - 1) * mMinRadius * 2 + mMaxRadius * 2 + (mCircleCount - 1) * mCircleSpacing + getPaddingLeft() + getPaddingRight();
if (mCircleCount <= 0) {
result = getPaddingLeft() + getPaddingRight();
} else {
result = (mCircleCount - 1) * mMinRadius * 2 + mMaxRadius * 2 + (mCircleCount - 1) * mCircleSpacing + getPaddingLeft() + getPaddingRight();
}
break;
default:
break;
Expand Down Expand Up @@ -209,7 +213,7 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
@Override
public void notifyDataSetChanged() {
prepareCirclePoints();
invalidate();
requestLayout();
}

@Override
Expand Down

0 comments on commit ec20414

Please sign in to comment.