I'm making a scene transition for devices with API level 20+. It is working fine, but I want to set custom duration to make the transition. Is it possible ??
My code:
ActivityOptionsCompat options =
ActivityOptionsCompat.makeSceneTransitionAnimation(this,
viewStart,
transitionName
);
ActivityCompat.startActivity(this, detailsIntent, options.toBundle());
You can set the desired duration in the new started activity, by adding:
ChangeBounds bounds = new ChangeBounds();
bounds.setDuration(2000);
getWindow().setSharedElementEnterTransition(bounds);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With