Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the actual ms time values for Android's animTime constants?

Android includes

config_longAnimTime config_mediumAnimTime config_shortAnimTime 

but the actual values identified by these constants don't make sense as milliseconds. I'm sure they get compiled into useful values, and I can determine them with code, but I'm sure someone else knows the answer - and, more to the point, I'm sure other people will be looking for them. So please post the actual values as an answer and save everyone a little bit of time.

like image 482
Carl Manaster Avatar asked Jul 26 '10 17:07

Carl Manaster


2 Answers

Directly read the property:

getResources().getInteger(android.R.integer.config_shortAnimTime); getResources().getInteger(android.R.integer.config_mediumAnimTime); getResources().getInteger(android.R.integer.config_longAnimTime); 

Don't use a hard-coded value: some devices provide an option to speed up animations: a hard-coded value would ignore that setting.

like image 70
Oliv Avatar answered Sep 30 '22 15:09

Oliv


Current values (since 3.x):

  • config_shortAnimTime=200
  • config_mediumAnimTime=400
  • config_longAnimTime=500

And the duration of the activity open/close and fragment open/close animations:

  • config_activityShortDur=150
  • config_activityDefaultDur=220
like image 26
spatialist Avatar answered Sep 30 '22 14:09

spatialist