Skip to content

This is a example for the implementation navigation jetpack with bottom navigation.

Notifications You must be signed in to change notification settings

iMoya917/BottomNavigationWithJetpackNavigation

Repository files navigation

BottomNavigationWithJetpackNavigation

This is a example for the implementation navigation jetpack with bottom navigation.

Start

The first thing you should know is how the Navegation Jetpack works. The basic idea of this new navigation, is that we have a resource called NavGraph, which can contain a set of fragments that connect to each other, with it we have a visual way of seeing the navigation that the application will have.

Captura de pantalla 2019-06-02 a la(s) 19 58 18

This NavGraph for them to work must be implemented inside a navHost, which is a component that allows you to visualize a navGraph and have all its features (actions, OnBackPress, Animations, etc).

How does it work this project?

In this project this Navigation Jetpack will be used through a bottomNavigation, which each item will have its own navigation and maintain it when changing items.

Diagrama en blanco

As mentioned before, for a navGraph to work you must add it inside a navHost, this navHost is not created as a resource inside the xml, but is created dynamically depending on which item was selected.

Captura de pantalla 2019-06-02 a la(s) 19 36 37

As you can see in the image, each time you select an item you create or search for a navHost and insert the navGraph associated with the item. Once you get this navHost is replaced in a frameLayout to be displayed.

Everything else, navigation, actions, animations, etc, must be created or managed within the navGraph.

About

This is a example for the implementation navigation jetpack with bottom navigation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages