Coordinator Layout Like Animation on Fragment Using Motion Layout to have Seamless Transition when using Using Navigation Component

Navigation component Introduction made using single activity UI pattern easy. Although it introduces a stranded way to follow a single activity UI design pattern it comes with its own challenges to overcome. One of which is to have a seamless transition between coordinator design fragment and other fragments.

The issue with using coordinator layout design with Navigation Component

When implementing the navigation component activity act as a navigation fragment holder. Fragments in the navigation component consume the data coming from the view model and display for users to interact with users. Activity holds navigation fragments and toolbar. The app toolbar is placed inside activity because it’s common for most of the fragments. This works fine as long as there is no need to implement a design involving coordinator layout. Coordinator layout does those beautiful collapsing animation by using CollapsingToolbarLayout inside AppBarLayout. The app toolbar also needed to stay inside CollapsingToolbarLayout.

Continue reading