forked from upstream-mirrors/quik
Fix accidental page swipe while moving color thumb, enable pager tabs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user