android-sliding-layer-lib
android-sliding-layer-lib copied to clipboard
How to handle content too long to fit in SlidingLayer without disabling tap-to-close?
My initial reaction when I noticed that some content was too long to fit in the SlidingLayer was to wrap it in a ScrollView, but I've noticed that this disables the ability to use closeOnTap since the ScrollView would intercept the touch event.
I took a look at https://github.com/6wunderkinder/android-sliding-layer-lib/issues/10 but it seems that the issue is a bit different from mine.
Is there some easy way to get SlidingLayer's closeOnTap to play nicely with a ScrollView or will I have to make a custom handler? For reference purposes, I have my SlidingLayer anchored to the bottom.
The SlidingLayer could interceptTheEvent since it's the parent of that content, but with that approach your buttons and elements inside wouldn't work. With the current approach, the layer would interpret the onCloseOnTap just when the event is not used by its children, which is what I'd expect. For instance, if you click on the empty parts of your scroll view, it should still trigger it. Nonetheless it shouldn't be too difficult to make a custom implementation of the ScrollView to decide when to catch the event or when to leave it pass through. On Wunderlist, we use a ListView, since we have similar elements of some types and it works as expected for clickable/touchable elements and empty spaces.
Yeah I just decided to do my best to have the content fit in the view properly... Maybe if I need this I'll come back to it