andkulikov / Transitions-Everywhere

Set of extra Transitions on top of Jetpack Transitions Library
Apache License 2.0
4.83k stars 486 forks source link

without button click #103

Open dharmeshrathore opened 4 years ago

dharmeshrathore commented 4 years ago

Hi All, can we do slide animation without on button click? i want when the activity start then text animate in slide animation starts, without any button click. Please help.

Daer7 commented 3 years ago

I'm facing the same problem and apparently you cannot launch a transition from the OnCreate method, which is a pity. However, there seems to be a workaround: you can set an on click listener to a whole transitionsContainer and then imitate a click by transitionsContainer.performClick(). I don't like this solution but for the time being there is no other option.

EDIT: I believe this question on StackOverflow can be of help too: https://stackoverflow.com/questions/55704802/transitionmanager-begindelayedtransition-doesnt-animate-when-activity-first-loa

Using a handler with postDelayed does the trick as described in one of the answers. What I also noticed is that it only works this way if I invoke beginDelayedTransition(transitionsContainer) using the default transition, when I try to define my own transition and run beginDelayedTransition(transitionsContainer, transitions), all the layout elements appear at once after the delay time has passed and there is no fade in effect whatsoever.

eunavida commented 2 years ago

Vucjbif7vc7gud7