Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Masum Bergmann
PLUS
Masum Bergmann
Courses Plus Student 4,129 Points

alphaAnimation time limit

This one's for the experts:

Is there an upper time limit for the duration of an alphaAnimation? In other words, could I have an alphaAnimation run for 2 hours?

Cheers, Masum

1 Answer

Hi Masmum,

Animations in android don't cause UI blocking and so the android system wouldn't kill a long running animation. I've looked into this before and I don't see why there would be an upper limit.

However from the fact that the duration is an integer (Max value of 2^31 -1) in milliseconds (1000ms = 1s), the upper limit if it isn't specifically set lower would be something along the lines of 596.5* hours.

It's probably a bit unrealistic that a device would even have a charge large enough to view this, let alone a user willing to sit through it while it plays out!

If you find any information about an enforced limit though, please do let me know!

Liam

Masum Bergmann
Masum Bergmann
Courses Plus Student 4,129 Points

Thanks for that! I doubt I'll ever be needing the full 596.5 hours, but good to know I have some leeway ;-) Will let you know if I hear anything different!

Cheers, Masum