material-range-bar
material-range-bar copied to clipboard
Seekbar mode => thumb not moving when user touching the x axis(value)
If u will disable RangeBar Mode isRangeBar = false
Visible thumb on seekbar moving only when u do something like drag and drog.. It should also moving like in RangeBar Mode ( click on the axis x Value and thumb moving to this value).
FAST SOLUTION:
private void onActionMove(float x) {
// Move the pressed thumb to the new x-position.
if (mIsRangeBar && mLeftThumb.isPressed()) {
movePin(mLeftThumb, x);
} else if (mRightThumb.isPressed()) {
movePin(mRightThumb, x);
** add This condition to onActionMove**
} else if ( mIsRangeBar == false){
movePin(mRightThumb, x);
}
That; and also, in the onActionUp: Add this:
if (leftThumbXDistance < rightThumbXDistance) { Log.i(TAG, "onActionUp:if:1");
if (mIsRangeBar)
{
Log.i(TAG, "onActionUp:if:2A");
mLeftThumb.setX(x);
releasePin(mLeftThumb);
}else {
//Added this else statement
Log.i(TAG, "onActionUp:if:2B");
mRightThumb.setX(x);
releasePin(mRightThumb);
}
} else {
Log.i(TAG, "onActionUp:if:3");
mRightThumb.setX(x);
releasePin(mRightThumb);
}
This will allow the pin the move to the closest point when you click the seekBar in cases when mIsRangeBar = false