Is it possible to create pinterest like layout on Android using GridView
? I want to create image gallery using GridView
but I am not sure if it is good solution. I do not want create three LinearLayouts
(I think that this solution is not good: Pinterest style listview or gridview in android)
Any ideas ;)?
A standalone helper for synchronizing scrolling of 2 ListViews: https://gist.github.com/yanchenko/6179793
I've been playing with this also (used LinearLayout) but at the end I had lot of problems with memory consumption (especially when I had to reload the items). I settled on simple solution which uses two synchronized ListViews. This way I can exploit internal caching which helps a lot. To do this I had to use OnTouchListener and OnScrollListener who synchronize lists. Here's an example:
https://github.com/vladexologija/PinterestListView
For Recent visitors to this question , I would suggest using
RecyclerView
withStaggedGridLayoutManager
. It's having more than enough functions and flexibility.Some useful libraries for implementing Pinterest-like grid view:
This library comes from the Etsy application: https://github.com/etsy/AndroidStaggeredGrid
Create layout like as follow
Now add your
ImageView
dynamically in layoutsoutput: