Flipboard / bottomsheet

Android component which presents a dismissible view from the bottom of the screen
BSD 3-Clause "New" or "Revised" License
4.53k stars 594 forks source link

Proposal: Switch to RecyclerView for grid/list implementations in commons components. #51

Open ZacSweers opened 8 years ago

ZacSweers commented 8 years ago

So far, we've been using ListView and GridView for everything, which has come with its fair share of problems. They're less flexible, less performant, and have forced us to dance around some bugs as well. I propose we switch to RecyclerView instead.

Pros

Cons

Other things to consider

With its added flexibility, we should do due diligence to make sure the library can allow for users to hook into this fairly easily. I'm not familiar enough with RecyclerView to know if that would problematic, or if it's even a problem at all. Just something to keep in mind.


@markrietveld @st028 @emilsjolander thoughts?

emilsjolander commented 8 years ago

Sure, i have no problem with this.

AKiniyalocts commented 8 years ago

This is a great idea. Would make it possible to just swap out a LayoutManager for the recycler. (Giving us grid, linear and staggered layouts).

AKiniyalocts commented 8 years ago

Just got this working. Should have a PR sometime this weekend. :+1:

ZacSweers commented 8 years ago

Great! Looking forward to it.

ZacSweers commented 8 years ago

@AKiniyalocts not sure how far along you are, but one thing I've come across that we'd definitely want is proper WRAP_CONTENT support. Currently, neither Linear nor Grid Layout Managers support this though. I've found a manual implementation for LinearLayoutManger that works well, but haven't seen one for GridLayoutManager. Thoughts?

I don't mind using the manual implementation for LinearLayoutManger. For GridManager, my thoughts are that we can maybe take advantage of setHasFixedSize()

Relevant issue: https://code.google.com/p/android/issues/detail?id=74772

AKiniyalocts commented 8 years ago

@hzsweers sorry, my previous time estimate was defeated by the holiday weekend :facepunch: . I've run into this before with WRAP_CONTENT in recycler. Have a working fix for Linear, but haven't managed to get Grid wrapping though. I'll have some more time today/tomorrow to investigate.

ZacSweers commented 8 years ago

@AKiniyalocts no worries. The current implementations work fine, so no rush

ZacSweers commented 8 years ago

On hold until google releases official WRAP_CONTENT support in Q1