Android-SlideExpandableListView icon indicating copy to clipboard operation
Android-SlideExpandableListView copied to clipboard

ExpandCollapseAnimation should be using ObjectAnimator.ofFloat

Open peterbetos opened this issue 12 years ago • 9 comments

It seems that the ExpandCollapseAnimation is performing iterative calculations on the bottom margin each time it animates, which makes the animation of the expandable layout jittery. Please use ObjectAnimator.ofFloat instead so that the animation will be smooth. Thanks.

peterbetos avatar Jan 11 '13 04:01 peterbetos

I agree. However ObjectAnimator are only available since API level 11. (Android 3.0.x).

That would require any app which uses this library to only run on Android 3.0 or higher. Since I want this library to be compatible with almost any android version, i am not going to include ObjectAnimator.

I could rewrite the animation in such a way that it would use ObjectAnimator if available, but that would complicate the code. And I dont see a lot of jittering.

Agreed?

tjerkw avatar Jan 11 '13 22:01 tjerkw

I believe NineOldAndroids can backport ObjectAnimator if compatibility is an issue.

SeanPONeil avatar Jan 11 '13 22:01 SeanPONeil

Hmm good point. However that does add an extra dependency for this project. Since this project is a relatively small one, i want to keep things simple.

B.t.w is the animation really slow for you?

2013/1/11 SeanPONeil [email protected]

I believe NineOldAndroids https://github.com/JakeWharton/NineOldAndroidscan backport ObjectAnimator if compatibility is an issue.

— Reply to this email directly or view it on GitHubhttps://github.com/tjerkw/Android-SlideExpandableListView/issues/5#issuecomment-12166538.

Tjerk Wolterink http://about.me/tjerkw

tjerkw avatar Jan 11 '13 22:01 tjerkw

It eventually does after using it for a long time. How about using Translate animation on older versions?

peterbetos avatar Jan 12 '13 03:01 peterbetos

I tried using an TranslateAnimation, but that doesnt work since a .requestLayout is required an every animation frame. This is probably also the reason that the animation is a bit jittery.

However I dont think the ObjectAnimator will solve that problem. Does the ObjectAnimator perform a requestLayout on every frame?

tjerkw avatar Jan 12 '13 13:01 tjerkw

@peterbetos @SeanPONeil I tried using TranslateAnimation and tried with ObjectAnimator but I coudnt get it to work properly. Since this is not a failure but an improvement I will not focus too much on this item.

However you are free to submit pull requests ;-)

tjerkw avatar Jan 12 '13 14:01 tjerkw

I'll check on my end as well how I can have it implemented.

peterbetos avatar Jan 15 '13 16:01 peterbetos

I did see the animations becoming slow, and also scrolling becoming slow. But this is do to the fact sometimes a lot of new objects are created when scrolling. I'm going to focus on that.

tjerkw avatar Feb 01 '13 16:02 tjerkw

Which makes this ticket related to issue #12

tjerkw avatar Feb 18 '13 19:02 tjerkw