-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example of how to implement a staggered layout with sticky headers #521
Comments
@jrcacd, the difference from grid and linear is of course the LayoutManager and the full span support for the item identified as header. // In the ViewHolder constructor
setFullSpan(true); Which perform this code in /**
* Support for StaggeredGridLayoutManager.
*
* @param enabled true to enable full span size, false to disable
*/
public void setFullSpan(boolean enabled) {
if (itemView.getLayoutParams() instanceof StaggeredGridLayoutManager.LayoutParams) {
((StaggeredGridLayoutManager.LayoutParams) itemView.getLayoutParams())
.setFullSpan(enabled);
}
} |
My header must inherit from which one: FlexibleViewHolder, AbstractHeaderItem, AbstractSectionableItem? |
The item form |
Apparently I've make. But I seem to have found a mistake. When I scroll and the last item before the next heading is in the left column, it works fine, meaning the next heading touch on the previous one and pushes it up. When I scroll and the last item before the next heading is in the right column (I only have 2 columns) the next heading disappears from where it is and jumps to the top (to the place where the previous heading was) |
@jrcacd, yes I see it also in the demoApp. |
Yes |
Great!!! |
Is there an example of how to implement a staggered layout with sticky headers as showed in your screenshot?
The text was updated successfully, but these errors were encountered: