Skip to content

Commit

Permalink
feat : submitData BindingAdapter 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
2taezeat committed Nov 21, 2023
1 parent 8ed09ef commit 7f27e7e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.ohdodok.catchytape.core.ui

import androidx.databinding.BindingAdapter
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView


@BindingAdapter("submitData")
fun <T, VH : RecyclerView.ViewHolder> RecyclerView.bindItems(items: List<T>) {
val adapter = this.adapter ?: return
val listAdapter: ListAdapter<T, VH> = adapter as ListAdapter<T, VH>
listAdapter.submitList(items)
}

0 comments on commit 7f27e7e

Please sign in to comment.