I would like to add a custom item in the new BottomNavigationView .
There are plenty of tutorial of adding a custom view with the normal navigation view but I can\'t fin
Hope the below solution will help.
Create a layout : layout/_custom_cart_item_layout.xml
drawable/circle
MainActivity : layout/main_activity.xml
menu : menu/bottom_menu.xml
In your MainActivity class within onCreate
BottomNavigationView mbottomNavigationView =findViewById(R.id.bot_nav);
BottomNavigationMenuView mbottomNavigationMenuView =
(BottomNavigationMenuView) mbottomNavigationView.getChildAt(0);
View view = mbottomNavigationMenuView.getChildAt(1);
BottomNavigationItemView itemView = (BottomNavigationItemView) view;
View cart_badge = LayoutInflater.from(this)
.inflate(R.layout._custom_cart_item_layout,
mbottomNavigationMenuView, false);
itemView.addView(cart_badge);
Output : Image
Hope it will work similar for you.
Thank you