davideas / FlexibleAdapter

Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
Apache License 2.0
3.55k stars 553 forks source link

Divider shown between item and next header #645

Closed Marvosg closed 6 years ago

Marvosg commented 6 years ago

When using the Flexible Adapter to display a list with multiple headers, there is an option to add a FlexibleItemDecoration to the recyclerview and show dividers only between specified view types (or all if no view types specified). I am using this part as such:

recyclerView.addItemDecoration( new FlexibleItemDecoration(context)
    .withDivider( R.drawable.list_divider, R.layout.friend_recycler_item )
    .withDrawOver(true));

I am displaying a List<T extends AbstractSectionableItem>. In this list I am only adding the items themselves, the headers are referenced in each item, as specified in the wiki.

However, a divider is shown between the last item of a section and the next section's header:

screenshot

Which is not expected behaviour, as these are two different view types, but a divider is still shown between them. Is there something missing or configured wrong?

davideas commented 6 years ago

@Marvosg, everything works as expected for basic use cases. Yours is evident a special use case. Use different solution for dividers... :ok_hand:

Marvosg commented 6 years ago

Solved it by removing FlexibleItemDecoration and styling the background drawable of certain items to contain the divider graphic in themselves.