Fix accidental page swipe while moving color thumb, enable pager tabs

This commit is contained in:
Moez Bhatti
2018-03-26 01:16:29 -04:00
parent 4ba0eeced0
commit bdda585dde
2 changed files with 11 additions and 2 deletions
@@ -57,6 +57,7 @@ class HSVPickerView @JvmOverloads constructor(context: Context, attrs: Attribute
MotionEvent.ACTION_DOWN -> {
swatchX = event.x - event.rawX
swatchY = event.y - event.rawY
parent.requestDisallowInterceptTouchEvent(true)
}
MotionEvent.ACTION_MOVE -> {
@@ -69,6 +70,10 @@ class HSVPickerView @JvmOverloads constructor(context: Context, attrs: Attribute
swatch.setTint(Color.HSVToColor(hsv))
}
MotionEvent.ACTION_UP -> {
parent.requestDisallowInterceptTouchEvent(false)
}
else -> return@setOnTouchListener false
}
true
@@ -81,6 +86,7 @@ class HSVPickerView @JvmOverloads constructor(context: Context, attrs: Attribute
when (event.action) {
MotionEvent.ACTION_DOWN -> {
hueThumbX = event.x - event.rawX
parent.requestDisallowInterceptTouchEvent(true)
}
MotionEvent.ACTION_MOVE -> {
@@ -94,6 +100,10 @@ class HSVPickerView @JvmOverloads constructor(context: Context, attrs: Attribute
swatch.setTint(Color.HSVToColor(hsv))
}
MotionEvent.ACTION_UP -> {
parent.requestDisallowInterceptTouchEvent(false)
}
else -> return@setOnTouchListener false
}
true