Open kuoliangkwong opened 7 years ago
@kuoliangkwong make a minor change like below inside RangeSlider.java class @Override protected void onDraw(Canvas canvas) { final int width = getMeasuredWidth(); final int height = getMeasuredHeight();
final int lThumbWidth = mLeftThumb.getMeasuredWidth();
final float lThumbOffset = mLeftThumb.getX();
final float rThumbOffset = mRightThumb.getX();
final float lineTop = mLineSize;
final float lineBottom = height - mLineSize;
// top line
canvas.drawRect(lThumbWidth + lThumbOffset,
0,
rThumbOffset,
lineTop, mLinePaint);
// bottom line
canvas.drawRect(lThumbWidth + lThumbOffset,
lineBottom,
rThumbOffset,
height, mLinePaint);
// if (lThumbOffset > mThumbWidth) {
canvas.drawRect(0, 0, lThumbOffset + mThumbWidth, height, mBgPaint);
// }
if (rThumbOffset < width - mThumbWidth) {
canvas.drawRect(rThumbOffset, 0, width, height, mBgPaint);
}
}
hi I put a background image under the slider and notice highlighted background has an empty space. Could u help fix it?