‫Hello, my friends.
‫In this video we will start learning about the navigation component.
‫The navigation architecture component simplifies implementing navigation while also helping you visualize
‫your app's navigation flow.
‫The library provides a number of benefits, including automatic handling of fragment transactions.
‫Correctly handling up and back by default.
‫Default behaviors for animations and transitions.
‫Deep linking as a first class operation.
‫Implementing navigation UI patterns like navigation drawers and bottom NAV with little additional work.
‫Type safety when passing information while navigating.
‫Android studio tooling for visualizing and editing the navigation flow of an app.
‫Don't worry, we will see all of these benefits in the practice in the next videos.
‫The navigation component consists of three key parts working together in harmony.
‫I want from you to concentrate in this slide and write the notes down in order to memorize and understand.
‫When we start working with the navigation component in a practical way in the next applications and
‫understand why we use the navigation graph, why we use the nav host fragment and why we use the NAV
‫control.
‫The navigation graph, which is a new XML resource.
‫This is a resource that contains all navigation related information in one centralized location.
‫This includes all the places in your app knowing or known as destinations and possible paths a user
‫could take through your app.
‫Holes.
‫NAV host fragment which is a layout.xml view.
‫This is a special widget that you can add to your layout.
‫It displays different destinations from your navigation graph.
‫NAV controller, which is a Kotlin or Java object.
‫This is an object that keeps track of the current position within the navigation graph.
‫It orchestrates swapping destination content in the NAV host fragment as you move through a navigation
‫graph.
‫So I want from you to memorize the role of these three components or key parts of the navigation.
‫Let's talk about the navigation graph.
‫In navigation graph is a new resource type that defines all the possible paths a user can take through
‫an app exactly like this image.
‫It shows visually all the destinations that can be reached from a given destination.
‫This is in the in this figure, the fragment destination.
‫So each each fragment is considered as a destination.
‫And the links between the the arrows between these destinations are called paths.
‫Android studio displays the graph in its navigation editor.
‫Here's part of starting navigation graph you will create for your application, for example.
‫So this is a navigation for the three fragments, the home, step one and step two.
‫So when you start with navigate to destination or navigate with action, you will get to the navigation
‫next step and after that you will direct it to flow setup to destination.
‫And then if the user click on back or finish flow, it will go to the home page.
‫So this is a navigation, this is a flow how the fragments and activities are connected together.
‫And this is the navigation between the views.
‫Exactly.
‫Fragments and activity.
‫Now let's move and start.