# navigation-component

Published articles for navigation-component.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Navigation-Compose and Fragments in Jetpack Compose: Experience and Trade-offs

DevFeed: [Navigation-Compose and Fragments in Jetpack Compose: Experience and Trade-offs](<https://devfeed.tech/articles/why-using-navigation-compose-in-your-jetpack-compose-app-is-a-bad-idea-25523.md>)

Original publisher: [Read original article](<https://patrykkosieradzki.com/why-using-navigation-compose-in-your-jetpack-compose-app-is-a-bad-idea>)

Published: 2022-02-13T00:00:00Z

Content type: opinion

Language: en

Sources: [Patryk Kosieradzki](<https://devfeed.tech/sources/patryk-kosieradzki.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [navigation](<https://devfeed.tech/topics/navigation.md>), [Android](<https://devfeed.tech/topics/android.md>), [Compose](<https://devfeed.tech/topics/compose.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [navigation-component](<https://devfeed.tech/tags/navigation-component.md>), [opinion](<https://devfeed.tech/tags/opinion.md>)

### AI overview

The article compares Navigation-Compose with Fragments for navigation in Jetpack Compose applications. Based on the author's experience, it discusses concerns about route paths and navigation arguments, while presenting the author's opinion on the trade-offs of each approach.

### Source excerpt

Navigation Compose issues that will break your Android app and how to avoid them.

## Introducing Navigation-Material 

DevFeed: [Introducing Navigation-Material ](<https://devfeed.tech/articles/introducing-navigation-material-25967.md>)

Original publisher: [Read original article](<https://jossiwolf.medium.com/introducing-navigation-material-%EF%B8%8F-a19ed5cc33fd?source=rss-8efc0359e234------2>)

Author: Jossi Wolf

Published: 2021-08-04T19:01:30Z

Content type: release

Language: en

Sources: [Stories by Jossi Wolf on Medium](<https://devfeed.tech/sources/stories-by-jossi-wolf-on-medium.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [Compose](<https://devfeed.tech/topics/compose.md>), [Library](<https://devfeed.tech/topics/library.md>), [releases](<https://devfeed.tech/topics/releases.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [bottomsheet](<https://devfeed.tech/tags/bottomsheet.md>), [compose](<https://devfeed.tech/tags/compose.md>), [experimental](<https://devfeed.tech/tags/experimental.md>), [extension](<https://devfeed.tech/tags/extension.md>), [fragments](<https://devfeed.tech/tags/fragments.md>), [getting-started](<https://devfeed.tech/tags/getting-started.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [libraries](<https://devfeed.tech/tags/libraries.md>), [library](<https://devfeed.tech/tags/library.md>), [material-design](<https://devfeed.tech/tags/material-design.md>), [navigation-component](<https://devfeed.tech/tags/navigation-component.md>), [new-feature](<https://devfeed.tech/tags/new-feature.md>), [releases](<https://devfeed.tech/tags/releases.md>)

### AI overview

This article introduces Navigation Material, an Accompanist library that adds modal bottom sheet destinations to Navigation Compose. It explains the library's experimental status and provides setup steps using BottomSheetNavigator, NavController, ModalBottomSheetLayout, and the bottomSheet function.

### Source excerpt

Illustration by Ana Teresa Silva from the lovely We Are Systematic. Thank youuuuuu❤✨ Navigation-Compose (well, kinda) has an exciting new feature: Support for bottom sheet destinations! Over the past (almost) 6 months, I worked on a library in collaboration with the Navigation team that offers support for Modal Bottom Sheets in Navigation Compose. Navigation with Fragments has long supported DialogFragments, and with today's release of the Navigation Material library, we are providing the same feature for composable bottom sheets with Navigation Compose. Since modal bottom sheets are still an experimental Compose-Material API, the library will be released as part of Accompanist, a collection of extension libraries for Jetpack Compose. All AndroidX libraries, Navigation and Compose included, follow strict semantic versioning as explained on the AndroidX releases page. This means that any API that isn't experimental is set in stone once a library goes to its Release Candidate (RC) phase. It would take a major version bump (i.e., a '2.0') to make breaking API changes to these stable APIs. - Ian Lake about the versioning system of AndroidX libraries Because of the versioning requirements for AndroidX libraries, Navigation Material will be offered as part of Accompanist, just like navigation-animation. Think of it as an incubator until the bottom sheet APIs are fully grown up! Enough of the talking -- let's look at how you can use it! Getting started! Navigation Material is fresh out of the oven, built off today's release of Navigation 2.4.0-alpha06! There are a few easy steps to get started: Create a BottomSheetNavigator using the rememberBottomSheetNavigator() function Add the BottomSheetNavigator to your NavController Wrap your existing NavHost in the ModalBottomSheetLayout composable provided by Navigation Material. If you don't have a NavHost yet, we'll create one! Now you're ready to define bottom sheet destinations using the new bottomSheet function! Let's go thro

## Providing AssistedInject supported ViewModel for Composable using Hilt

DevFeed: [Providing AssistedInject supported ViewModel for Composable using Hilt](<https://devfeed.tech/articles/providing-assistedinject-supported-viewmodel-for-composable-using-hilt-25742.md>)

Original publisher: [Read original article](<https://blog.shreyaspatil.dev/providing-assistedinject-supported-viewmodel-for-composable-using-hilt/>)

Author: Shreyas Patil

Published: 2021-06-29T14:52:48Z

Content type: tutorial

Language: en

Sources: [Shreyas Patil's Blog](<https://devfeed.tech/sources/shreyas-patil-s-blog.md>)

Topics: [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Dagger](<https://devfeed.tech/topics/dagger.md>), [Android](<https://devfeed.tech/topics/android.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [navigation](<https://devfeed.tech/topics/navigation.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [compose](<https://devfeed.tech/tags/compose.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dagger-hilt](<https://devfeed.tech/tags/dagger-hilt.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [di](<https://devfeed.tech/tags/di.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [interface](<https://devfeed.tech/tags/interface.md>), [java](<https://devfeed.tech/tags/java.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-coding](<https://devfeed.tech/tags/learn-coding.md>), [navigation-component](<https://devfeed.tech/tags/navigation-component.md>)

### AI overview

This tutorial explains how to provide an AssistedInject-supported ViewModel for Jetpack Compose using Hilt. It describes AssistedInject runtime parameters and an EntryPoint-based approach for accessing the ViewModel factory because Hilt does not directly support this use case.

### Source excerpt

Learn how to provide Hilt ViewModels with AssistedInject to Jetpack Compose Composables for dynamic dependency injection with runtime parameters.

## Creating a BottomNavigation Multi-Stack using Child Fragments with Jetpack Navigation

DevFeed: [Creating a BottomNavigation Multi-Stack using Child Fragments with Jetpack Navigation](<https://devfeed.tech/articles/creating-a-bottomnavigation-multi-stack-using-child-fragments-with-jetpack-navigation-25934.md>)

Original publisher: [Read original article](<https://zhuinden.medium.com/creating-a-bottomnavigation-multi-stack-using-child-fragments-with-jetpack-navigation-5d4c24ea6f4f?source=rss-7a8d96da8cb6------2>)

Author: Gabor Varadi

Published: 2021-02-26T06:14:32Z

Content type: tutorial

Language: en

Sources: [Stories by Gabor Varadi on Medium](<https://devfeed.tech/sources/stories-by-gabor-varadi-on-medium.md>)

Topics: [Jetpack](<https://devfeed.tech/topics/jetpack.md>), [navigation](<https://devfeed.tech/topics/navigation.md>), [Framework](<https://devfeed.tech/topics/framework.md>)

Tags: [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [bottom-navigation](<https://devfeed.tech/tags/bottom-navigation.md>), [bottomnavigationview](<https://devfeed.tech/tags/bottomnavigationview.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-navigation](<https://devfeed.tech/tags/jetpack-navigation.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [navigation-component](<https://devfeed.tech/tags/navigation-component.md>), [screen](<https://devfeed.tech/tags/screen.md>), [state](<https://devfeed.tech/tags/state.md>)

### AI overview

This tutorial explains how to implement bottom navigation with a separate Jetpack Navigation NavController and back stack for each tab. It uses child fragments, adding all tab fragments while detaching those that are not visible, and initializes each tab with its own navigation graph.

### Source excerpt

It's been a recurring question, regardless of navigation framework of choice: how is it possible to create a screen with a bottom navigation view, that would host a navigation history stack per each tab? Each framework has its own unique ways. For example, with Jetpack Navigation you might use the NavigationExtensions, which requires you to host the BottomNavigationView at the Activity-level. But how would you do it with Jetpack Navigation, in such a way that the BottomNavigationView is confined to a single child fragment, and that child fragment would host all tabs that each have a NavController (backstack) available to them? How bottom navigation with child fragments normally works If you intend to create a BottomNavigationView that is hosted by a Fragment (and that Fragment hosts each tab as a child fragment), there's a bit of work needed to be done. To keep the fragments alive while switching between them, they must all be added. However, to make sure that the fragments are in the correct lifecycle (stopped while not showing), it makes sense to detach them (and attach the one that is meant to be showing). https://medium.com/media/82eb957284cfe5def31160ac33d277ba/href This example is also available here. Please note that there is nothing specific to Jetpack Navigation in this snippet, this is how a fragment can manage its child fragments and keep only one of them attached, while the rest are detached. We will use this knowledge later in the article. What Jetpack Navigation normally does When you use Jetpack Navigation (using its XML-based DSL) you typically create a navigation.xml (typically 1 per compilation module, but multiple nav graphs + include can be used too), which is then given to a NavHostFragment in a FragmentContainerView. This is what allows the NavController to be initialized with a graph, and save/restore its state. https://medium.com/media/4cc60fc3c96786f7f9adcbb3a1053853/hrefCreating a NavController and backstack for each bottom navigation tab T