Skip to content
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

Switching Header Label values #24

Open
gasparuff opened this issue Sep 8, 2014 · 2 comments
Open

Switching Header Label values #24

gasparuff opened this issue Sep 8, 2014 · 2 comments
Labels

Comments

@gasparuff
Copy link

I'm showing a ListView with 3 sort buttons above it (Name, Country, Age). When sorting changes, I'm updating the HeaderListview like this:
((PeopleSectionedAdapter) listView.getAdapter()).setLinkedPeopleMap(indicesBR.get("name"));
((PeopleSectionedAdapter) listView.getAdapter()).notifyDataSetChanged();
or
((PeopleSectionedAdapter) listView.getAdapter()).setLinkedPeopleMap(indicesBR.get("country"));
((PeopleSectionedAdapter) listView.getAdapter()).notifyDataSetChanged();
or
((PeopleSectionedAdapter) listView.getAdapter()).setLinkedPeopleMap(indicesBR.get("age"));
((PeopleSectionedAdapter) listView.getAdapter()).notifyDataSetChanged();

Actually it works, but when I havent scrolled below the 2nd Header, the currently active header doesn't get changed at all. E.g. I have selected "Name" and I scrolled down just a very small amount - then the currently active header still says "A", while the next visible header displays the correct title. I'd have to scroll down until the next header gets active and then scroll back to update the previously active one. This problem doesn't occur if I don't do any scrolling at all.
How can I fix this?

@tokou tokou added the bug label Nov 6, 2014
@Wirwing
Copy link

Wirwing commented Jan 3, 2015

Any update on this? I need to change header values too!

@JaydipMeghapara
Copy link

It's working for me. Simply remove the all view of header when set adapter to list view.
Change the setAdapter() of HeaderListView to

public void setAdapter(SectionAdapter adapter) { mAdapter = adapter; if(mHeader != null) mHeader.removeAllViews(); mListView.setAdapter(adapter); }

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

No branches or pull requests

4 participants