Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 18.104.22.168 release ready!
Updated 28 February 2022
In this blog, we will learn how to integrate or work with Navigation Component In Android. Before starting our topic, we will discuss Navigation in brief.
Navigation refers to the interaction section of the application, that allows users to navigate from one page to another page throughout the application. With the help of Android’s JetPack, we can create Navigation from simple UI (Buttons) to complex UI (Bottom Navigation, Navigation Drawer).
In this blog, we will demonstrate the Navigation Component by creating Bottom Navigation in-app and will see how the navigation component works.
In this step, we will add all the dependencies related to the Navigation component in our “build.gradle” file. Here, we have added only the Kotlin related dependencies, if you are working on Java, then can add Java-related dependencies. You can take references of the Developer console
We can create the Navigation Graph class under the resource folder and select the Navigation under the Resource type drop-down list.We can add the action to each fragment, so their click event works accordingly, we can see the graph related to the Navigation XML file in the Android studio in the design section.
We have added only 3 fragments for test purposes, you can add multiple as per your need.
In this step, we will set up the final click events and controller with Navigation Component.
We will add following line of code to set the controller in main activity. Navigation component interanally deal with click events on the basis of the pages declared in the navigation Graph
In this blog, you have learned about the Navigation Component In Android.
You can check the mentioned link for more information about Navigation Component
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.