I have a NestedScrollView
within a CoordinatorLayout
. Within the NestedScrollView
I have a LinearLayout
with a few components, some of which are buttons. There are no customizations to the components, I only have the standard layout parameters.
The problem I'm facing is that whenever I fling the NestedScrollView
to the top or to the bottom and see the overscroll edges, all buttons on the view do not handle any touch the first time they're pressed. A second touch is required and from then on any button will respond the first time. It's as if the focus gets lost and the first touch is to get it back to the view and the second one is the one that's really handled.
I've tried:
Setting focusable=true
, focusableInTouchMode=true
and descendantFocusability=afterDescendants
. Doesn't work.
Overriding NestedScrollView
's onScrollChanged
to detect when we reach the top/bottom and manually request the focus for the closest view. Doesn't work, strange things happen, such as a view on the Toolbar getting focused...
Simulating a touch event on the LinearLayout
via dispatchTouchEvent()
.
None of them have worked. Many thanks in advance if you can help me see the light!
EDIT: seems to be related to this.
Apparently this is a bug: https://code.google.com/p/android/issues/detail?id=178041
As of today, it's not fixed in the support library v23.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With