Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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