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

Open
dhara95 opened this Issue May 15, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@dhara95

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
display_proper_data

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

@sangcomz sangcomz self-assigned this May 16, 2018

@sangcomz

This comment has been minimized.

Owner

sangcomz commented May 16, 2018

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

@dhara95

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.
@override
public boolean isSection(int i) {
return !finalLeadsMapMarkersList.get(i).getDateGroup().equals(finalLeadsMapMarkersList.get(i - 1).getDateGroup());
}

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

This comment has been minimized.

TilsonF commented Jun 7, 2018

for me too making swipe filling the list.

@Ekkaveli

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