Skip to content
This repository has been archived by the owner on Sep 10, 2019. It is now read-only.

headers get out of sync and headers are mismatched #4

Closed
eyecreate opened this issue Nov 22, 2015 · 8 comments
Closed

headers get out of sync and headers are mismatched #4

eyecreate opened this issue Nov 22, 2015 · 8 comments

Comments

@eyecreate
Copy link
Contributor

I have two images that show where the headers are not working correctly for this library. The headers don't seem to always match both the case nor actual position where it should be dividing.

android-realmlist
android-realmlist2

@thorbenprimke
Copy link
Owner

@eyecreate - Thanks for the report. The SuperSLiM integration was a tricky so it's quite possible there are some bugs in regards the rows not updating properly.

Could you provide some more details how you got into this state?

  • Add items?
  • Remove items?
    Or is this the initial rendering?

@eyecreate
Copy link
Contributor Author

This is the initial render and what it looks like after these items are added and then navigating to this fragment. Fresh instances of the fragment yield the same mistake at this point.

@thorbenprimke
Copy link
Owner

Any way you could make the dataset available so that I could investigate it / have a repro case?

@eyecreate
Copy link
Contributor Author

Here is a link to the Realm DB I was using.
https://cloud.eyecreate.org/index.php/s/bbJyINi94sRYdPl
Let me know if you need anything else.

@thorbenprimke
Copy link
Owner

@eyecreate - thanks for the realm file. The realm data looks okay but I would have to actually see your setup code to know which columns you picked and to repro re-create all the models / adapter.

Since it would take me a bit to recreate all the models and your recyclerView setup / adapter code, I was wondering if you could share you models as well as the recycler view setup code and your adapter implementing via a gist. You could just copy all the classes into one gist. That would help me a lot.

@eyecreate
Copy link
Contributor Author

This should be what is needed to recreate the page as above.
https://gist.github.com/eyecreate/deb1835ef58e4708f2ba

@thorbenprimke
Copy link
Owner

Aright. Tracked the bug down.

onBindRealmViewHolder with headers was passed the position but this was not the realmIndex but the rowWrapperIndex. This caused the wrong items to be displayed.

The linearLayoutWithHeaders example had:

final CountryModel quoteModel = realmResults.get(rowWrappers.get(position).realmIndex);

instead of

final CountryModel quoteModel = realmResults.get(position);

and thus was covering up this bug. In your example you used the later line. I fixed up the library to provide the correct position so that your code should work correctly now once you upgrade to 0.9.7.

@eyecreate - Please verify that it works for you as well and close the issue.

@eyecreate
Copy link
Contributor Author

The update seems to have fixed this. Labels now seem to properly match the content.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants