# jetpack-navigation

Android Jetpack Navigation is a framework and set of libraries for navigating between destinations in Android applications.

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

## Build for every screen with the latest Jetpack Compose updates from Android Developer Summit

DevFeed: [Build for every screen with the latest Jetpack Compose updates from Android Developer Summit](<https://devfeed.tech/articles/build-for-every-screen-with-the-latest-jetpack-compose-updates-from-android-developer-summit-118936.md>)

Original publisher: [Read original article](<https://developer.android.com/blog/posts/build-for-every-screen-jetpack-compose-updates>)

Author: Rebecca Gutteridge

Published: 2026-11-04T00:00:00Z

Content type: release

Language: en

Sources: [Android Developers](<https://devfeed.tech/sources/android-developers-blog.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [Large Screen](<https://devfeed.tech/topics/large-screen.md>), [Android](<https://devfeed.tech/topics/android.md>), [mobile-ui-design](<https://devfeed.tech/topics/mobile-ui-design.md>), [Jetpack](<https://devfeed.tech/topics/jetpack.md>), [jetpack-navigation](<https://devfeed.tech/topics/jetpack-navigation.md>), [deeplinks](<https://devfeed.tech/topics/deeplinks.md>), [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [cameraX](<https://devfeed.tech/topics/camerax.md>)

Tags: [adaptive](<https://devfeed.tech/tags/adaptive.md>), [adaptive-development](<https://devfeed.tech/tags/adaptive-development.md>), [android](<https://devfeed.tech/tags/android.md>), [build](<https://devfeed.tech/tags/build.md>), [car](<https://devfeed.tech/tags/car.md>), [compose](<https://devfeed.tech/tags/compose.md>), [developer](<https://devfeed.tech/tags/developer.md>), [development](<https://devfeed.tech/tags/development.md>), [device](<https://devfeed.tech/tags/device.md>), [displays](<https://devfeed.tech/tags/displays.md>), [ecosystem](<https://devfeed.tech/tags/ecosystem.md>), [events-programs](<https://devfeed.tech/tags/events-programs.md>), [foldables](<https://devfeed.tech/tags/foldables.md>), [googlebook](<https://devfeed.tech/tags/googlebook.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [latest](<https://devfeed.tech/tags/latest.md>), [screen](<https://devfeed.tech/tags/screen.md>), [summit](<https://devfeed.tech/tags/summit.md>), [the-latest](<https://devfeed.tech/tags/the-latest.md>), [with](<https://devfeed.tech/tags/with.md>)

### AI overview

The Compose 1.13 stable release is planned to add adaptive Grid and Flexbox layouts, Progressive Blur, and Formatted Text; the excerpt also describes a rewritten BasicTextField using TextFieldState and a buffer-driven architecture to avoid IME race conditions and support rich-text editing. Jetpack AppState, in alpha, extends Compose snapshot state into app architecture: Transform derives reactive state from State and Flow inputs, while StateStore shares observable keyed state across app surfaces and can persist it with DataStore. Navigation 3 version 1.2 adds type-safe deep links using Kotlin Serialization and supports custom argument parsing and synthetic back stacks. The excerpt also highlights Compose input support for trackpads, mice, and physical controls, adaptive multi-pane layouts using Navigation 3 and WindowManager, and Android skills for agent-assisted adaptive work, performance, XML migration, and Ink. These are summit highlights from the supplied excerpt, not a complete account of all sessions or announcements.

### Source excerpt

The Android ecosystem is a multi-device reality that spans phones, foldables, tablets, wearables, in-car displays, XR, and Googlebook. In this landscape, adaptive development is foundational to reaching users wherever they are.

## Using Navigation 3 with Compose Multiplatform

DevFeed: [Using Navigation 3 with Compose Multiplatform](<https://devfeed.tech/articles/using-navigation-3-with-compose-multiplatform-25199.md>)

Original publisher: [Read original article](<https://johnoreilly.dev/posts/navigation3-cmp/>)

Published: 2025-11-15T00:00:00Z

Content type: tutorial

Language: en

Sources: [John O'Reilly](<https://devfeed.tech/sources/john-o-reilly.md>)

Topics: [compose-multiplatform](<https://devfeed.tech/topics/compose-multiplatform.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [jetpack-navigation](<https://devfeed.tech/topics/jetpack-navigation.md>), [navigation](<https://devfeed.tech/topics/navigation.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>)

Tags: [adaptive](<https://devfeed.tech/tags/adaptive.md>), [android](<https://devfeed.tech/tags/android.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-for-desktop](<https://devfeed.tech/tags/compose-for-desktop.md>), [compose-multiplatform](<https://devfeed.tech/tags/compose-multiplatform.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [jetbrains](<https://devfeed.tech/tags/jetbrains.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [keys](<https://devfeed.tech/tags/keys.md>), [layout](<https://devfeed.tech/tags/layout.md>), [list](<https://devfeed.tech/tags/list.md>), [manage](<https://devfeed.tech/tags/manage.md>), [mapping](<https://devfeed.tech/tags/mapping.md>), [material3](<https://devfeed.tech/tags/material3.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [project](<https://devfeed.tech/tags/project.md>), [sample](<https://devfeed.tech/tags/sample.md>), [stack](<https://devfeed.tech/tags/stack.md>)

### AI overview

The article shows Navigation 3 in the shared code of a Compose Multiplatform sample, using JetBrains-maintained versions of the library. Navigation is managed through a back stack: app keys map to content, and destinations are opened or removed by adding or removing entries. The setup includes Navigation 3 core UI and Material3 Adaptive Navigation3 dependencies, plus top-level routes. For an adaptive list/detail layout, the example creates a navigation strategy and passes it to the relevant component; the layout adjusts as the window size changes. The excerpt says this works on Desktop, Android, and iOS, and points to the Navigation 3 Code recipes repository for other use cases.

### Source excerpt

Navigation 3 is a new Compose based navigation library from Google that's designed with ease of use and flexibility in mind.

## Tiamat -- simple Compose Multiplatform navigation

DevFeed: [Tiamat -- simple Compose Multiplatform navigation](<https://devfeed.tech/articles/tiamat-simple-compose-multiplatform-navigation-26016.md>)

Original publisher: [Read original article](<https://medium.com/mobilepeople/tiamat-simple-compose-multiplatform-navigation-3956dc00a607?source=rss-e93d234beac6------2>)

Author: Yahor Urbanovich

Published: 2024-02-29T12:52:22Z

Content type: tutorial

Language: en

Sources: [Yahor Urbanovich](<https://devfeed.tech/sources/stories-by-yahor-urbanovich-on-medium.md>)

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

Tags: [api](<https://devfeed.tech/tags/api.md>), [app](<https://devfeed.tech/tags/app.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-multiplatform](<https://devfeed.tech/tags/compose-multiplatform.md>), [controller](<https://devfeed.tech/tags/controller.md>), [critical](<https://devfeed.tech/tags/critical.md>), [data](<https://devfeed.tech/tags/data.md>), [data-types](<https://devfeed.tech/tags/data-types.md>), [deep](<https://devfeed.tech/tags/deep.md>), [deep-dive](<https://devfeed.tech/tags/deep-dive.md>), [demo](<https://devfeed.tech/tags/demo.md>), [developers](<https://devfeed.tech/tags/developers.md>), [examples](<https://devfeed.tech/tags/examples.md>), [experiments](<https://devfeed.tech/tags/experiments.md>), [features](<https://devfeed.tech/tags/features.md>), [first](<https://devfeed.tech/tags/first.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [simple](<https://devfeed.tech/tags/simple.md>)

### AI overview

Tiamat is presented as a Compose Multiplatform navigation library built around screen instances rather than string keys. Its examples show defining destinations with `navDestination`, creating a controller, and navigating with `navigate`, `replace`, or `back`; typed `navArgs` pass data to screens, while `back` can return a result. The article also demonstrates nested controllers, editable back stacks, and a library-provided `TiamatViewModel` with configuration-change state saving and `viewModelScope`. It positions Tiamat as a simpler fit for the authors' project than their earlier Google Navigation Compose wrapper, and says Voyager lacked lambda parameters while Decompose felt too complex for that project. A multiplatform demo is mentioned; advanced cases such as bottom-bar navigation and custom transitions are pointed to in the sample app rather than explained here.

### Source excerpt

generated by Bing image creatorTiamat - simple Compose Multiplatform navigationIntro Why do we need another navigation library? You can say: just choose one of the existing solutions. For our project initially, we have chosen the Google Navigation Compose library. It was quite simple for developers who still migrated their minds to the new "Compose world". For some time we made a wrapper around the navigation library, to simplify access to the Navigation controller from any Compose screen. LocalNavController returns the current controller in composition Despite various improvements in navigation, we had a lot of critical moments that did not satisfy us: Navigation using String key A difficult way to pass data between screens Navigation only over replace We have experimented with some other libraries: Voyager -- it doesn't update very often (recently got status 1.0), no possibility to pass lambda as a parameter (issue) Decompose -- a too complex framework for our project. By the way, I use it on personal projects and recommend to try 🌚 other solutions overengeenered (by our opinion) Our requirements To reach a goal, we first need to understand what we are striving for. Here is what we expect from the navigation library: Compose first support + Multiplatform Simple API: Screeen creation, back stack handle, add/replace methods Navigation using Screen instance without any String keys A simple way to save State of the screen Pass Any data types between screens (even lambdas) and deliver the result Without code generation Without tying to any architecture or existing frameworks Welcome Tiamat We were so impressed with our internal library that we decided to make it open-source for Compose community. After several months of experiments and polishing the code we fit all our requirements above. Let's deep dive into code examples. Also, we have created a demo multiplatform App to demonstrate all current features. Please checkout the repository 🌚iOS, Desktop, Android sampleHow t

## Organize your Views: Jetpack Compose edition

DevFeed: [Organize your Views: Jetpack Compose edition](<https://devfeed.tech/articles/organize-your-views-jetpack-compose-edition-25573.md>)

Original publisher: [Read original article](<https://www.marcogomiero.com/posts/2023/organize-view-compose-edition/>)

Author: Marco Gomiero

Published: 2023-03-15T00:00:00Z

Content type: article

Language: en

Sources: [Posts on Marco Gomiero](<https://devfeed.tech/sources/posts-on-marco-gomiero.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [jetpack-navigation](<https://devfeed.tech/topics/jetpack-navigation.md>), [compose-multiplatform](<https://devfeed.tech/topics/compose-multiplatform.md>)

Tags: [compose](<https://devfeed.tech/tags/compose.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [jetpack-navigation](<https://devfeed.tech/tags/jetpack-navigation.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [organization](<https://devfeed.tech/tags/organization.md>)

### AI overview

Compose lets MoneyFlow define UI in Kotlin alongside the rest of the app, avoiding XML-to-code bridging, but large composables and stateful components can make a growing codebase hard to maintain. The author describes slimming Jetpack Compose Navigation's central NavHost by delegating screen composable creation to factories, which can live in feature modules and hide implementation details. The excerpt begins describing a structure with one Kotlin file per screen but cuts off before explaining it further.

### Source excerpt

One of the pros of Jetpack Compose (in the rest of the article, I will just call it Compose, for brevity), and generally of declarative UI frameworks, is the capability of defining the UI with the same programming language the rest of the application uses. With Compose, it is not necessary anymore to bridge the UI definitions from XML (e.g. with the [in]famous findViewById), resulting in less context switching between two different environments (XML and Kotlin code).

## Jetpack Compose clear back stack, popBackStack inclusive explained

DevFeed: [Jetpack Compose clear back stack, popBackStack inclusive explained](<https://devfeed.tech/articles/jetpack-compose-clear-back-stack-popbackstack-inclusive-explained-25849.md>)

Original publisher: [Read original article](<https://medium.com/@banmarkovic/jetpack-compose-clear-back-stack-popbackstack-inclusive-explained-14ee73a29df5?source=rss-8aced922ece------2>)

Author: Ban Markovic

Published: 2023-01-03T10:31:50Z

Content type: tutorial

Language: en

Sources: [Ban Markovic](<https://devfeed.tech/sources/stories-by-ban-markovic-on-medium.md>)

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

Tags: [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [compose](<https://devfeed.tech/tags/compose.md>), [inclusive](<https://devfeed.tech/tags/inclusive.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [navigation](<https://devfeed.tech/tags/navigation.md>)

### AI overview

With Jetpack Compose navigation, `navigate(route)` adds a destination to the back stack, while `popBackStack()` removes the top destination. Passing a route and `inclusive` to `popBackStack` removes destinations above that route and optionally the route itself; if the route is absent, nothing closes. To clear the stack without knowing its first screen, the text says to pop to the root navigation graph, using its route or graph ID. It recommends `popUpTo` over `popBackStack` for this purpose because `popBackStack` must be followed by navigation to avoid an empty stack.

### Source excerpt

Jetpack Compose clear back stack, popUpTo/popBackStack inclusive explained Building the navigation for our Android app that is built with Jetpack Compose requires usage of navigation-compose library that is provided by Android team. In order to master closing the screens and tracking our back stack state, it is important to understand the stack data structure that is used for this purpose. Before we can close multiple screens, we need to open them. That's why I decided to separate this article into three sections that represent the most common ways used when navigating through apps: Opening a new screen, Closing current screen, Closing multiple screens at once. Open new screen Navigating from one to another screen is pretty straightforward using navigation-compose lib, we can just use NavHostController and call navigate(...) function with the route as parameter. This will lead into creating a new screen, that is going to be placed on top of our current screen. Example Let's say we have our Login screen opened, and after successful email and password input, we want to load Home screen, our stack would look like this. Close current screen Apart from navigating to a new screen, closing the currently opened one is also a pretty common action in navigation. To achieve this, we can use popBackStack() function from our NavHostController. As the name of the function suggests, it will take the top screen from the stack, and it will remove it. Example Removing our Home screen by calling the popBackStack function will make our stack look like this. Close multiple screens The past two examples were pretty simple, but I wanted to make sure that we understand how navigation-compose lib is storing the data regarding the order of our opened screens. When it comes to closing multiple screens, we can actually use an already known function, popBackStack, but we will need to pass two parameters: route -- represents the destination (screen) that already exists in our stack, and it will ena

## Show BottomBar conditionally in Compose

DevFeed: [Show BottomBar conditionally in Compose](<https://devfeed.tech/articles/show-bottombar-conditionally-in-compose-22663.md>)

Original publisher: [Read original article](<https://www.valueof.io/blog/should-show-bottombar-conditionally-in-jetpack-compose>)

Author: James Shvarts

Published: 2022-11-08T21:38:12Z

Content type: tutorial

Language: en

Sources: [Android Blog - Mobile Dev Notes](<https://devfeed.tech/sources/android-blog-mobile-dev-notes.md>)

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

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

### AI overview

The Jetpack Compose example hides the bottom bar on selected routes by checking the current route against an enum, with a custom AppState handling navigation and visibility. It uses a separate navigation graph for each tab and demonstrates navigating from a Home list to an item detail screen, whose route omits the bar. The sample leaves out Google's animated bottom bar and focuses on the navigation and conditional display setup. The excerpt mentions message handling and a failure-triggered case, but omits the implementation details.

### Source excerpt

Conditionally show BottomBar with bottom navigation in Jetpack Compose

## Why Using Navigation-Compose in Your Jetpack Compose App is a Bad Idea

DevFeed: [Why Using Navigation-Compose in Your Jetpack Compose App is a Bad Idea](<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-navigation](<https://devfeed.tech/topics/jetpack-navigation.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [app](<https://devfeed.tech/tags/app.md>), [arguments](<https://devfeed.tech/tags/arguments.md>), [code](<https://devfeed.tech/tags/code.md>), [compose](<https://devfeed.tech/tags/compose.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [fragment](<https://devfeed.tech/tags/fragment.md>), [fragments](<https://devfeed.tech/tags/fragments.md>), [google](<https://devfeed.tech/tags/google.md>), [graph](<https://devfeed.tech/tags/graph.md>), [jetpack](<https://devfeed.tech/tags/jetpack.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [library](<https://devfeed.tech/tags/library.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [navigation-component](<https://devfeed.tech/tags/navigation-component.md>), [react](<https://devfeed.tech/tags/react.md>), [rendering](<https://devfeed.tech/tags/rendering.md>), [route](<https://devfeed.tech/tags/route.md>), [screen](<https://devfeed.tech/tags/screen.md>)

### AI overview

The author questions whether Navigation Compose is a good fit for Jetpack Compose apps, comparing it with using Fragments for navigation and Compose for rendering. They describe Navigation Compose as replacing Fragment destinations with NavBackStackEntry entries in a composable NavHost graph. In the excerpt, the main criticism is route paths: developers must maintain path structure, parameter order and values, or define screen constants, which the author says adds setup work. The excerpt begins contrasting this with Fragments and Safe Args, where XML declares arguments and generated code supplies typed arguments when navigating. It ends before explaining how those arguments are retrieved or giving the author's final recommendation.

### Source excerpt

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

## 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: [Gabor Varadi](<https://devfeed.tech/sources/stories-by-gabor-varadi-on-medium.md>)

Topics: [jetpack-navigation](<https://devfeed.tech/topics/jetpack-navigation.md>), [bottom-navigation](<https://devfeed.tech/topics/bottom-navigation.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>), [fragments](<https://devfeed.tech/tags/fragments.md>), [graph](<https://devfeed.tech/tags/graph.md>), [history](<https://devfeed.tech/tags/history.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>), [stack](<https://devfeed.tech/tags/stack.md>)

### AI overview

The excerpt describes hosting a bottom navigation view inside a parent fragment while maintaining a separate Jetpack Navigation back stack for each tab. The parent adds all tab fragments to keep them alive, then detaches hidden tabs and attaches the active one so only it remains active. For each tab, the approach creates a fragment host with its own NavController and navigation graph, supplied as an argument; the excerpt cuts off before detailing navigation within those child stacks.

### 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

## Creating a BottomNavigation Multi-Stack using child Fragments with Simple-Stack

DevFeed: [Creating a BottomNavigation Multi-Stack using child Fragments with Simple-Stack](<https://devfeed.tech/articles/creating-a-bottomnavigation-multi-stack-using-child-fragments-with-simple-stack-25935.md>)

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

Author: Gabor Varadi

Published: 2021-01-25T17:03:22Z

Content type: tutorial

Language: en

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

Topics: [bottom-navigation](<https://devfeed.tech/topics/bottom-navigation.md>), [jetpack-navigation](<https://devfeed.tech/topics/jetpack-navigation.md>)

Tags: [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [bottom-navigation](<https://devfeed.tech/tags/bottom-navigation.md>), [bottomnavigationview](<https://devfeed.tech/tags/bottomnavigationview.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [fragments](<https://devfeed.tech/tags/fragments.md>), [history](<https://devfeed.tech/tags/history.md>), [jetpack-navigation](<https://devfeed.tech/tags/jetpack-navigation.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [simple-stack](<https://devfeed.tech/tags/simple-stack.md>)

### AI overview

For a Simple-Stack bottom navigation setup with a separate history per tab, a parent fragment hosts child fragments and keeps them alive by adding them, then detaches the hidden tabs and attaches the selected one. Simple-Stack's usual Navigator.install() provides one Activity-wide Backstack with automatic lifecycle management; separate Backstacks inside each tab require managing their lifecycle and retention across configuration changes yourself. The excerpt introduces a fragment to retain each stack and intercept back presses for the selected tab, and notes using fragment lifecycle callbacks and ScopedServices to manage nested stacks and expose stack hosts. The supplied text ends before the implementation details.

### 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, Jetpack Navigation provides NavigationExtensions as a sample, there's FragNav, but how would you do it with Simple-Stack? 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/1667d9733c198c3ae611fd45504f6bd0/href This example is also available here. Please note that there is nothing specific to Simple-Stack 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. In fact, the NavigationAdvancedSample works the same way. We will use this knowledge later in the article. What Simple-Stack normally does When you use Simple-Stack, you typically install a Navigator using Navigator.install(). This allows a single global Backstack instance to be accessible through the Activity's context (and thus making it available to all views within the Activity), and provides automatic lifecycle management to ensure that navigation is handled correctly. https://medium.com/media/03bde713eca4e7ef47d7dae31f6e095d/href This is important to know, because if we want to create a Backstack for each Fragment within our BottomNavigationView, we must manage the lifecycle (and keep the Backstack instance alive across configuration changes) ourselves. Thankfully, this is actually quite simple to do! After all, frag

## Jetpack Compose -- Before and after

DevFeed: [Jetpack Compose -- Before and after](<https://devfeed.tech/articles/jetpack-compose-before-and-after-24926.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/jetpack-compose-before-and-after-8b43ba0b7d4f?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2020-12-15T13:54:19Z

Content type: comparison

Language: en

Sources: [Chris Banes on Medium](<https://devfeed.tech/sources/chris-banes-on-medium.md>)

Topics: [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [jetpack-navigation](<https://devfeed.tech/topics/jetpack-navigation.md>), [Compose Compiler](<https://devfeed.tech/topics/compose-compiler.md>), [material-components](<https://devfeed.tech/topics/material-components.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>)

Tags: [2020](<https://devfeed.tech/tags/2020.md>), [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [apk](<https://devfeed.tech/tags/apk.md>), [build](<https://devfeed.tech/tags/build.md>), [compose](<https://devfeed.tech/tags/compose.md>), [epoxy](<https://devfeed.tech/tags/epoxy.md>), [fragments](<https://devfeed.tech/tags/fragments.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [material](<https://devfeed.tech/tags/material.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [migration](<https://devfeed.tech/tags/migration.md>), [modules](<https://devfeed.tech/tags/modules.md>), [motionlayout](<https://devfeed.tech/tags/motionlayout.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [parallelism](<https://devfeed.tech/tags/parallelism.md>), [processing](<https://devfeed.tech/tags/processing.md>)

### AI overview

Migrating Tivi's UI to Jetpack Compose over about 11 months reduced XML source lines by 76%; the author also reports lower APK size and method count, and a 29% shorter build time. The migration proceeded screen by screen across 46 pull requests, first keeping Fragments and AndroidX Navigation, then moving to Navigation Compose. The build comparison used five offline, rerun Gradle builds on a high-end workstation throttled to 1.2 GHz with four workers. The entirely Compose build was 25 seconds faster than the Fragments-plus-Compose build, but the author attributes that difference to a newer Dagger/Hilt version and its use of the AGP 7.0 ASM API, not Compose. These figures are not a controlled apples-to-apples comparison: feature work, dependency updates, and changing Gradle, AGP, Kotlin, and beta Compose versions may affect results. The excerpt omits underlying metric tables, so it does not establish exact APK-size values.

### Source excerpt

Jetpack Compose -- Before and afterHow the build speed, APK size and source line count changed after migrating the Tivi sample app to Jetpack Compose This post has been updated since it was first published, to new include updated stats for Jetpack Compose 1.0.0-rc01. If you would like to see the original version of this post, see here. In 2020, I began the task of slowly migrating the UI in Tivi to be written in Jetpack Compose, and roughly 12 months later it is now complete. 🎉 In this blog post, we'll take a look back and compare a number of key metrics to see how well Compose compares in: APK size, build speed and lines of code. The app Before I go any further into the Compose side of things, let me quickly describe the app. Tivi is pretty heavily modularized, with each UI 'screen' in its own Gradle module (named ui-$NAME). Each of those screens was implemented in a Fragment, and then pieced together using AndroidX Navigation in the main app module. To give you an idea of the structure, here's a graph of the modules in the app: Graph of Tivi's module structure. Generated using Jake Wharton's handy Gradle task Most of the fragments had no knowledge of each other, since the navigation graph was implemented using deep link URIs, ensuring decoupling. Perhaps more importantly, it also allows independent module compilation which aids build parallelism. Note: the module structure of Tivi is not perfect by any means. There are too many dependencies of UI modules (at the top) to base modules (at the bottom). Ideally each layer should be seperated. Something for me to work on. Before I started the migration to Compose, Tivi used all the cool 🌈 UI 💫 things available to Android developers: Data Binding, Epoxy, Material Design Components, Insetter DBX, MotionLayout to name a few. But unfortunately most of these came with a build cost since they use annotation processing. Process of migrating Earlier I mentioned that we had just completed the 'first stage' of the migration, so w

## Back to basics: Screens

DevFeed: [Back to basics: Screens](<https://devfeed.tech/articles/back-to-basics-screens-26001.md>)

Original publisher: [Read original article](<https://medium.com/@nhaarman/back-to-basics-screens-5f15992ba796?source=rss-fceb7a60a849------2>)

Author: Niek Haarman

Published: 2018-09-30T19:10:45Z

Content type: article

Language: en

Sources: [Niek Haarman](<https://devfeed.tech/sources/stories-by-niek-haarman-on-medium.md>)

Topics: [UI/UX Design](<https://devfeed.tech/topics/ui-ux-design.md>), [User Interfaces](<https://devfeed.tech/topics/user-interfaces.md>), [User interface design](<https://devfeed.tech/topics/ui-design.md>), [jetpack-navigation](<https://devfeed.tech/topics/jetpack-navigation.md>), [business logic](<https://devfeed.tech/topics/business-logic.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [business-logic](<https://devfeed.tech/tags/business-logic.md>), [lifecycle](<https://devfeed.tech/tags/lifecycle.md>), [screen](<https://devfeed.tech/tags/screen.md>), [state](<https://devfeed.tech/tags/state.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

A screen is a presentation-layer destination for a specific use case; business logic such as processing use cases, calculations, and network fetching belongs elsewhere. The excerpt treats lifecycle callbacks as useful for starting data retrieval when a screen becomes active, registering UI listeners when visible, stopping them when replaced, and cleaning up when destroyed. It also identifies a responsibility split: Activities handle lifecycle events but also inflate the UI. Because Android may kill an app process to reclaim memory, non-trivial screens need to save enough state to be restored, potentially including view hierarchy state or an item ID. The supplied excerpt ends during the state-saving discussion.

### Source excerpt

In a previous article, I talked about things that are wrong with the Activity class, the main conclusion being that it does too much. This time I want to look at an alternative way of looking at the concept of screens, stepping away from the design flaws of the Activity class. What is a screen? In a typical mobile application, the user can navigate from one destination to another. Each of these destinations can be regarded as a 'screen': a set of components that fulfill a very specific use case. For example, the main screen of a Twitter client may show a list of tweets to the user. The notion of 'screen' here is very much tied to the presentation layer of the application: when talking about screens, you're inevitably talking about UI and navigating through them. This means that business logic, such as processing use cases, calculating values and fetching network results has nothing to do in there. The lifecycle A lot of people have difficulties grasping the concept of the Activity lifecycle, but this part is one thing the Activity (somewhat) did right. When a screen becomes active in the application, it may want to start calling use cases in the business layer to retrieve some data. When it becomes visible to the user, it may want to register listeners to the UI to react to events. When it is replaced by another screen, it may need to stop listening for updates, and when it is destroyed (by popping it from a back stack for example), it may need to do some cleanup. Lifecycle callbacks are an excellent way to go and handle these scenarios. The user interface Usually, screens have something to show to the user. A screen may gather the data to show and pass this to the user interface, which uses this data and turns it in something visual for the user to interact with. This is one case where the Activity violates the single responsibility principle: next to handling lifecycle events, it is also responsible for inflating the user interface. Saving state Android's multitas