ExpandableLayout icon indicating copy to clipboard operation
ExpandableLayout copied to clipboard

Problem with allowing nested scrolling inside expandable layout

Open milos1991 opened this issue 9 years ago • 9 comments

I made the following hierarchy - RecyclerView with ExpandableLayout that has RecyclerView in itself and i just cant find a way to allow scrolling inside that nested recycler view, i tried with setNestedScrollingEnabled(true) but it won't help, can you help me with this if it is even possible to implement in this way? Thank you in advance :)

milos1991 avatar Dec 28 '15 14:12 milos1991

Just intercept the touch event in the nested recycler view and everything should work. Just implemented it with this library and is working smoothly.

holder.childRecyclerView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { // disallow the onTouch for your scrollable parent view v.getParent().requestDisallowInterceptTouchEvent(true); return false; } });

yosrah avatar Dec 30 '15 11:12 yosrah

@yosrah Thanks! :+1:

@milos1991 Do you solve this issue?


I don't recommend the ExpandableLayout has complicated children. Maybe you should set a fixed height to children if you use the RecyclerView in ExpandableLayout.

AAkira avatar Jan 05 '16 13:01 AAkira

Thanks for the reply, both of you. I've tried with requestDissalow method wont allow scrolling. It intercepts scrolling on parent rv, however child rv is still not able to scroll. Funny thing is - when using ScrollView and requestDissalow, it works perfectly.

milos1991 avatar Jan 05 '16 13:01 milos1991

@milos1991 Did you set a fixed height for the nested recycler view ?

yosrah avatar Jan 05 '16 13:01 yosrah

Yes, it was fixed.

milos1991 avatar Jan 05 '16 13:01 milos1991

@milos1991 I haven't done anything extra than that and it's working fine . Maybe if you can post some code then we could identify where the problem is.

yosrah avatar Jan 05 '16 13:01 yosrah

Then its definitely problem in my code, i will double check my code then and if i don't fix it, i will post it here. Thank you very much for helping. :)

milos1991 avatar Jan 05 '16 14:01 milos1991

:+1:

AAkira avatar Jan 05 '16 14:01 AAkira

Thank you yosrah, really you helped me a lot!.

XavisaurusRex avatar May 25 '18 10:05 XavisaurusRex