Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when remove Loading would remove a list item #14

Open
bhapps opened this issue Apr 4, 2020 · 0 comments
Open

Issue when remove Loading would remove a list item #14

bhapps opened this issue Apr 4, 2020 · 0 comments

Comments

@bhapps
Copy link

bhapps commented Apr 4, 2020

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)
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant