-
Notifications
You must be signed in to change notification settings - Fork 231
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
Feature Request: Expand+collapse simultaneously #23
Comments
list.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
|
In combination with my fix for issue #34 , I accomplished the accordion by updating my activity as follows:
|
@doc-rj there seems to be a flicker before collapsing the previous animation. |
There is also a problem when a group with many items is expanded, then the user scrolls down to another group and expands it. If we simply collapse the group above and expand the new one, list will not scroll up accordingly after the first group is collapsed and user will be looking at about the middle of the newly expanded group (or completely off if it's short). I fixed this by adding this method to AnimatedExpandableListView
And calling it inside collapseGroupWithAnimation() before returning/starting animation. I also needed to make sure that collapse finishes first and then start the expansion (otherwise the visible position can be wrong). There is a little flicker as I don't address the situation when we see only a half of first visible item (we need to add a little vertical scroll), but this should be easy to fix. |
@sladek-jan Nice approach. If only you posted this six months back, would have saved me a lot of headaches.. |
Sorry for not being helpful @amalChandran! In the end, I didn't like how user needed to wait for the collapse to finish. My new approach seems to work well and allows simultaneous collapse and expansion. [(http://pastebin.com/0jJ5Lbz0)] |
expandAndCollapse animation, for closing the last expanded item while simultaneously opening the next. This would allow the accordion UI type: http://jqueryui.com/accordion/
I believe one of your commenters on your blog also requested this. I will work on it in the meantime as I know you are busy, but I'm not sure I understand your library well enough to implement perfectly.
Ideally in long lists, the position of the clicked expanding item would have a sort of scroll lock for the group header while everything else moved, or the expanding header would smooth scroll to the top of the screen if the expanding group is too large to fit on the screen at once.
The text was updated successfully, but these errors were encountered: