lucasr / twoway-view

[DEPRECATED] RecyclerView made simple
5.23k stars 1.02k forks source link

Guard against state.getItemCount() being < 0 #226

Closed paulsowden closed 9 years ago

paulsowden commented 9 years ago

This seems like a bug in RecyclerView but can happen if the adapter is changed multiple times between layouts.

paulsowden commented 9 years ago

Updated description.

So also, I used the TwoWayLayoutManager to create a custom view and it took me a little while to understand the API (which turned out to be really simple once I understood it), it would help a lot if there was some javadoc explaining the class, would you be open to accepting a pull request for documentation on the base class?

lucasr commented 9 years ago

@paulsowden Yes, javadocs on how to write custom layout managers with TwoWayView would be awesome. I gave an overview of the API in my "custom layouts" talk (https://speakerdeck.com/lucasr/custom-layouts?slide=38). Maybe use it as inspiration?