[MaterialContainerTransform] Huge delay running transition on 1.3.0-alpha01
See original GitHub issueDescription: 1.3.0-alpha01 causes MaterialContainerTransform to take way longer to run, and skip way more frames
Tried to update from 1.2.0-alpha06 but perf is a disaster.
Source code: Here’s how I’m launching the transition:
private fun startContainerTransform(from: View, to: View): Flow<Boolean> {
val channel = Channel<Boolean>()
val transform = MaterialContainerTransform().apply {
startView = from
endView = to
setPathMotion(MaterialArcMotion())
scrimColor = Color.TRANSPARENT
duration = 300L
addListener(object : Transition.TransitionListener {
override fun onTransitionEnd(transition: Transition) {
channel.offer(true)
channel.close()
}
override fun onTransitionResume(transition: Transition) {
}
override fun onTransitionPause(transition: Transition) {
}
override fun onTransitionCancel(transition: Transition) {
Timber.e("Transition cancelled?")
channel.offer(false)
channel.close()
}
override fun onTransitionStart(transition: Transition) {
}
})
}
TransitionManager.beginDelayedTransition(screenContainer, transform)
return channel.receiveAsFlow()
}
This shows up in logcat:
Skipped 249 frames! The application may be doing too much work on its main thread.
Android API version: 29
Material Library version: 1.3.0-alpha01
Device: Emulator Pixel 3a on API 29
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:30 (12 by maintainers)
Top Results From Across the Web
MaterialContainerTransform transition is not Working on Return
Through logging, I can confirm the shared transitionName matches in each fragment. The transition from source -> destination works great, but ...
Read more >transition-delay - CSS: Cascading Style Sheets | MDN
The transition-delay CSS property specifies the duration to wait before starting a property's transition effect when its value changes.
Read more >MaterialContainerTransform - Android Developers
A shared element Transition that transforms one container to another. MaterialContainerTransform can be used to morph between two Activities ...
Read more >transition-delay | CSS-Tricks
The transition-delay property, normally used as part of transition ... A valid time value defined in seconds or milliseconds e.g. 1.3s or ...
Read more >Building Beautiful Transitions with Material Motion for Android
Learn about four transition patterns and how to add them to your Android app.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

fwiw I was seeing a bunch of bugs on the previous version too, sometimes the new view wouldn’t fully show, leading to the old view still being partially visible. Not sure if that’s relevant. Anyway I’m punting on container transform entirely and going back to good-old slide left/right for now.
@dsn5ft I couldn’t reproduce the issue properly. I mean, there’s no jank in the sample app. Maybe because the data is static and not from server? My personal project app really lags for first few times and then everything will be fluid. What could be the possible reason behind that?
Personal app uses the MVVM architecture with Repository pattern. Also, dagger 2 is used for DI. Views are similar to the sample app. But still, the sample app is fluid. However, I face lag in personal app only for first few times of navigation from Home -> Detail screen and then everything will be fluid.