skydoves / ColorPickerView

🎨 Android colorpicker for getting colors from any images by tapping on the desired color.
Apache License 2.0
1.58k stars 212 forks source link

Incorrect touch event in NestScrollView #85

Open DanteAndroid opened 2 years ago

DanteAndroid commented 2 years ago

Hi, I have a ColorPickerView and a BrightnessSlideBar inside a NestedScrollView, but when I touch it/them, the event cannot handled properly by them, instead handled by NestedScrollView. Please tell me how to fix it.

marwia commented 9 months ago

Hi! I have solved by requesting for disallow intercepting touch events when user touches the ColorPickerView/BrightnessSlideBar. Here is code:

binding.colorPickerView.setOnTouchListener { view, motionEvent ->
            val disallow = motionEvent.actionMasked == MotionEvent.ACTION_DOWN
                    || motionEvent.actionMasked == MotionEvent.ACTION_MOVE
            binding.colorPickerView.requestDisallowInterceptTouchEvent(disallow)
            false
}
alizahid1996 commented 9 months ago

Yes It resolved my issue @marwia