Alexey Subbota
Alexey Subbota

Reputation: 972

Stop delayed transition

TransitionManager has the endTransitions method, but it exist only for >= api 23. Is there a way that stops pending or executing transition that started by beginDelayedTransition?

There is problem when transition is overlapped...

Upvotes: 4

Views: 2233

Answers (2)

Cristan
Cristan

Reputation: 14085

Call TransitionManager.endTransitions. If your minSdkVersion is lower than 23, use the TransitionManager of androidx.transition.

Upvotes: 4

azizbekian
azizbekian

Reputation: 62189

As long as Transitions Api internally uses Animators, you can loop on all children of a ViewGroup recursively and perform clearAnimation() on each child, or directly perform clearAnimation() on a particular view you do not want to transition.

Note, if this was a flawless way to do things, then framework would already implemented it for APIs upto 1, which means that there are some caveats (that I'm no aware of). But as a workaround you may try this solution.

Upvotes: 0

Related Questions