Duration 10:33

Bottom Navigation View with Fragments - Navigation Component in Android Studio

8 726 watched
0
184
Published 11 Dec 2020

This is the third part of the complete mini course on navigation component. In this tutorial, you will learn how to create bottom navigation view using navigation component. There are two main reasons to use navigation component for bottom navigation bar: very lightweight and very performant. In this tutorial, you will learn the following topics 1) Implement navigation component. 2) Create navigation graph. 3) Implement NavHostFragment or container. 4) NavController 5) Fragments 6) Menu 7) AppBarConfiguration Add Dependency ****************** dependencies { def nav_version = "2.3.0-alpha04" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" } Compile Options ****************** compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() } Kotlin Plugin ************** apply plugin: "androidx.navigation.safeargs.kotlin" The navigation component consists of three keywords that are described as bellow: 1- Navigation Graph: is a resource file that contains all of your destinations and actions. The graph represents all of your app's navigation paths. 2- NavHost: is an empty container that displays destinations from your navigation graph. The navigation component contains a default NavHost implementation, NavHostFragment, that displays fragment destinations. 3- NavController: its an object that manages app navigation within a NavHost. This would help to replace one fragment with another fragment in the NavHost container. 🔴 Subscribe for more educational tutorials on CodeWithMazn channel! Follow me on Instagram https://www.instagram.com/codewithmazn/

Category

Show more

Comments - 30