devunwired / recyclerview-playground

Examples of RecyclerView use and custom LayoutManager implementations
MIT License
1.25k stars 270 forks source link

Could you implement changable child view height in FixedGridLayoutManager #15

Closed tounaobun closed 9 years ago

tounaobun commented 9 years ago

In FixedGridLayoutManager,the childviews size is fixed.How could I make the child view height changable?

PGMacDesign commented 9 years ago

I too would love to know this as My goal is to implement multiple RecyclerViews below one another that scroll horizontally; which cannot be done currently as the FixedGridLayoutManager auto-fills the entire screen (looks like a fill-parent effect), which prevents anything from being visible below it.

PGMacDesign commented 9 years ago

I was able to find a workaround.

Follow the guide here: http://wiresareobsolete.com/2014/09/building-a-recyclerview-layoutmanager-part-1/ and the code will set to auto 'wrap' data in a recyclerView.

To adjust the size of it directly, just call: .setMinimumHeight((int) pixels_variable); on your holder's layout item.

tounaobun commented 9 years ago

@PGMacDesign That's nice,but there is still a performance issue.When there are huge visible items on screen,say 100 items or more,and fling it as fast as you can,you would find it scroll hard and render slowly.

devunwired commented 9 years ago

As described in the README, I cannot take on feature requests. If you have a patch to submit with this feature, I would be happy to review it.