[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

Some UI framework internal details in short

In MainActivity>>defaultNavMenuTitles navigator menu options are defined.
These strings match the id defined by AndroidCoordinator class>>id, that is: a navigator menu option defines which will be the rootCoordinator -of a possible stack of coordinators.

Each coordinator instance holds a fragment that will be stacked in Android backstack. Not only fragments are stacked, also coordinators are stacked, and this stack is held by anAndroidApplicationThread (there will be anAndroidApplicationThread for each navigator option menu).

Why are coordinators also stacked? because if coordinator menu option changes we want all the stacked coordinators (and fragments -each coordinator holds its fragment) to be restored. Therefore when a option menu changes the backstack is emptied and replaced with all the fragments of the stacked coordinators, recreating the backstack.
When the app switches to a cordinator (the coordinator is placed at the top of the stack) -AndroidApplicationThread>>switchToUiNamed:-, coordinator's fragment is replaced (MainActivity>>switchToFragmentNamed:clear:activate:), and the corresponding view inflated (AndroidApplication>>inflateFragmentView).