From 98e0fdb814923857144c9cec874e7c62fb4a99d7 Mon Sep 17 00:00:00 2001 From: Yogesh Choudhary Paliyal Date: Wed, 4 Aug 2021 16:00:30 +0530 Subject: [PATCH] Added loadingLayoutCount --- .../universal_adapter/extensions/BindingAdaptersUtils.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/extensions/BindingAdaptersUtils.kt b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/extensions/BindingAdaptersUtils.kt index 37a7355..e10c813 100644 --- a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/extensions/BindingAdaptersUtils.kt +++ b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/extensions/BindingAdaptersUtils.kt @@ -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 RecyclerView.setRecyclerAdapter( lifecycleOwner: LifecycleOwner?, data: Resource>?, @LayoutRes itemLayout: Int?, + loadingLayoutCount: Int?, @LayoutRes loadingLayout: Int?, @LayoutRes errorLayout: Int?, @LayoutRes loadMoreLayout: Int?, @@ -33,11 +34,11 @@ fun 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() } -} \ No newline at end of file +}