idunnololz / AnimatedExpandableListView

An extendable, flexible ExpandableListView widget that supports animations.
Apache License 2.0
590 stars 231 forks source link

Slow Collapse with few groups displayed on ListView #1

Closed KunamiPT closed 10 years ago

KunamiPT commented 10 years ago

Example: In your code, if i change the populate from 100 to 5, collapse animation get slowed for what reason?

Edit: Wait... I don't know why (yet) but only happens if my context it's a FragmentActivity. Note: With 100 works well, with 5 groups it collapse slowly..

idunnololz commented 10 years ago

The animation is a fixed time. This means it will always take x seconds no matter how many items you have. Therefore animating the expansion of 100 items will look way faster than animating one. The reason why this was done is so that it won't take forever to animate if you have some very high number of children. You can change the animation speed by going in the animated expandablelistview class and changing the constant ANIMATION DURATION, which is the time it takes to animate expand/collapse. On Apr 10, 2014 7:51 AM, "KunamiPT" notifications@github.com wrote:

Example: In your code, if i change the populate from 100 to 5, collapse animation get slowed for what reason?

Reply to this email directly or view it on GitHubhttps://github.com/idunnololz/AnimatedExpandableListView/issues/1 .

KunamiPT commented 10 years ago

I think the problem it's when it needs to recalculate listview height only when listView is smaller than the screen and once more it only occurs on a FragmentActivity where i use sliding menus.

idunnololz commented 10 years ago

By slow collapse, do you mean that the animation is slow or that it lags? On Apr 10, 2014 10:19 AM, "KunamiPT" notifications@github.com wrote:

I think the problem it's when it needs to recalculate listview height only when listView is smaller than the screen and once more it only occurs on a FragmentActivity where i use sliding menus.

Reply to this email directly or view it on GitHubhttps://github.com/idunnololz/AnimatedExpandableListView/issues/1#issuecomment-40112575 .

KunamiPT commented 10 years ago

It starts with normal speed and then it goes more slowly/laggy on collapse only, at the end of the animation it goes very very slow. Expand works almost well.

idunnololz commented 10 years ago

Fixed in https://github.com/idunnololz/AnimatedExpandableListView/pull/15.