Android-Pagination-with-RecyclerView
Android-Pagination-with-RecyclerView copied to clipboard
Issue when remove Loading would remove a list item
I had issue when remove Loading would remove a list item at index 0, my fix was to check for item type is indeed LOADING holder by checking in the if statement in the removeLoadingFooter() function using
&& getItemViewType(position) == LOADING
sorry code is in Kotlin as I am using Kotlin ..
fun removeLoadingFooter() {
isLoadingAdded = false
val position = loadingFooterLastPosition
val result = getItem(position)
if (result != null && getItemViewType(position) == LOADING) {
CamerasModel!!.removeAt(position)
notifyItemRemoved(position)
}
}