hegaojian / MvvmHelper

:chicken::basketball:这是一个快速开发的框架,Kotlin语言开发,MVVM+Jetpack架构,封装了公共头部、界面状态管理、ViewModel、LiveData、DataBinding、ViewBinding头部刷新、加载更多、沉浸式、全局通知、丰富好用的拓展函数、RxHttp网络请求等等一系列工具
Apache License 2.0
417 stars 60 forks source link

RecyclerView万能分割线问题 #14

Closed JIanyag closed 2 years ago

JIanyag commented 3 years ago

grid(12) divider { setColor(getColorExt(R.color.colorWhite)) setDivider(10,true) orientation = DividerOrientation.GRID } adapter = mainIndexAdapter 如果BaseRecyclerViewAdapter 是多布局的话,会报数组越界。不支持多布局的Rv吗?

bingdu0 commented 3 years ago

grid(12) divider { setColor(getColorExt(R.color.colorWhite)) setDivider(10,true) orientation = DividerOrientation.GRID } adapter = mainIndexAdapter 如果BaseRecyclerViewAdapter 是多布局的话,会报数组越界。不支持多布局的Rv吗?

这个类的DefaultDecoration 这个方法中 computeEdge ->is GridLayoutManager 改成

if (layoutManager.orientation == RecyclerView.VERTICAL) { left = spanIndex == 1 right = spanIndex + spanSize - 1 == spanCount top = index <= spanCount && spanGroupIndex == spanSizeLookup.getSpanGroupIndex(position , spanCount) bottom = spanGroupIndex == maxSpanGroupIndex - 1 }

但是横向的有问题 ,横向的最左边和最右边都为0.