0

I am working with heterogeneous grid-view, i want to implement view recycling in it. I have developed the UI but when i tried to recycle the views reference by removing the views from out of the visible screen and use them for data binding. But, then due to removing the views all existing views shift upwards.

PS: Thanks for your attention.

shashank
  • 439
  • 1
  • 4
  • 17
  • 1
    Welcome to SO, first read FAQ please, then post the relevant code – Onur A. Aug 19 '13 at 12:03
  • If you use normal GridView, it recycle the views that are not on the screen automatically. – tasomaniac Aug 19 '13 at 12:05
  • @tasomaniac I have developed the UI with scrollview and linearlayout, because the UI is like pinterest. – shashank Aug 19 '13 at 12:09
  • @andrew what's "is UI p interest" ? android already has a gridView which has its own recycling mechanism . it works the same as on listView, and it works well. if you wish to learn about it, you can watch the lecture "the world of listView" . – android developer Aug 19 '13 at 12:11
  • @androiddeveloper It's a type of grid view which is having variable height for each cell. And i tried both grid view and list view for that but none of them support variable heights. – shashank Aug 19 '13 at 12:15

1 Answers1

0

You may want to try this library below. It is taken from experimental Android code and it is good.

https://github.com/maurycyw/StaggeredGridView Demo Link: https://github.com/maurycyw/StaggeredGridViewDemo

tasomaniac
  • 10,234
  • 6
  • 52
  • 84
  • It's not working with change in orientation, so that's why i have to make a heterogeneous grid view by myself. – shashank Aug 19 '13 at 12:20
  • What is not working with the orientation change? Instead of writing on your own, you may try to change the source code of the library. It is open source. – tasomaniac Aug 19 '13 at 13:03
  • Thanks for the suggestion, but i am looking for some tutorial which explains "how recycling mechanism works". – shashank Aug 20 '13 at 04:11