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 -> {
|
MotionEvent.ACTION_DOWN -> {
|
||||||
swatchX = event.x - event.rawX
|
swatchX = event.x - event.rawX
|
||||||
swatchY = event.y - event.rawY
|
swatchY = event.y - event.rawY
|
||||||
|
parent.requestDisallowInterceptTouchEvent(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
MotionEvent.ACTION_MOVE -> {
|
MotionEvent.ACTION_MOVE -> {
|
||||||
@@ -69,6 +70,10 @@ class HSVPickerView @JvmOverloads constructor(context: Context, attrs: Attribute
|
|||||||
swatch.setTint(Color.HSVToColor(hsv))
|
swatch.setTint(Color.HSVToColor(hsv))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MotionEvent.ACTION_UP -> {
|
||||||
|
parent.requestDisallowInterceptTouchEvent(false)
|
||||||
|
}
|
||||||
|
|
||||||
else -> return@setOnTouchListener false
|
else -> return@setOnTouchListener false
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
@@ -81,6 +86,7 @@ class HSVPickerView @JvmOverloads constructor(context: Context, attrs: Attribute
|
|||||||
when (event.action) {
|
when (event.action) {
|
||||||
MotionEvent.ACTION_DOWN -> {
|
MotionEvent.ACTION_DOWN -> {
|
||||||
hueThumbX = event.x - event.rawX
|
hueThumbX = event.x - event.rawX
|
||||||
|
parent.requestDisallowInterceptTouchEvent(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
MotionEvent.ACTION_MOVE -> {
|
MotionEvent.ACTION_MOVE -> {
|
||||||
@@ -94,6 +100,10 @@ class HSVPickerView @JvmOverloads constructor(context: Context, attrs: Attribute
|
|||||||
swatch.setTint(Color.HSVToColor(hsv))
|
swatch.setTint(Color.HSVToColor(hsv))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MotionEvent.ACTION_UP -> {
|
||||||
|
parent.requestDisallowInterceptTouchEvent(false)
|
||||||
|
}
|
||||||
|
|
||||||
else -> return@setOnTouchListener false
|
else -> return@setOnTouchListener false
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
|||||||
@@ -30,8 +30,7 @@
|
|||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp" />
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
Reference in New Issue
Block a user