NestedRecyclerView
NestedRecyclerView copied to clipboard
外层再嵌套一层CoordinatorLayout,实现收缩布局,子RecyclerView的fling完成后就会直接导致收缩布局展开,有解决方案吗?我试了几种方式都没法完全解决问题
禁用掉ChildRecyclerView的startNestedScroll(int axes, int type)就可以了,之前想得复杂了还改了好久,直接在type=TYPE_NON_TOUCH的时候,也就是fling状态中的就直接返回false
override fun startNestedScroll(axes: Int, type: Int): Boolean { if (type == ViewCompat.TYPE_NON_TOUCH) { return false } return super.startNestedScroll(axes, type) }