简体   繁体   English

Android-动态overridePendingTransition持续时间

[英]Android- dynamic overridePendingTransition duration

I am creating an android launcher and am pretty far into it. 我正在创建一个android启动器,并且距离它还很远。 I ran into a problem though. 我遇到了一个问题。 I need to allow the users to enter the transition duration from activity to activity from setting. 我需要允许用户输入从活动到设置的活动过渡时间。 The problem is that since the structure of overridePendingTransition is 问题在于,由于overridePendingTransition的结构为

overridePendingTransition(int,int); OverridePendingTransition(int,int);

instead of 代替

overridePendingTransition(Animation,Animation); overridePendingTransition(Animation,Animation);

which means that well I dont know how to set the animation speed dynamicly. 这意味着我不知道如何动态设置动画速度。 I know how to set duration in the anim xml but that is not changable. 我知道如何在anim xml中设置持续时间,但这是不可更改的。 here is a clip of what I have 这是我所拥有的片段

Intent LaunchIntent = getPackageManager().getLaunchIntentForPackage(packages[position]); startActivity(LaunchIntent); overridePendingTransition(R.anim.in,android.R.anim.out);

I need to set animation speed dynamicly 我需要动态设置动画速度

您需要像常规类一样声明自己的Animation(意味着不在xml中)并使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM