I started playing around with the Navigation Architecture Component for Android. I work on an app with complicated navigation that relies on the back stack for nested fragments and deep links. Different users can experience different interfaces, reach areas through various paths and jump around from the drawer and bottom nav. There’s a lot of data passed in and out, and transitions can be overridden to keep everything pretty. Needless to say, I’m skeptical of anything flexible enough for all this.
As my first test, I wanted to try to use the Navigation Component for Fragment A going to Fragment B. The latter will be a form that has 4 states of its own—that is, it has text, fields and buttons that show or hide using animateLayoutChanges for effect. An example of this might be a product intro fragment (A), going to a fragment (B) that quadruples as the forms for signup (B1), signin (B2), forgot password (B3) and more-info (B4) screens.
The navigation graph can be represented as A->B1 [->B2->B3, ->B4].
Read More