Recyclerlistview: "type" in layoutProvider URGENT!

Created on 27 Jan 2020  路  4Comments  路  Source: Flipkart/recyclerlistview

Hi, I followed this tutorial to implement infinite scrolling using paging.
https://www.youtube.com/watch?v=32ZM72CKtTE

I can't use "type" in layoutProvider, as the Data is fetched from web service and Data(fetched) doesn't have a "type" key nor can't add it right now. how can I integrate it?!

Most helpful comment

@aceallen17 type does not have to come with your data. Is a layout type to you can set. For example if you know that you have 3 types of sizes you should give them to the view so it would know how to recycle them. If you have only one type just return 0 for the index, set width and height and you are ready to go. Keep in mind that the list does not support dynamic layouts. Hope this helps.

And please don't type URGENT on things that are not just to get help faster. It is not fair and it is an open source community. No one here is working for you.

All 4 comments

Hi, You need all the list items to have a layout type to enable recycling on basis of the type of the item. If all the items have the same layout then a single default layout type would be enough.

I can't use "type" in layoutProvider, as the Data is fetched from web service and Data(fetched) doesn't have a "type" key nor can't add it right now. Is it possible to integrate it with "type" in layoutProvider?!

@aceallen17 type does not have to come with your data. Is a layout type to you can set. For example if you know that you have 3 types of sizes you should give them to the view so it would know how to recycle them. If you have only one type just return 0 for the index, set width and height and you are ready to go. Keep in mind that the list does not support dynamic layouts. Hope this helps.

And please don't type URGENT on things that are not just to get help faster. It is not fair and it is an open source community. No one here is working for you.

Closing this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

teryi picture teryi  路  5Comments

sm2017 picture sm2017  路  5Comments

H-Shafiei picture H-Shafiei  路  8Comments

ErHarinderSingh picture ErHarinderSingh  路  6Comments

sksin28 picture sksin28  路  8Comments