915 questions
3
votes
1
answer
146
views
Jetpack Compose navigate failed when start an activity from a notification
My app has a modal navigation drawer to navigate between home page and target page.
I tried to launch the app and navigate to the target page by tapping a notification containing a deeplink intent, ...
2
votes
2
answers
135
views
Jetpack Compose: potential race condition when the user navigates
It is common that onClick lambdas (call methods that) perform viewModelScope.launch { ... }. I see a possible race condition here, the viewModelScope may be cancelled before the launched action is ...
2
votes
1
answer
349
views
How to track screen views in Jetpack Compose using Google Analytics?
In the previous XML-based Android development, it was relatively straightforward to track screen views in Google Analytics by using separate activities for each screen.
Now that I’m using Jetpack ...
1
vote
1
answer
297
views
How to convert Drawables to ImageVector to use as custom icons for NavigationBar?
I've been learning android app development the past week and I'm trying to set custom icons for the navigation bar at the bottom of the screen. The NavItems data class is given below:
package com....
1
vote
2
answers
193
views
ViewModel#onCleared not called anymore in Navigation3
I just updated the dependencies for:
androidx-navigation3-runtime = { module = "androidx.navigation3:navigation3-runtime", version.ref = "nav3Core" }
androidx-navigation3-ui = { ...
0
votes
1
answer
55
views
What is the right way to instantiate a ViewModel inside a Tab Fragment and scope it to the parent navigation destination?
I'm using Navigation Component + Hilt DI. I have a Navigation Destination Fragment which hosts a viewpager with 2 fixed fragments. What is the right way to Instantiate the ViewModels within those ...
0
votes
0
answers
102
views
How to implement per screen TopAppBar and BottomAppBar in Jetpack Compose?
I have my composable MainNavHost which controls the navigation as shown using the new Navigation 3 library. The Scaffold here has my TopAppBar and BottomAppBar for navigating between the 4 major ...
0
votes
0
answers
23
views
Kotlin navigation controller [duplicate]
I've successfully implemented jetpack component and that is navigation controller.
I'm encoutering an issue where fragments are recreated when navigating back to previoud fragment.
Does anyone know ...
0
votes
0
answers
159
views
How to manage focus (and restore it) between TVLazyRow/LazyRow and focusable buttons in Android TV app?
I am developing an Android TV app using Jetpack Compose and D-pad navigation.
My main screen UI looks like this:
A Column as the main container
The first item is a TVLazyRow or a normal LazyRow (...
0
votes
0
answers
61
views
How can I open files from other apps in my app at a specific screen using Jetpack Compose Navigation?
So I have configured intent-filters in the manifest of the app, my app can be opened from other file browser/explorer apps
class MainActivity : ComponentActivity() {
override fun onCreate(...
1
vote
1
answer
113
views
Check what screen a NavHost is currently on [duplicate]
Is there a way to know what screen a NavHost is currently on using the new Navigation in Jetpack compose,
The route of the backstackentry returns the serialized form of the screen but I haven't found ...
0
votes
2
answers
120
views
Unable to pass args to nested start destination in jetpack compose
I'm using the latest version of Jetpack Compose with type-safe arguments for navigation library. I have a nested navigation structure, and I need to pass a parameter to the start destination of a ...
2
votes
0
answers
87
views
Type-Safe Navigation with Nested Graphs, NavigationBar, and Inclusive PopUp in Jetpack Compose
Is there a proper example of type-safe navigation with nested graphs where one of the graphs includes a NavigationBar with its own screens, and an auth/splash/onboarding screen is removed from the ...
0
votes
1
answer
65
views
androidx.navigation with compose : pass arguments thru nested graphs with typeSafe
this is my nav graph
NavHost(navController, startDestination = Splash) {
composable<Splash> { SplashScreen(navController) }
navigation<Home>(startDestination = Editor) {
...
2
votes
2
answers
388
views
Navigation in multi-module Compose project
I have a multi-module compose project where I am still trying to define how the navigation should be done. As far as I know, the following key concepts need to be taken into account (correct me if I ...
3
votes
1
answer
362
views
How to pop multiple screens back to a screen that receives a parameter in Jetpack Compose with type safety?
I have a screen that receives a parameter. From this screen, I navigate to multiple other screens, and eventually, I want to return to the initial screen. However, since the initial screen requires a ...
0
votes
0
answers
32
views
Open a sub screen with full dimension from Bottom Navigation Bar
I'm in certain situation where the problem seems hard to find proper answers, hope you guys can help me.
MainScreen contains a Bottom Navigation, which has an Explore tab. This tab displays the movie ...
0
votes
1
answer
104
views
How to communicate between Composables in Jetpack Compose
I have MainScreen(). On click on MainScreen() button ModalBottomSheet1() is opened. On click on ModalBottomSheet1() button ModalBottomSheet2() is opened (over first one). Shortly: MainScreen() -> ...
0
votes
1
answer
175
views
Jetpack Compose shared bounds background transparency
I am trying out the relatively new Modifier.sharedBounds() in Jetpack Compose to animate between a Card and the next screen, which is a Scaffold.
The problem is, that the background of the Card fades ...
0
votes
2
answers
236
views
How to Set Default Values for Navigation Arguments in Jetpack Compose's Type-Safe Navigation?
I recently started using the new type-safe navigation feature in Jetpack Compose. Previously, I could pass default values for navigation arguments like this:
class WalletGiftDetailLandingArgs(
...
9
votes
1
answer
560
views
How to implement "Swipe to Go Back" in iOS with Compose Multiplatform?
I'm working on a project using Compose Multiplatform (version 1.7.3), and I'm looking to implement the "Swipe to Go Back" functionality for navigation in iOS side.
Here are some details:
...
0
votes
0
answers
86
views
Why is my NavHost recomposing and causing a navigation loop in Jetpack Compose? [duplicate]
I'm experiencing an issue with my Jetpack Compose application where the NavHost is continuously recomposing and causing a navigation loop. Below is a simplified version of my code to demonstrate the ...
3
votes
1
answer
171
views
How to make navigation works inside a sheet without having two Navcontrollers and hosts
I have an app with regular screens and then it shows a sheet, and the sheet can open multiple screen in it
How can I do this inside a single navhost?
The only way I was able to do it while obviously ...
4
votes
1
answer
2k
views
Jetpack compose navigation passing custom object with Kotlin DSL
I am trying type safety in Kotlin DSL and Navigation Compose but it looks like it is not working as expected, following is my code:
Screens:
@Serializable
data object SelectMenuNav
@Serializable
data ...
0
votes
0
answers
137
views
Compose TypeSafe Navigation - save state of ViewModel
I'm using Compose TypeSafe navigation for my application.
This is one of the extension function called in NavHost
private fun NavGraphBuilder.loginNavigation(navController: NavHostController) {
...
0
votes
0
answers
78
views
Jetpack Compose Navigation navigate build backstack when navigating
I have the following nested graph:
@Serializable private data object Onboarding
@Serializable private data object OnboardingScreen1
@Serializable private data object OnboardingScreen2
@Serializable ...
2
votes
1
answer
623
views
How to pass data to nested navigation of Jetpack Compose Type-Safe Navigation?
I have two nested graph group and group details.
Group details graph has 3 screens, which need userId.
How do I pass data to the nested navigation? Without directly calling the first screen or other ...
0
votes
0
answers
394
views
Android Compose with Navigation - DeepLink with full URI
I’m using Jetpack Navigation with Compose in my application, and I need to parse a URI that can originate from two different sources:
1. A QR code scanned internally within the app.
2. A deep link.
...
1
vote
2
answers
129
views
How to test navigation in Jetpack Compose on user click?
I have an app where I have 2 screens:
NavHost(
navController = navController,
startDestination = UserListScreen
) {
composable<UserListScreen> {
UserListScreen(
...
3
votes
0
answers
51
views
How to Properly Handle Navigation and Back Stack Logic in Jetpack Compose Navigation?
I need an implementation that follows this navigation pattern. For example, there are screens a, b, c, and d. The navigation sequence is a > b > d > c > b > d. When we are on screen d ...
0
votes
0
answers
57
views
Separate content and title in Compose Multiplatform
I am making a Compose Multiplatform App and want to organize my layout based on the platform and screen size.
I would like this layout on mobile :
And this one for desktop :
But the toolbar is ...
0
votes
0
answers
33
views
Is it possible to use NavDeepLinkBuilder to build a explicit deep link based on serializable route?
The current NavDeepLinkBuilder seemingly only supports setDestination(id: int) or setDestination(id: String). I'm using navigationCompose = "2.8.0".
I tried to use MyRoute::class.serializer()...
0
votes
1
answer
1k
views
Jetpack Compose Navigation - Adding custom NavType results in immediate return to startDestination
I'm having a strange issue using Jetpack Navigation for Compose when using a custom NavType. Library is updated to 2.8.4, my code is based off of this tutorial:
https://medium.com/mercadona-tech/type-...
0
votes
0
answers
37
views
Is is possible to pass annotation class as a arguments to compose navigation?
Is is possible to pass this as an arguments to compose navigation?
Now I stil used navigation xml to change from page to another one
I would like to change to navigation compose but I am not sure that ...
0
votes
0
answers
83
views
Jetpack navigation: How to update ViewModel on dialog close?
I'm working on a simple SoundBoard app to get familiar with Jetpack Compose and Navigation. I'm fairly new to both technologies and am struggling with this:
Main view in the app is a grid-like view of ...
2
votes
0
answers
36
views
Navigating to a top level destination doesn't save all toplevel states
Problem
There are three navigation graphs in my app as nested navigations : HomeGraph, ProfileGraph and MenuGraph. I want to achieve that when you navigate between these graphs through the ...
0
votes
1
answer
132
views
how to handle Back Navigation Logic for Horizontal View Pager with Nested Sub-Screens in Jetpack Compose?
How to write a logic for Horizontal view pager screens I have 4 main screen and in this 4 screen each screen has multiple screen or view depends how logic fits because there is a also back button in ...
0
votes
1
answer
63
views
Getting error for startDestination gives error in Wear Navigation Compose with type safety
How to use Navigation library in Wear compose with type safety version. The SwipeDismissableNavHost's startDestination propety doesn't accept Any value like NavHost.
Used Dependency for wear ...
1
vote
1
answer
119
views
Setting up bottom nav view with navController causes view model cleared when back pressed
My current version of navigation is:
implementation("androidx.navigation:navigation-fragment-ktx:2.8.0")
implementation("androidx.navigation:navigation-ui-ktx:2.8.0")
...
1
vote
2
answers
465
views
How to check if the current destination is top level in Jetpack Compose type-safe navigation?
I have a multibackstack navigation graph where each starting node for the bottom navigation is top level.
How can I check if I am currently in the top level destination in order to adjust the display ...
0
votes
1
answer
160
views
Using setFragmentResultListener in activity
My container activity handles navigation in some cases like this:
fun navigate(directions: NavDirections, extras: Navigator.Extras? = null) {
extras?.let { navController.navigate(...
2
votes
1
answer
238
views
Jetpack compose type-safe navigation - navigate usage
I`m still learning Jetpack Compose and now trying to migrate from string-based routes navigation to new APIs following this article.
Before I used something like:
@Composable
fun HomeScreen(
...
...
2
votes
0
answers
75
views
Compose: Triggering Navigation callback from Composable with state changes causing infinite calls on navigation
I have Splash screen (or any other Screen) which is calling API and changing state from Loading to Finished or Failed.
This is my UiModel:
@Immutable
data class SplashUiModel(
var state: ...
1
vote
1
answer
89
views
How to implement Tabbed Layout with Navigation Compose Deep linking
Leveraging the latest support for type safe navigtion in Compose , how can I implement deep linking in a tabbed layout UI that would look something like this:
The important bit is the content scrolls ...
3
votes
1
answer
66
views
Can't send integer value from one screen to other
I am trying to send the Id of one of my object from one screen to other but I don't know why it is not getting the correct Id. When I seperately try to understand the navigation concept and made a ...
1
vote
1
answer
279
views
How to solve FocusRequester is not initialized?
I'm working on three pages: StartPage, LoginPage, and SignupPage, and I'm integrating them into a HorizontalPager.
In the SignupPage, i'm using requestFocus on textField.
The navigation flow is Start -...
1
vote
0
answers
113
views
How to make whole immersive view visible all the time, when having multiple immersive views on Android TV using Jetpack Compose?
I work on Android TV app using Jetpack Compose. I follow the Guide and I want to make a page with multiple immersive views. I also want to be able to change focus from one to other immersive view and ...
0
votes
1
answer
38
views
Android navigation graph removes on back press to much from stack
I start to use the Navigation Components library and created a graph to navigation between different fragments. My basic setup is a BottomNavigationView with two Fragments (A and B). Fragment B can go ...
1
vote
1
answer
136
views
NavHost composable accepts string as argument for startDestination, but providing serialized object is not accepted like in official post on android
I am facing an issue while using the code snippet from https://developer.android.com/guide/navigation/design#compose
@Serializable
object Profile
@Serializable
object FriendsList
val navController = ...
1
vote
1
answer
517
views
How to prevent a Composable from allowing clicks or scroll events to pass through
Basically, I have two Box composables:
A red box that occupies the full screen.
A green box with a higher zIndex, which makes it appear on top of the red one:
The issue:
When I click somewhere over ...