Skip to content

Commit

Permalink
refactor: 规范命名
Browse files Browse the repository at this point in the history
  • Loading branch information
liangjingkanji committed Sep 8, 2022
1 parent 831cc39 commit ec2534c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions brv/src/main/java/com/drake/brv/BindingAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ open class BindingAdapter : RecyclerView.Adapter<BindingAdapter.BindingViewHolde
private var onClick: (BindingViewHolder.(viewId: Int) -> Unit)? = null
private var onLongClick: (BindingViewHolder.(viewId: Int) -> Unit)? = null
private var onChecked: ((position: Int, checked: Boolean, allChecked: Boolean) -> Unit)? = null
private var onToggle: ((position: Int, toggleModel: Boolean, end: Boolean) -> Unit)? = null
private var onToggle: ((position: Int, toggleMode: Boolean, end: Boolean) -> Unit)? = null


/**
Expand Down Expand Up @@ -852,7 +852,7 @@ open class BindingAdapter : RecyclerView.Adapter<BindingAdapter.BindingViewHolde
* @param toggleMode 切换模式
* @param end 全部条目已经切换完成
*/
fun onToggle(block: (position: Int, toggleModel: Boolean, end: Boolean) -> Unit) {
fun onToggle(block: (position: Int, toggleMode: Boolean, end: Boolean) -> Unit) {
onToggle = block
}
//</editor-fold>
Expand Down
4 changes: 2 additions & 2 deletions docs/toggle.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ fun getToggleMode(): Boolean
fun setToggleMode(toggleMode: Boolean)
// 设置切换模式, 如果设置的是当前正处于的模式不会触发回调

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

0 comments on commit ec2534c

Please sign in to comment.