Closed zach-klippenstein closed 3 years ago
Two thoughts about this:
trimMemory
method to allow consumers to wire it up manually if they wanted. This is pretty clunky. isVisible
flag to drawChild
to allow screens to clean up their own state when hidden.
Once #4 is done, we can listen for system low memory callbacks and set the flag to false for hidden screens to discard them and free up memory. This should drop things like running animations and bitmaps held by those screens' compositions. If a screen really needs to hold on to longer persistent state, it can use the (soon-to-come)
UiSavedStateRegistry
APIs, which I think should survive this.