Skip to content
Advertisement

Is it possible to set transition speed/time in transition everywhere on android

I’m using Transitions-Everywhere for my app, and I wonder if I can set the transition speed/time of the transitions..

I have something like this:

TransitionManager().beginDelayedTransition(animLayout, new ChangeBounds());

FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) findViewById(R.id.myId).getLayoutParams();
layoutParams.height = (int) myHeight;
layoutParams.width = (int) myWidth;
myLayout.setLayoutParams(layoutParams);

In short, I want the transition to be slower than the default, but I just can’t figure out how to set the speed of the transition!

Advertisement

Answer

You can set the duration on the Transition you pass into beginDelayedTransition(). In your case that would be ChangeBounds. So try something like this:

final ChangeBounds transition = new ChangeBounds();
transition.setDuration(600L); // Sets a duration of 600 milliseconds
TransitionManager().beginDelayedTransition(animLayout, transition);

By default if no duration is set a Transition falls back to the default animation duration which is 300ms. So for example if you want the transition to take twice as long, use 600ms.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement