Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Revert changes in #90
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Apr 30, 2022
1 parent 175d4c1 commit 4e21fce
Show file tree
Hide file tree
Showing 8 changed files with 508 additions and 656 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.annotation.IntRange
import androidx.annotation.LayoutRes
import androidx.databinding.BindingAdapter
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.recyclerview.widget.RecyclerView
Expand Down Expand Up @@ -66,3 +67,15 @@ internal interface IMutableRvAdapter<M : IVhModelType> : IRvAdapter<M> {

fun removeItem(item: M)
}

@BindingAdapter(value = ["binding_rv_dataList"], requireAll = true)
fun <M : IVhModelType> RecyclerView.setList(list: List<M>?) {
@Suppress("UNCHECKED_CAST")
(adapter as? IMutableRvAdapter<M>)?.list = list.orEmpty()
}

@BindingAdapter(value = ["binding_rv_refreshItems"], requireAll = true)
fun <M : IVhModelType> RecyclerView.refreshItems(items: List<M>?) {
@Suppress("UNCHECKED_CAST")
(adapter as? IMutableRvAdapter<M>)?.refreshItems(items.orEmpty())
}

This file was deleted.

Loading

0 comments on commit 4e21fce

Please sign in to comment.