ZieIony / Carbon

Material Design implementation for Android 4.0+. Shadows, ripples, vectors, fonts, animations, widgets, rounded corners and more.

Home Page:https://androidreclib.wordpress.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Port nestedScrollingEnabled to 4.x

opened this issue · comments

Many time, we need nest layout a recyclerview in parent recyclerview or nestedscrollview, this will cause scoll conflict. Up to android 5.0, the problem can be solved by use nestedScrollingEnabled=false. But 4.x can not do this, the gesture seems to not sensitive because the child recyclerview is scolling at the same time. I have a idea to port it to carbon. If not, can you give me some suggestion about solve this problem?

NestedScrollView is quite new, so I'm surprised that it doesn't work with 4.x. I would need to take a look at the implementation and if it's possible, then sure - I could backport it. This question seems to be related: https://stackoverflow.com/questions/43287798/api-19-scrollview-no-momentum

Usually instead of nested scroll containers I just use a RecyclerView with multiple item/row classes. I'm not sure if that would work for you.

Yes, multiple item type can solve simple problems. But always we will facing complex data model which has many levels of lists. May be three or four levels, the ui may be recyclerview nest recyclerview, child recylcerveiw nest grandson recyclerview.

Did you try androidx NestedScrollView? It has setNestedScrollingEnabled() and promises to work on older APIs as well.

Finally I use ViewCompat.setNestedScollEnable on RecyclerView to solve this problem.