Skip to content

Commit

Permalink
Added loadingLayoutCount
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshpaliyal authored Aug 4, 2021
1 parent 21a726c commit 98e0fdb
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ fun RecyclerView.setRecyclerAdapter(adapter: RecyclerView.Adapter<*>) {
}


@BindingAdapter(value = ["lifecycleOwner", "data", "item_layout", "loading_layout", "error_layout", "load_more_layout", "no_data_layout", "item_listener", "error_listener", "no_data_listener"], requireAll = false)
@BindingAdapter(value = ["lifecycleOwner", "data", "item_layout", "loading_layout_count","loading_layout", "error_layout", "load_more_layout", "no_data_layout", "item_listener", "error_listener", "no_data_listener"], requireAll = false)
fun <T> RecyclerView.setRecyclerAdapter(
lifecycleOwner: LifecycleOwner?,
data: Resource<List<T>>?,
@LayoutRes itemLayout: Int?,
loadingLayoutCount: Int?,
@LayoutRes loadingLayout: Int?,
@LayoutRes errorLayout: Int?,
@LayoutRes loadMoreLayout: Int?,
Expand All @@ -33,11 +34,11 @@ fun <T> RecyclerView.setRecyclerAdapter(
val tempAdapter = UniversalRecyclerAdapter.Builder(
lifecycleOwner = lifecycleOwner, data = data,
content = UniversalAdapterViewType.Content(itemLayout, itemListener),
loading = UniversalAdapterViewType.Loading(loadingLayout),
loading = UniversalAdapterViewType.Loading(loadingLayout,loadingLayoutCount),
loadingFooter = UniversalAdapterViewType.LoadingFooter(loadMoreLayout),
error = UniversalAdapterViewType.Error(errorLayout, errorListener),
noData = UniversalAdapterViewType.NoData(noDataLayout, noDataListener)
).build()
adapter = tempAdapter.getAdapter()
}
}
}

0 comments on commit 98e0fdb

Please sign in to comment.