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

In list extra spaces added between items, while loading the data from web service. #6

dhara95 opened this Issue May 15, 2018 · 4 comments


None yet
4 participants

dhara95 commented May 15, 2018

I have implemented your library in my project which is written in java language. In my project there is need to call data from web service so 1st time when I call web service at that time data properly shown but when I call web service 2nd time for more data at that time data is displayed in the list with extra space in between the items, extra space in between items and headers as well as width of the item is also changed which is shown in below picture.
Can you help me to solve this problem
Thanking you in advance

Properly shows data when 1st time I call data from web service

Extra spaces is added in list when 2nd time I call data from web service

@sangcomz sangcomz self-assigned this May 16, 2018


This comment has been minimized.


sangcomz commented May 16, 2018

Could you show me the code implemented in RecyclerSectionItemDecoration.SectionCallback?


This comment has been minimized.

dhara95 commented May 16, 2018

private RecyclerSectionItemDecoration.SectionCallback getSectionCallback(List finalLeadsMapMarkersList) {
return new RecyclerSectionItemDecoration.SectionCallback() {
//In your data, implement a method to determine if this is a section.
public boolean isSection(int i) {
return !finalLeadsMapMarkersList.get(i).getDateGroup().equals(finalLeadsMapMarkersList.get(i - 1).getDateGroup());

        //Implement a method that returns a SectionHeader.
        public SectionInfo getSectionHeader(int i) {
            return new SectionInfo(finalLeadsMapMarkersList.get(i).getDateGroup(), "");

This comment has been minimized.

TilsonF commented Jun 7, 2018

for me too making swipe filling the list.


This comment has been minimized.

Ekkaveli commented Jun 22, 2018

I had the same problem, because everytime I loaded new data I added the item decoration for my new List. As a workaround I remove the old item decoration with:

int count = tlRecyclerView.getItemDecorationCount();
if (count  > 0)       
   tlRecyclerView.removeItemDecorationAt(count  - 1);

Now everythings works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment