diff --git a/README.md b/README.md index 31354129..7f03247d 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@

- + diff --git a/docs/divider-customize.md b/docs/divider-customize.md index 5110a81f..f1adcea0 100644 --- a/docs/divider-customize.md +++ b/docs/divider-customize.md @@ -1,5 +1,5 @@ -1. 扩展函数`divider`为简化创建`DefaultDecoration` -2. 如`DefaultDecoration`不满足需求可以继承`RecyclerView.ItemDecoration`实现 +!!! note "列表间隔" + 有时在布局中使用`layout_margin_bottom`等属性更简单 ## 组合间距 @@ -22,6 +22,8 @@ binding.rv.grid(3).divider { // 水平间距 ## 方法 +函数`divider`简化创建`DefaultDecoration`, 其实现接口`ItemDecoration` + | 函数 | 描述 | |-|-| | onEnabled | 根据回调返回值是否绘制分隔线 | @@ -44,4 +46,21 @@ data class Edge( ) ``` -`left`为true表示指定position位于列表左侧, `top`为true表示位于列表顶部, 类推 \ No newline at end of file +`left`为true表示指定position位于列表左侧, `top`为true表示位于列表顶部, 类推 + +## 超复杂分隔物 +超复杂分隔物建议在列表布局中绘制, 可根据`Edge.computeEdge()`禁止绘制四周 + +```kotlin hl_lines="5" +binding.rv.linear().divider(R.drawable.divider_horizontal).setup { + addType(R.layout.item_divider_vertical) + onBind { + layoutManager = binding.rv.layoutManager!! + val edge = DefaultDecoration.Edge.computeEdge(layoutPosition, layoutManager, false) + if (edge.bottom) { + // 列表结尾不绘制分隔物 + return@onBind + } + } +}.models = getData() +``` \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 6bbfd3c4..043939ac 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,4 @@ - -本框架在不影响RecyclerView的任何函数组件使用基础上开发, 本项目将一直保持社区维护 +BRV为快速构建RV列表工具, 以开源分享来完善, 将一直保持社区维护

STAR/分享可以让更多人参与到本开源项目