Skip to content

Commit

Permalink
fix bug #5 Allow users to change the enable state during the dragging…
Browse files Browse the repository at this point in the history
… process
  • Loading branch information
litao0621 committed Sep 18, 2023
1 parent 8d22424 commit f89c67d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions slider/src/main/java/com/litao/slider/BaseSlider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,11 @@ abstract class BaseSlider constructor(context: Context, attrs: AttributeSet? = n

override fun onTouchEvent(event: MotionEvent): Boolean {
if (!enableTouch()) {
//Users may change the enabled state of this Slider during the dragging process
if (isDragging){
isDragging = false
stopTacking(event)
}
return false
}

Expand Down

0 comments on commit f89c67d

Please sign in to comment.