-
Notifications
You must be signed in to change notification settings - Fork 554
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
AbstractSectionableItem items not showing header when adding items at runtime #462
Comments
@orrinLife360, thank you very much! I appreciate. This implementation is wrong, the @Override
public boolean equals(Object o) {
return o instanceof ProfileListHeader;
}
Then, ScrollableHeaders is another feature you can read about more in the Wiki and in the javaDoc, thing that you should always do it, so the cardinal position is relative to main items only (list without scrollable footers and headers). |
Okay I will try this. Thanks! So if I add a Also just to confirm if headers are added they are counted as part of the list items? Is there any way to get position of items discarding the headers? |
@orrinLife360, also To count specific items you have |
Thanks, I understand the adding sections now and modified my implementation to work to fit into that using I am still not sure if flexible adapter provides a way to find out the position of an item in the list without including headers. I can make that logic myself if needed but wanted to leverage flexible adapter if possible. |
@orrinLife360, can you please elaborate better the way a position is retrieved without including headers? |
Sure. Say I have a list that looks like this:
I would like a way to get the position of item 3 without including the headers 0, 3, & 5. So I would like ITEM_3 to return position 3 not the index in the global list 6. Right now I am just getting all the headers and finding how many are in between the start of the list and the item to get it to get that count but if flexible adapter could handle that logic too. |
@orrinLife360, ah ok, I understood and we can add it. Just that, |
Okay awesome. Thanks for all the help. I have what i need working for now. |
Wanted to start out by saying thanks for providing this awesome library! I have loved it so far.
I am however having some trouble trying to show a list with headers in my application. All of my views are dynamically added at runtime and are not set in the adapters constructor. I have created an item that extends
AbstractSectionableItem
and a header that abstractsAbstractHeaderItem
. I am trying to add these items usingaddItem(position,item)
and am not sure if the only way to make these work is withaddItemToSection()
functions. However even with calling that the headers will not show unless I add them withaddSection()
. I am not sure if this is intended functionality however I was under the assumption that you are not supposed to have to handle the section headers manually and they work based on the list of items. Here is what I have currently:Header view -
Sectionable -
My simple adapter setup -
Simple adding item -
I am assuming I am doing something wrong however it was not clear in the documentation how its supposed to be done and the sample app does all its adding of headers with one list at initialization. I was able to get it to work by adding the section using
addSection()
however then also the headers seem to be calculated into the list so and when dealing with click listeners I have I get the global position even when usinggetCardinalPositionOf()
I notice that themScrollableHeaders
size is 0. I dont know if this means I have to manage my own position including headers or if there is another way for flexible adapter to manage it.Thanks again for the library and the help!
The text was updated successfully, but these errors were encountered: