What does Square mean because "fragment fragments come back to life" and "there is no direct control over animations"?

When opening Android libraries and frameworks, I came across a Quadratic blog post on Flow and Mortar . The author claims that some of the motives for the development of Flow and Mortar were related to the fact that

... Offshore fragments mysteriously return to life at odd moments
... There is no direct animation control

I am having trouble understanding what the author means. Can someone clarify these two points of pain that the author speaks of?

+6
source share
1 answer

I recommend you read the Square New Blog Post . It clearly describes fragment issues due to its "complex life cycle, implementation-dependent errors, transactions, and creation magic. The basic idea is that There is no need for new APIs; everything we needed was there from the very beginning: activities, views, and layout inflaters .

Given your questions:

Corrupted fragments mysteriously returning to life at odd moments

Quote from a message: 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 animation control

About fragments 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. ...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.

+6
source

Source: https://habr.com/ru/post/974120/


All Articles