ismacil jama
ismacil jama

Reputation: 69

Remove bottom Navigation when navigate to new Fragment

i have bottom Navigation, i navigate new Fragment from bottom click but Bottom Navigation is not removed to the new fragment

navigate new fragment

edit_flow.setOnClickListener {

            findNavController().navigate(R.id.action_navigation_home_to_flowFragment)

}

i want to remove the bottom Navigation when launching FlowFragment

see the image

Upvotes: 3

Views: 575

Answers (1)

A.R.B.N
A.R.B.N

Reputation: 1155

on the Host Activity, after bind NavControler, Try this:

 navController.addOnDestinationChangedListener { _, destination, _ ->
        when (destination.id) {
            R.id.yourFragment-> bottomNavigationMain.visibility = View.GONE
                .
                .
                .
            else -> bottomNavigationMain.visibility = View.VISIBLE
        }
    }

in here. yourFragment should not show ButtonNavigationMenu. the other fragments will have it visible.

Upvotes: 3

Related Questions