-
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
Documentation or implementation bug. Custom ViewHolder cannot be cast to eu.davidea.viewholders.FlexibleViewHolder #117
Comments
Hello @ivankarpey, thank you for your message. However, thank you that you have spotted this, I'm going to fix this. For documentation, the wiki page Headers and Sections clearly explain that sections are identified by |
@ivankarpey, I refactored the item interfaces signatures to be compliant with StickyHeaderHelper. |
Thanks. Looks like docs much clearer now. I'm plan to use flexible adapter pretty aggressively in my app and will try to provide some more improvements if will find any. |
Got same exception when my header class extends AbstractHeaderItem and normal item extends AbstractSectionableItem. HELP IN NEED. |
@jinsen47, can you check if |
Issue is correct for the current snapshot.
I'm dealing with sticky headers. Nowhere in docs mentioned, that instead of custom
ViewHolder
inheritance there should beFlexibleViewHolder
used. And generic constraints of interfaces of provided abstract classes, likeAbstractHeaderItem
andAbstractSectionableItem
expect to get classes inherited fromRecyclerView.ViewHolder
However
StickyHeaderHelper
class's methodgetHeaderViewHolder(int position)
have direct casting to FlexibleViewHeader and of course will failed if there is simple ViewHolders used with error similar to this one:So i think either it's need to fix docs and probably introduce new abstractions which will be statically checking correct typing, or fix the code to not assume it's use FlexibleViewHolder items.
The text was updated successfully, but these errors were encountered: