microsoftarchive / android-sliding-layer-lib

Highly customizable SlidingLayer as you have seen in Wunderlist
http://wunderlist.com
Apache License 2.0
932 stars 279 forks source link

VerticalScrollview inside slidinglayer vertical right. On Scroll closes the slidinglayer. #107

Open mr-kamran-ali opened 6 years ago

mr-kamran-ali commented 6 years ago

When Scrollview is touched to scoll items up or down, sometimes if motion is not strictly veritcal (maybe slightly tilting to left or right) it closes the slidinglayer. I dont want this.

Any listener to give all touch events to scrollview and not to slidinglayer?

Akhilez commented 6 years ago

Damn. Same problem here. One workaround I found was disallowing touch interception of sliding layer on scrollview touch event.

scrollView.setOnTouchListener { view, motionEvent -> if (motionEvent.action == MotionEvent.ACTION_DOWN) sliding_layer.requestDisallowInterceptTouchEvent(true) false } But doing so will restrict us from closing the sliding layer with touch, I close the sliding layer in the overridden onBackPressed

override fun onBackPressed() { when { sliding_layer.isOpened -> sliding_layer.closeLayer(true) else -> super.onBackPressed() } }

I know this is bad. Please provide feedback when some solution is found.