bgogetap / StickyHeaders

Easily add Sticky Headers to your RecyclerView
Apache License 2.0
521 stars 88 forks source link

Improvements #63

Closed mobilekosmos closed 6 years ago

mobilekosmos commented 6 years ago
  1. Why do I need TopSnappedStickyLayoutManager?
  2. Isn't the default elavation of 5dp to much? The Toolbar have like 4dp I think and the if you check the Google I/O App they use 2dp for StickyHeaders, maybe you want to set the default also to 2dp?
  3. In the docu you say the RecyclerView should be in a FrameLayout or CoordinatorLayout, why is this? I am using it in fragment->CardView->LL->LL->LL and it seems to work.
  4. Instead of needing to implement StickyHeader which implies adding a new class to my code why not extending the adapter with a callback isThisStickyHeader? I think this would be more practical.
bgogetap commented 6 years ago
  1. You do not need TopSnappedStickyLayoutManager. It makes scrollToPosition call scrollToPositionWithOffset so I can guarantee the item position that is being scrolled to will be at the top of the list (this is important for UI tests). The default behavior of scrollToPosition only ensures the item is visible, it will not bring it to the top of the list.

  2. Maybe? It's changeable so I'm not too concerned. I don't want to change it until a major release because it would be changing default behavior which some may not expect.

  3. The sticky header view is added to the RecyclerView's parent ViewGroup, so the RecyclerView must have a parent that positions views based on coordinates. CardView is a FrameLayout.

  4. The entire point of this project was to reduce the amount of classes needed to be extended. In most cases, no one has to extend any class unless they want custom LayoutManager behavior (in which case they would have had to extend that class even without the library). This library will never require a custom adapter class to be created.