-
Notifications
You must be signed in to change notification settings - Fork 553
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
Section gap is gone when expand the last item of section #516
Comments
Could you call |
@davideas I'm not sure where to insert
but all above are not work. :( especially the third point, some items will expand at the beginning, how could i handle the gap? |
@steventxc, try 1st point after the super() call since the expand occurs inside there. |
@steventxc, the |
@davideas Thanks your time and help. |
@steventxc, but which header do you assign? I tried and when no header is assigned it works nicely, but it will have an impact for your sticky header if activated, it won't work as expected. |
This will be the condition in // IMPORTANT: the check must be done on the BOTTOM of the section,
// otherwise the sticky header will jump!
if (flexibleAdapter.isHeader(nextItem)) { // = nextItem instanceof IHeader
Log.v("applySectionGap position=%s", position);
if (orientation == RecyclerView.VERTICAL) {
outRect.bottom += mSectionOffset;
} else {
outRect.right += mSectionOffset;
}
}
if (position >= adapter.getItemCount() - mSectionGapOnLastItem) {
Log.v("applySectionGapOnLastPosition position=%s", position);
if (orientation == RecyclerView.VERTICAL) {
outRect.bottom += mSectionOffset;
} else {
outRect.right += mSectionOffset;
}
} But for So we don't need |
I was smarter and I was able to identify the header of the section anyway. That's why sticky header works if you don't apply any header. However, i think is not good to implement |
@davideas as you said above, in my project, i never assign any header for subitem, just implement |
as above describe, when the section contains a expandable item at last, expand it, the gap is gone, but collapse it, the gap is visible as normal. it's weird. any suggestion for it ? thx.
The text was updated successfully, but these errors were encountered: