While discovering Android libraries and frameworks, I came across Square's blog post on Flow and Mortar. The author states that some of the motivations for developing Flow and Mortar was because
... Offscreen fragments mysteriously being brought back to life at odd moments
... No direct control over animation
I am having trouble understanding what the author means. Can anyone elaborate these two pain points the author speaks of?
I recommend you to read Square's new blog post. It clearly describes fragments' problems due to its' complex livecycle, implementation dependent errors, transactions and creation magic. The key idea is that There is no need for new APIs; everything we needed was there from the very beginning: activities, views, and layout inflaters
.
Considering your questions:
Offscreen fragments mysteriously being brought back to life at odd moments
Quote from post: If you ever found yourself with a stale unattached fragment recreated on rotation, you know what I'm talking about.
...when restoring the activity instance state, the fragment manager may try to recreate an instance of that fragment class using reflection.
No direct control over animation
About fragment transactions: ...committing a transaction is async and posted at the end of the main thread handler queue. This can leave your app in an unknown state when receiving multiple click events or during configuration changes.
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