From 7c25bc360a558964aa7151dc39a8584c94da216d Mon Sep 17 00:00:00 2001 From: Yogesh Paliyal Date: Sun, 2 May 2021 23:02:04 +0530 Subject: [PATCH] major improvements Migrated from recycler adapter to ListAdapter Async DiffUtil Added Signed-off-by: Yogesh Paliyal --- .../ui/activity/BasicListingActivity.kt | 7 +- .../ui/activity/MultiSelectListingActivity.kt | 2 +- .../ui/activity/PaginationListingActivity.kt | 8 +- .../ui/activity/ShimmerListingActivity.kt | 2 +- .../ui/activity/UserListingActivity.kt | 8 +- .../adapter/ContentListAdapter.kt | 91 ++++++++++++ .../universal_adapter/adapter/ErrorAdapter.kt | 78 ++++++++++ .../adapter/LoadingAdapter.kt | 62 ++++++++ .../adapter/UniversalAdapterViewType.kt | 3 +- .../adapter/UniversalBuilderNewExperiment.kt | 137 ++++++++++++++++++ .../adapter/UniversalRecyclerAdapter.kt | 2 +- .../utils/UniversalAdapterBuilder.kt | 4 +- 12 files changed, 385 insertions(+), 19 deletions(-) create mode 100644 universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/ContentListAdapter.kt create mode 100644 universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/ErrorAdapter.kt create mode 100644 universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/LoadingAdapter.kt create mode 100644 universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalBuilderNewExperiment.kt diff --git a/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/BasicListingActivity.kt b/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/BasicListingActivity.kt index aa8ade1..67fe9ec 100644 --- a/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/BasicListingActivity.kt +++ b/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/BasicListingActivity.kt @@ -13,7 +13,6 @@ import com.techpaliyal.androidkotlinmvvm.model.BasicModel import com.techpaliyal.androidkotlinmvvm.ui.view_model.BasicListingActivityViewModel import com.techpaliyal.androidkotlinmvvm.ui.view_model.initViewModel import com.yogeshpaliyal.universal_adapter.BR -import com.yogeshpaliyal.universal_adapter.adapter.SectionUniversalRecyclerAdapterBuilder import com.yogeshpaliyal.universal_adapter.adapter.UniversalAdapterViewType import com.yogeshpaliyal.universal_adapter.utils.Resource import com.yogeshpaliyal.universal_adapter.utils.UniversalAdapterBuilder @@ -55,7 +54,7 @@ class BasicListingActivity : AppCompatActivity() { }) ) - SectionUniversalRecyclerAdapterBuilder(contentOption) + contentOption.build() } override fun onCreate(savedInstanceState: Bundle?) { @@ -63,10 +62,10 @@ class BasicListingActivity : AppCompatActivity() { binding = ActivityListingBinding.inflate(layoutInflater) setContentView(binding.root) - binding.recyclerView.adapter = mAdapter.concatedAdapter + binding.recyclerView.adapter = mAdapter.build() mViewModel.data.observe(this, Observer { - mAdapter.updateContent(Resource.success(it)) + mAdapter.updateData(Resource.success(it)) }) mViewModel.fetchData() diff --git a/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/MultiSelectListingActivity.kt b/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/MultiSelectListingActivity.kt index 5e2e6df..df07677 100644 --- a/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/MultiSelectListingActivity.kt +++ b/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/MultiSelectListingActivity.kt @@ -53,7 +53,7 @@ class MultiSelectListingActivity : AppCompatActivity() { binding = ActivityListingBinding.inflate(layoutInflater) setContentView(binding.root) - binding.recyclerView.adapter = mAdapter + binding.recyclerView.adapter = mAdapter.build() mViewModel.data.observe(this, Observer { mAdapter.updateData(Resource.success(it)) diff --git a/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/PaginationListingActivity.kt b/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/PaginationListingActivity.kt index d04dff2..c246933 100644 --- a/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/PaginationListingActivity.kt +++ b/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/PaginationListingActivity.kt @@ -13,7 +13,7 @@ import com.techpaliyal.androidkotlinmvvm.listeners.BasicListener import com.techpaliyal.androidkotlinmvvm.model.UserModel import com.techpaliyal.androidkotlinmvvm.ui.view_model.LoadingListingViewModel import com.techpaliyal.androidkotlinmvvm.ui.view_model.initViewModel -import com.yogeshpaliyal.universal_adapter.adapter.UniversalRecyclerAdapter +import com.yogeshpaliyal.universal_adapter.utils.UniversalAdapterBuilder class PaginationListingActivity : AppCompatActivity() { lateinit var binding: ActivityListingBinding @@ -32,7 +32,7 @@ class PaginationListingActivity : AppCompatActivity() { } private val mAdapter by lazy { - UniversalRecyclerAdapter( + UniversalAdapterBuilder( R.layout.item_user, resourceLoading = R.layout.item_user_shimmer, defaultLoadingItems = 5, @@ -42,7 +42,7 @@ class PaginationListingActivity : AppCompatActivity() { Toast.makeText(this@PaginationListingActivity, model.name, Toast.LENGTH_SHORT) .show() } - }) + }).build() } override fun onCreate(savedInstanceState: Bundle?) { @@ -50,7 +50,7 @@ class PaginationListingActivity : AppCompatActivity() { binding = ActivityListingBinding.inflate(layoutInflater) setContentView(binding.root) - binding.recyclerView.adapter = mAdapter + binding.recyclerView.adapter = mAdapter.build() binding.recyclerView.setupPagination { if (mViewModel.fetchJob?.isActive == false) diff --git a/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/ShimmerListingActivity.kt b/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/ShimmerListingActivity.kt index d19378a..f64cfdc 100644 --- a/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/ShimmerListingActivity.kt +++ b/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/ShimmerListingActivity.kt @@ -55,7 +55,7 @@ class ShimmerListingActivity : AppCompatActivity() { binding = ActivityListingBinding.inflate(layoutInflater) setContentView(binding.root) - binding.recyclerView.adapter = mAdapter + binding.recyclerView.adapter = mAdapter.build() mViewModel.data.observe(this, Observer { mAdapter.updateData(it) diff --git a/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/UserListingActivity.kt b/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/UserListingActivity.kt index 8c55335..197d6e2 100644 --- a/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/UserListingActivity.kt +++ b/app/src/main/java/com/techpaliyal/androidkotlinmvvm/ui/activity/UserListingActivity.kt @@ -12,8 +12,8 @@ import com.techpaliyal.androidkotlinmvvm.listeners.BasicListener import com.techpaliyal.androidkotlinmvvm.model.UserModel import com.techpaliyal.androidkotlinmvvm.ui.view_model.UserListingActivityViewModel import com.techpaliyal.androidkotlinmvvm.ui.view_model.initViewModel -import com.yogeshpaliyal.universal_adapter.adapter.UniversalRecyclerAdapter import com.yogeshpaliyal.universal_adapter.utils.Resource +import com.yogeshpaliyal.universal_adapter.utils.UniversalAdapterBuilder /** * @author Yogesh Paliyal @@ -34,13 +34,13 @@ class UserListingActivity : AppCompatActivity() { } private val mAdapter by lazy { - UniversalRecyclerAdapter( + UniversalAdapterBuilder( R.layout.item_user, mListener = object : BasicListener { override fun onClick(model: UserModel) { Toast.makeText(this@UserListingActivity, model.name, Toast.LENGTH_SHORT).show() } - }) + }).build() } @@ -49,7 +49,7 @@ class UserListingActivity : AppCompatActivity() { binding = ActivityListingBinding.inflate(layoutInflater) setContentView(binding.root) - binding.recyclerView.adapter = mAdapter + binding.recyclerView.adapter = mAdapter.build() mViewModel.data.observe(this, Observer { mAdapter.updateData(Resource.success(it)) diff --git a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/ContentListAdapter.kt b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/ContentListAdapter.kt new file mode 100644 index 0000000..3209f03 --- /dev/null +++ b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/ContentListAdapter.kt @@ -0,0 +1,91 @@ +package com.yogeshpaliyal.universal_adapter.adapter + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.databinding.DataBindingUtil +import androidx.databinding.ViewDataBinding +import androidx.lifecycle.LifecycleOwner +import androidx.recyclerview.widget.AsyncDifferConfig +import androidx.recyclerview.widget.DiffUtil +import androidx.recyclerview.widget.ListAdapter +import androidx.recyclerview.widget.RecyclerView +import com.yogeshpaliyal.universal_adapter.BR +import com.yogeshpaliyal.universal_adapter.model.BaseDiffUtil + + +/* +* @author Yogesh Paliyal +* techpaliyal@gmail.com +* https://techpaliyal.com +* created on 02-05-2021 19:57 +*/ +class ContentListAdapter( + val lifecycleOwner: LifecycleOwner?, + var resource: Int, + val listener: Any?, + val customBinding: ((itemBinding: ViewDataBinding, item: T, bindingAdapterPosition: Int) -> Unit)? +) : + ListAdapter.ViewHolder>(AsyncDifferConfig.Builder(object : + DiffUtil.ItemCallback() { + override fun areItemsTheSame(oldItem: T, newItem: T): Boolean { + return if (oldItem is BaseDiffUtil && newItem is BaseDiffUtil) { + oldItem.getDiffId() == newItem.getDiffId() + } else { + oldItem.hashCode() == newItem.hashCode() + } + } + + override fun areContentsTheSame(oldItem: T, newItem: T): Boolean { + return if (oldItem is BaseDiffUtil && newItem is BaseDiffUtil) { + oldItem.getDiffBody() == newItem.getDiffBody() + } else { + oldItem.hashCode() == newItem.hashCode() + } + } + + }).build()) { + + + inner class ViewHolder(val binding: ViewDataBinding) : RecyclerView.ViewHolder(binding.root) { + fun bind(model: T) { + binding.lifecycleOwner = lifecycleOwner + + if (customBinding == null) { + binding.setVariable(BR.model, model) + binding.setVariable(BR.listener, listener) + binding.executePendingBindings() + } else { + + customBinding.invoke( + binding, + model, + bindingAdapterPosition + ) + } + + } + } + + override fun submitList(list: List?) { + super.submitList(list?.let { ArrayList(it) }) + } + + override fun getItemViewType(position: Int): Int { + return resource + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + val binding = DataBindingUtil.inflate( + LayoutInflater.from(parent.context), + resource, + parent, + false + ) + return ViewHolder(binding) + } + + override fun onBindViewHolder(holder: ViewHolder, position: Int) { + holder.bind(getItem(position)) + } + +} \ No newline at end of file diff --git a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/ErrorAdapter.kt b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/ErrorAdapter.kt new file mode 100644 index 0000000..6ec8265 --- /dev/null +++ b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/ErrorAdapter.kt @@ -0,0 +1,78 @@ +package com.yogeshpaliyal.universal_adapter.adapter + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.databinding.DataBindingUtil +import androidx.databinding.ViewDataBinding +import androidx.lifecycle.LifecycleOwner +import androidx.recyclerview.widget.AsyncDifferConfig +import androidx.recyclerview.widget.DiffUtil +import androidx.recyclerview.widget.ListAdapter +import androidx.recyclerview.widget.RecyclerView +import com.yogeshpaliyal.universal_adapter.BR + + +/* +* @author Yogesh Paliyal +* techpaliyal@gmail.com +* https://techpaliyal.com +* created on 02-05-2021 19:57 +*/ +class ErrorAdapter( + val lifecycleOwner: LifecycleOwner?, + var resource: Int, + var message: String = "", + val listener: Any?, + val customBinding: ((itemBinding: ViewDataBinding, message: String?) -> Unit)? +) : + ListAdapter.ViewHolder>(AsyncDifferConfig.Builder(object : + DiffUtil.ItemCallback() { + override fun areItemsTheSame(oldItem: T, newItem: T): Boolean { + return false + } + + override fun areContentsTheSame(oldItem: T, newItem: T): Boolean { + return false + } + + }).build()) { + + override fun getItemViewType(position: Int): Int { + return resource + } + + inner class ViewHolder(val binding: ViewDataBinding) : RecyclerView.ViewHolder(binding.root) { + fun bind() { + binding.lifecycleOwner = lifecycleOwner + + if (customBinding == null) { + binding.setVariable(BR.message, message) + binding.setVariable(BR.listener, listener) + binding.executePendingBindings() + } else { + + customBinding.invoke( + binding, + message + ) + } + + } + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + val binding = DataBindingUtil.inflate( + LayoutInflater.from(parent.context), + resource, + parent, + false + ) + return ViewHolder(binding) + } + + override fun onBindViewHolder(holder: ViewHolder, position: Int) { + holder.bind() + } + + override fun getItemCount(): Int = 1 +} \ No newline at end of file diff --git a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/LoadingAdapter.kt b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/LoadingAdapter.kt new file mode 100644 index 0000000..878ba58 --- /dev/null +++ b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/LoadingAdapter.kt @@ -0,0 +1,62 @@ +package com.yogeshpaliyal.universal_adapter.adapter + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.databinding.DataBindingUtil +import androidx.databinding.ViewDataBinding +import androidx.lifecycle.LifecycleOwner +import androidx.recyclerview.widget.AsyncDifferConfig +import androidx.recyclerview.widget.DiffUtil +import androidx.recyclerview.widget.ListAdapter +import androidx.recyclerview.widget.RecyclerView + + +/* +* @author Yogesh Paliyal +* techpaliyal@gmail.com +* https://techpaliyal.com +* created on 02-05-2021 19:57 +*/ +class LoadingAdapter( + val lifecycleOwner: LifecycleOwner?, + var resource: Int, val count: Int +) : + ListAdapter.ViewHolder>(AsyncDifferConfig.Builder(object : + DiffUtil.ItemCallback() { + override fun areItemsTheSame(oldItem: T, newItem: T): Boolean { + return false + } + + override fun areContentsTheSame(oldItem: T, newItem: T): Boolean { + return false + } + + }).build()) { + + + inner class ViewHolder(val binding: ViewDataBinding) : RecyclerView.ViewHolder(binding.root) { + fun bind() { + binding.lifecycleOwner = lifecycleOwner + } + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + val binding = DataBindingUtil.inflate( + LayoutInflater.from(parent.context), + resource, + parent, + false + ) + return ViewHolder(binding) + } + + override fun getItemViewType(position: Int): Int { + return resource + } + + override fun onBindViewHolder(holder: ViewHolder, position: Int) { + holder.bind() + } + + override fun getItemCount(): Int = count +} \ No newline at end of file diff --git a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalAdapterViewType.kt b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalAdapterViewType.kt index 4c1b5ea..d37c9ec 100644 --- a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalAdapterViewType.kt +++ b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalAdapterViewType.kt @@ -2,7 +2,6 @@ package com.yogeshpaliyal.universal_adapter.adapter import androidx.annotation.LayoutRes import androidx.databinding.ViewDataBinding -import com.yogeshpaliyal.universal_adapter.utils.Resource /* @@ -52,6 +51,6 @@ sealed class UniversalAdapterViewType { ) val errorListener: Any? = null, val listener: Any? = null, - val customBindingMapping: ((itemBinding: ViewDataBinding, item: Resource?>?) -> Unit)? = null + val customBindingMapping: ((itemBinding: ViewDataBinding, message: String?) -> Unit)? = null ) } diff --git a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalBuilderNewExperiment.kt b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalBuilderNewExperiment.kt new file mode 100644 index 0000000..bf93acc --- /dev/null +++ b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalBuilderNewExperiment.kt @@ -0,0 +1,137 @@ +package com.yogeshpaliyal.universal_adapter.adapter + +import androidx.recyclerview.widget.ConcatAdapter +import com.yogeshpaliyal.universal_adapter.utils.Resource +import com.yogeshpaliyal.universal_adapter.utils.Status +import com.yogeshpaliyal.universal_adapter.utils.UniversalAdapterBuilder + + +/* +* @author Yogesh Paliyal +* techpaliyal@gmail.com +* https://techpaliyal.com +* created on 08-01-2021 19:47 +*/ + +class UniversalBuilderNewExperiment(val adapterBuilder: UniversalAdapterBuilder) { + + // content type + // loading type + // content + loading type + // error layout + // content + error layout + + private val mainAdapter: ConcatAdapter = ConcatAdapter() + + private var contentAdapter: ContentListAdapter? = null + private var loadingAdapter: LoadingAdapter? = null + private var loadMoreAdapter: LoadingAdapter? = null + private var errorAdapter: ErrorAdapter? = null + + init { + if (adapterBuilder.content?.resource != null) + contentAdapter = ContentListAdapter( + adapterBuilder.lifecycleOwner, + adapterBuilder.content.resource, + adapterBuilder.content.listener, + adapterBuilder.content.customBindingMapping + ) + + if (adapterBuilder.loading?.resourceLoading != null) + loadingAdapter = LoadingAdapter( + adapterBuilder.lifecycleOwner, + adapterBuilder.loading.resourceLoading, adapterBuilder.loading.defaultLoadingItems + ) + + if (adapterBuilder.loadingFooter?.loaderFooter != null) + loadMoreAdapter = LoadingAdapter( + adapterBuilder.lifecycleOwner, + adapterBuilder.loadingFooter.loaderFooter, 1 + ) + + if (adapterBuilder.error?.errorLayout != null) + errorAdapter = ErrorAdapter( + adapterBuilder.lifecycleOwner, + adapterBuilder.error.errorLayout, + listener = adapterBuilder.error.listener, + customBinding = adapterBuilder.error.customBindingMapping + ) + } + + fun updateData(data: Resource>) { + setupAdapters(data) + } + + fun build() = mainAdapter + + private fun setupAdapters(data: Resource>) { + when (data.status) { + Status.LOADING -> { + // if has data then data + loading else loading + if (data.data.isNullOrEmpty()) { + // add only loading state + contentAdapter?.let { mainAdapter.removeAdapter(it) } + loadMoreAdapter?.let { mainAdapter.removeAdapter(it) } + errorAdapter?.let { mainAdapter.removeAdapter(it) } + if (isContains(loadingAdapter).not()) + loadingAdapter?.let { mainAdapter.addAdapter(it) } + } else { + loadingAdapter?.let { mainAdapter.removeAdapter(it) } + errorAdapter?.let { mainAdapter.removeAdapter(it) } + if (isContains(contentAdapter).not()) + contentAdapter?.let { mainAdapter.addAdapter(it) } + contentAdapter?.submitList(data.data) + if (isContains(loadMoreAdapter).not()) + loadMoreAdapter?.let { mainAdapter.addAdapter(it) } + } + + } + Status.SUCCESS -> { + loadingAdapter?.let { mainAdapter.removeAdapter(it) } + loadMoreAdapter?.let { mainAdapter.removeAdapter(it) } + errorAdapter?.let { mainAdapter.removeAdapter(it) } + + if (isContains(contentAdapter).not()) + contentAdapter?.let { mainAdapter.addAdapter(it) } + contentAdapter?.submitList(data.data) + } + Status.ERROR -> { + // if has data then data + error else error + loadMoreAdapter?.let { mainAdapter.removeAdapter(it) } + errorAdapter?.let { mainAdapter.removeAdapter(it) } + if (data.data.isNullOrEmpty()) { + + contentAdapter?.let { mainAdapter.removeAdapter(it) } + // add only loading state + + if (isContains(errorAdapter).not()) + errorAdapter?.let { mainAdapter.addAdapter(it) } + } else { + + if (isContains(contentAdapter).not()) + contentAdapter?.let { mainAdapter.addAdapter(it) } + contentAdapter?.submitList(data.data) + if (isContains(errorAdapter).not()) + errorAdapter?.let { mainAdapter.addAdapter(it) } + } + } + } + } + + + fun isContains(adapterToCheck: Any?): Boolean { + for (adapter in mainAdapter.adapters) { + if (adapter == adapterToCheck) { + return true + } + } + return false + } + + fun clearMainAdapter() { + for (adapter in mainAdapter.adapters) { + mainAdapter.removeAdapter(adapter) + } + } + +} \ No newline at end of file diff --git a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalRecyclerAdapter.kt b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalRecyclerAdapter.kt index 37a5ea7..46ec859 100644 --- a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalRecyclerAdapter.kt +++ b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/adapter/UniversalRecyclerAdapter.kt @@ -229,7 +229,7 @@ class UniversalRecyclerAdapter constructor(val adapterOptions: UniversalAdapt binding.executePendingBindings() } else { - error.customBindingMapping.invoke(binding, adapterOptions.data) + error.customBindingMapping.invoke(binding, adapterOptions.data?.message) } } diff --git a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/utils/UniversalAdapterBuilder.kt b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/utils/UniversalAdapterBuilder.kt index e74ce7f..5815b9c 100644 --- a/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/utils/UniversalAdapterBuilder.kt +++ b/universal_adapter/src/main/java/com/yogeshpaliyal/universal_adapter/utils/UniversalAdapterBuilder.kt @@ -3,7 +3,7 @@ package com.yogeshpaliyal.universal_adapter.utils import androidx.annotation.LayoutRes import androidx.lifecycle.LifecycleOwner import com.yogeshpaliyal.universal_adapter.adapter.UniversalAdapterViewType -import com.yogeshpaliyal.universal_adapter.adapter.UniversalRecyclerAdapter +import com.yogeshpaliyal.universal_adapter.adapter.UniversalBuilderNewExperiment /* @@ -48,6 +48,6 @@ open class UniversalAdapterBuilder constructor( UniversalAdapterViewType.Error(errorLayout, errorListener) ) - fun build() = UniversalRecyclerAdapter(this) + fun build() = UniversalBuilderNewExperiment(this) }