RecyclerViewEnhanced
RecyclerViewEnhanced copied to clipboard
RecyclerView Footer
Hi,
I have a RecyclerView with swipe to delete for each rows. I added a footer to my RecyclerView (footer uses a different layout than items and should not be swipeable nor clickable).
I did try to use setUnSwipeableRows(), but it crashes inside handleTouchEven()'s ACTION_DOWN. Would it be possible to make the footer bypass the touch listener? Is there a way to have a footer with actual code?
Information on the setup and the crash log would be more helpful
Yeah, sorry for the lack of information. I wrote that in a hurry. I had more time to pinpoint the issue, and looks like theres a missing check into ACTION_DOWN.
The crash was happening on line 521 of RecyclerTouchListener.java
(nullPointerException on getHeight):
bgView.setMinimumHeight(fgView.getHeight());
Which is normal since my footer does not contain a bgView/fgView, it's a different layout that is not meant to be swipeable.
What I did was adding a check after line 510, something like:
if (unSwipeableRows.contains(touchedPosition)) {
break;
}
It works for my case, but there may be other places where this check should be added I think.
I have the same problem.. it should be a simple fix