VideoRangeSlider icon indicating copy to clipboard operation
VideoRangeSlider copied to clipboard

An empty space at left highlighted background

Open kuoliangkwong opened this issue 8 years ago • 1 comments

hi I put a background image under the slider and notice highlighted background has an empty space. Could u help fix it? device-2017-07-05-182916

kuoliangkwong avatar Jul 05 '17 10:07 kuoliangkwong

@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);
    }
}

Parasghasadiya avatar Jun 28 '18 11:06 Parasghasadiya