Skip to content

How to use MVVM for Recycleview loadmore action #5

@est7

Description

@est7

Thank you for your article. I would like to know, according to Android Official Guide of Unidirectional Data Flow, should I call uiState.Success(newAllList) when I pull more data, or add a new state: uiState.SuccessLoadMore(appendList)?

In the first case, I need to use DiffUtil ,If I have a large list but only want to append 20 pieces of data to it, is it not worth the loss? I prefer to use the second method and then call adapter.notifyItemRangeInserted(). I am very confused about this. How do you recommend I do it? Thank you very much for your answer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions