Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/180.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android系统动画持续时间_Android_Android Activity_Android Animation_Android Kernel - Fatal编程技术网

android系统动画持续时间

android系统动画持续时间,android,android-activity,android-animation,android-kernel,Android,Android Activity,Android Animation,Android Kernel,我只是想知道安卓系统动画(活动A切换到活动B的动画)的持续时间有多长,我如何衡量这段时间。我应该使用一些工具还是在代码中使用日志?您可以在xml文件中设置动画持续时间添加行 android:duration="yourtime" fade_in.xml <?xml version="1.0" encoding="utf-8"?> <alpha xmlns:android="http://schemas.android.com/apk/res/android"

我只是想知道安卓系统动画(活动A切换到活动B的动画)的持续时间有多长,我如何衡量这段时间。我应该使用一些工具还是在代码中使用日志?

您可以在xml文件中设置动画持续时间添加行

   android:duration="yourtime" 
fade_in.xml

<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
       android:interpolator="@android:anim/accelerate_interpolator"
       android:fromAlpha="0.0" android:toAlpha="1.0"
       android:duration="200" />

您可以在“设置->开发人员选项”下检查Android中的所有动画持续时间。这是用户的偏好,这意味着您无法更改它。

活动或片段之间的系统动画时间由(xml)定义:

或(在Java中):

来源:

<!-- The duration (in milliseconds) of a short animation. -->
<integer name="config_shortAnimTime">200</integer>

<!-- The duration (in milliseconds) of a medium-length animation. -->
<integer name="config_mediumAnimTime">400</integer>

<!-- The duration (in milliseconds) of a long animation. -->
<integer name="config_longAnimTime">500</integer>

<!-- The duration (in milliseconds) of the activity open/close and fragment open/close animations. -->
<integer name="config_activityShortDur">150</integer>
<integer name="config_activityDefaultDur">220</integer>

200
400
500
150
220

如果我没有设置动画,android操作系统默认的持续时间是多少?如果没有动画,为什么要设置活动之间的持续时间?因为android操作系统默认设置系统动画
Intent i = new Intent(this, NewActivity.class);
startActivity(i);
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
@android:integer/config_activityShortDur
@android:integer/config_activityDefaultDur
android.R.integer.config_activityShortDur
android.R.integer.config_activityDefaultDur
<!-- The duration (in milliseconds) of a short animation. -->
<integer name="config_shortAnimTime">200</integer>

<!-- The duration (in milliseconds) of a medium-length animation. -->
<integer name="config_mediumAnimTime">400</integer>

<!-- The duration (in milliseconds) of a long animation. -->
<integer name="config_longAnimTime">500</integer>

<!-- The duration (in milliseconds) of the activity open/close and fragment open/close animations. -->
<integer name="config_activityShortDur">150</integer>
<integer name="config_activityDefaultDur">220</integer>