Bottom navigation Part 1:–
Step 1. Add BottomNavigationView in LayoutFile
Step 2. Add some icons in App
Step 3. Create menu resource in android studio without icon
Step 4. Add icons in menu resource file
Step 5. Attach menu resource with BottomNavigationView
Step 6. Apply Listener with BottomNavigationView
Use toast on BottomNavigationView event
Steps start
Step 1. Start a new project
Step 2. drawable-> new->vector asset-> select icon
Step 3. menu -> android resources file-> create menu
Step 4. name of first item is Home
name 2 second item is About
Step 5. attributes-> menuGo to Main Activity.kt :
Bottomview.setOnNavigationItemSelectedListener(
Val msg= when(it.itemID)
{
R.id.about->”About Selected”
else ->”Home selected”
}
Toast.make text(this @MainActivity,msg,Toast.LENGTH_LONG).show()
True
}
}
}