lajeet
lajeet

Reputation: 447

How to stop loading all RecyclerView elements when it is present inside a NestedScrollView?

I have a parent NestedScrollView layout, which contains a complex LinearLayout with vertical orientation (it includes the shared element transition widgets) and a recyclerView (which populates a large amount of data i.e. texts, images, oEmbeds, third party media players, etc.).

While I populate the recyclerView, it hangs the device for some milliseconds and then populates the data. It's not like you scroll down, and then recyclerView loads the data progressively.

How to progressively load the recyclerView in the NestedScrollView, as its supposed to be such as it does not hangs the device ?

RecyclerAdapter rycAdapter = new RecyclerAdapter(activity);
rycAdapter.setData(arraylist);

Inside Adapter :

public void setData(ArrayList<Content> allContent) {
    this.allContent = allContent;
    notifyDataSetChanged();
}

Now based on ViewType, I set the data.

Upvotes: 0

Views: 112

Answers (0)

Related Questions