Skip to content

Commit

Permalink
pref: 简化使用文档
Browse files Browse the repository at this point in the history
  • Loading branch information
liangjingkanji committed Aug 4, 2023
1 parent 719a6fc commit 2eee538
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
| <a href="https://liangjingkanji.github.io/document/">贡献代码</a>
| <a href="https://github.com/liangjingkanji/BRV/releases/latest/download/brv-sample.apk">下载体验</a>
<br>
<img src="https://github.com/liangjingkanji/BRV/assets/21078112/1cbd9758-0f69-41e3-b6d9-99a4dfb4f73a" width="350"/>
<img src="https://github.com/liangjingkanji/BRV/blob/master/docs/img/code-preview.png?raw=true" width="350"/>
</p>


Expand All @@ -32,7 +32,7 @@
</p>


<p align="center"><img src="https://github.com/liangjingkanji/BRV/blob/master/docs/image/preview.png?raw=true" align="center" width="30%;" /></p>
<p align="center"><img src="https://github.com/liangjingkanji/BRV/blob/master/docs/img/preview.png?raw=true" align="center" width="30%;" /></p>

本框架在不影响RecyclerView的任何函数组件使用基础上开发. 本项目承诺会永远保持社区维护

Expand Down
Binary file added docs/img/code-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
23 changes: 6 additions & 17 deletions docs/toggle.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BRV提供一个切换事件的触发和监听, 相当于会提供一个回调函数遍历所有的列表条目, 你可以在这个回调里面依次更新数据或者视图.
BRV提供一个在回调函数遍历所有的列表条目的监听事件, 你可以在回调内依次更新数据或者视图

<br>
这个`切换`可以理解为`遍历`列表条目
Expand Down Expand Up @@ -36,20 +36,9 @@ fun onClick(v:View){

## 函数

```kotlin
fun toggle()
// 触发切换模式(根据当前状态取反)

fun getToggleMode(): Boolean
// 范围当前出何种切换模式

fun setToggleMode(toggleMode: Boolean)
// 设置切换模式, 如果设置的是当前正处于的模式不会触发回调

fun onToggle(block: (position: Int, toggleMode: Boolean, end: Boolean) -> Unit)
// 监听切换事件, 在事件中你可以处理任何视图的数据或者视图修改
// position: 遍历过程中的列表条目索引
// toggleMode: 切换模式(布尔值)
// end: 是否全部遍历完成
```
| 函数 | 描述 |
|-|-|
| toggle | 触发切换 |
| toggleMode | 当前切换模式 |
| onToggle | 切换事件回调 |

0 comments on commit 2eee538

Please sign in to comment.