how can i use a Custom Bottom Navigation (Chip Navigation Bar) With Navigation Component

Viewed 18

So i have a project that am still building, i was using a normal bottom navigation with navigation component and it worked quite alright, but then i decided to use an external custom bottom nav bar called ChipNavigationBar and i am unable to link it with NavController.

so does anyone know how can i link my custom bottom nav with NavController?

here is my Main Activity code in case it's needed :

NavController navController;
ChipNavigationBar navigationBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    navigationBar = findViewById(R.id.bottomNavigationView);

    navController = Navigation.findNavController(this,R.id.nav_host_fragment_container);

    NavigationUI.setupWithNavController(navigationBar,navController);

    AppBarConfiguration appBarConfiguration = new AppBarConfiguration
            .Builder(R.id.trainingFragment,R.id.nutritionFragment,R.id.statisticsFragment).build();
0 Answers
Related