Android的animTime常量的实际ms时间值是多少?

Car*_*ter 38 animation android constants

Android包括

config_longAnimTime
config_mediumAnimTime
config_shortAnimTime
Run Code Online (Sandbox Code Playgroud)

但是这些常数识别的实际值没有意义,只有几毫秒.我确信它们会被编译成有用的值,我可以用代码来确定它们,但我确信其他人都知道答案 - 而且,更重要的是,我确信其他人会寻找它们.所以请将实际值作为答案发布,并节省每个人一点时间.

spa*_*ist 36

当前值(自3.x起):

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

并且活动的持续时间打开/关闭以及片段打开/关闭动画:

  • config_activityShortDur = 150
  • config_activityDefaultDur = 220

  • 可以在https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/config.xml找到当前值(或历史值). (7认同)

Oli*_*liv 30

直接阅读该物业:

getResources().getInteger(android.R.integer.config_shortAnimTime);
getResources().getInteger(android.R.integer.config_mediumAnimTime);
getResources().getInteger(android.R.integer.config_longAnimTime);
Run Code Online (Sandbox Code Playgroud)


Car*_*ter 26

开始了:

config_longAnimTime   = 400
config_mediumAnimTime = 300
config_shortAnimTime  = 150
Run Code Online (Sandbox Code Playgroud)