AAkira / ExpandableLayout

[Deprecated] An android library that brings the expandable layout with various animation. You can include optional contents and use everywhere.
Apache License 2.0
1.65k stars 322 forks source link

Problem with allowing nested scrolling inside expandable layout #37

Open milos1991 opened 8 years ago

milos1991 commented 8 years ago

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 :)

yosrah commented 8 years ago

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; } });

AAkira commented 8 years ago

@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.

milos1991 commented 8 years ago

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.

yosrah commented 8 years ago

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

milos1991 commented 8 years ago

Yes, it was fixed.

yosrah commented 8 years ago

@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.

milos1991 commented 8 years ago

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. :)

AAkira commented 8 years ago

:+1:

XavisaurusRex commented 6 years ago

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