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

fixed bug collapse current open View #17

Closed
wants to merge 1 commit into from
Closed

fixed bug collapse current open View #17

wants to merge 1 commit into from

Conversation

passsy
Copy link
Contributor

@passsy passsy commented Feb 24, 2013

sry, but in my last commit was a little bug

after changing the cursor of a list the recently closed view gets
recreated with an open expandable. The open item was still saved.

after changing the cursor of a list the recently closed view gets
recreated with an open expandable. The open item was still saved.
@tjerkw
Copy link
Owner

tjerkw commented Feb 24, 2013

I also remove the cast (SlideExpandableListAdapter)getAdapter() to a member in order to be more typesafe. Also added a null check.

@tjerkw tjerkw closed this Feb 24, 2013
@passsy
Copy link
Contributor Author

passsy commented Feb 24, 2013

after calling animateCollapse all views are collapsed. I can't call updateExpandable(target, position); to save the expandable state because I don't have the position. But I know that all items are collapsed, so i can clear the viewHeights and the enableFor mehtod which styles the view items doesn't find a height in line 124.

think, what would happen if viewHeights doesn't get cleard.

First you have a list of Listitems.

A <- closed
B <- closed
C <- closed

viewHeights empty

expand one (B)

A <- closed
B <- expanded
C <- closed

viewHeights (pos: 1, height: 100)

and click a button. the button collapses all items with animateCollapse() and removes a item from the database

A <- closed
B <- closed
C <- closed

Here is my change. Clear view heights.

Widhtout the Change: viewHeights (pos: 1, height: 100)

notifyDataSetChanged() is called and the ListView items get recreated.

B is deleted (no view)

A <- closed
C <- expanded

Here is the error: C is expanded because viewHeights still hold that pos 1 has the height 100.
Thats why i drop viewheights.

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

Successfully merging this pull request may close these issues.

None yet

2 participants