pedrovgs/Renderers

server loading imitation

morkovkin opened this issue · 1 comments

Hello thx you for good project but i have manny questions.. First sorry about my English but i hope you understand me ) I try write simple project with Renderes lib, for server loading imitation i use handler .. Some think like this

new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                RandomVideoCollectionGenerator randomVideoCollectionGenerator =
                        new RandomVideoCollectionGenerator();
                adapter.addAll(randomVideoCollectionGenerator.generate(4));
            }
        }, 5000);

But lib don't add this items to recyclerView.. i don't understand why... can you say me?

In my production code i use ItemAnimator.. is it ok for Renderes lib? how i can write custom method like this -

public void updateItems(List<String> data, boolean animated) {
        feedItems.clear();
        feedItems.addAll(data);
        if (animated) {
            notifyItemRangeInserted(0, feedItems.size());
        } else {
            notifyDataSetChanged();
        }
    }

i think i can override RVRendererAdapter and write what i need but i don't shore ..

Thx for your time!

Hey @morkovkin in the first segment of code you forgot to invoke notifyDataSetChanged method.

The answer to your second question is: YES. You can use ItemAnimator and renderers 😃

I guess these are the answers to your questions so I'm closing this issue. Feel free to open it again if you have any other doubt.