Комментарии:
The solution I was looking for, thanks a lot, Philipp! I love your videos
ОтветитьSorry, i have followed you for a while since i learn jetpack compose. Maybe you can give the view result everytime you make the tutorial hehe
ОтветитьI don't know why, all of your videos which is adding some new implements like lifecycle or something
like this video and calculator
I can't build anything really
it always has an error for duplicated implements
I think there is a prob with your impllements,
can you check them?
Please make video nested nav with compose destinations libs. Thank you
ОтветитьI was using 2.5.3 version, now when I want to update to 2.7.2 am facing some issues, is there any major changes need to be done?
ОтветитьHi Philipp, Once User Successfully Logged in, For Calendar Route Can we use One More NavHost with NavController()
ОтветитьOnly A few do it right.
ОтветитьI wonder is there any changes on how we use Hilt on Jetpack?
ОтветитьHow can I add ViewModelFactory?
backStackEntry.sharedViewModel<MyViewModel>( navController = navController, factory = MyViewModelFactory())
Or create one under composable and set a link to each one
Doesn't work, graph need
ОтветитьWe need another video for nested navigation
ОтветитьThanks Philip for another wonderful video. I have a question, what if I want to share a Koin view model instead of normal view model. How the sharedViewModel function should look like? I tried to solve it with scopes, but couldn't find the soultion:
`
@Composable
inline fun <reified T : ViewModel> NavBackStackEntry.sharedViewModel(
navController: NavController
): T {
val navGraphRoute = destination.parent?.route ?: return koinViewModel()
val parentEntry = remember(this) {
navController.getBackStackEntry(navGraphRoute)
}
val scope = rememberUpdatedState(KoinJavaComponent.getKoin().getScope(parentEntry.id))
return scope.value.get<T>()
}
`
Thank you for this video. Sharing the view model between the screens in the nested graph was EXACTLY what I was trying to figure out.
ОтветитьWhy would you need the helper function if you use dependency injection and already have a instance of the viewmodel created?
ОтветитьThanks for the video, you rock. Very efficient.
I didn't find a good practive to navigate from the view model.
For example, on the login screen, when you click on the login button, it will trigger a flow that emit loadings ui state then a success state at the end, how to navigate then?
- sol 1 : pass a nivagateTo...() lambda function to the @composable screen and check the state in the @composable screen (when uistate is Success, navigateTo...())
- sol 2 : pass a lambda function to the view model and call it from there
- sol 3 : the third and best solution
Any idea to achieve that properly?
The video is good, but it's a bit of a shame not to check the results
ОтветитьI fixed this example and added UI elements, the PR is available in Philitps' Repo for this video
Ответитьi searched everywhere for this and your videos always helped me, thank you!
Ответитьbtw standard jetpack navigation for Compose just is pain
ОтветитьRight at the best moment. Thanks, Philipp, you are amazing!
ОтветитьI use a different approach when I want to use a shared view model and have no more than two screens.
1. Create an enum class and a compose mutableState variable using that enum. Dont forget to wrap it in remember block.
2. Declare a when condition passing in that variable and calling your screen composables based on the changing value of the state variable.
3. Change the state in callback lambdas on however you want to navigate through screens.
Edit:-
4. You can use BackHandler composable to redirect system Back button callback to your Composables callback lambdas.
Didn't you say your going to use the destinations library going forward instead of the awful accompanist one?
ОтветитьHi, Is there any library or sdk that can help to measure a distance from object. not asking for measure a object.
for example: how do i know how far i am from a particular object
if you have any suggestion let me know
You can popUpTo(0) or other id or route that your app doesn’t have to remove all the backStack
ОтветитьHi Philipp. Thank you for great video. Hope we will see such a videos too long time.
ОтветитьHow would you handle the case when start destination of the graph accepts optional arguments, since you are navigating to "auth" and not, lets say, login?email={email}
ОтветитьNeed your with an android studio project but can't find your email in the about section. Please
ОтветитьQuite interesting video !! Thanks for that. Does it mean you don't use anymore this dependency (raamcosta/compose-destinations) in your projects ?
ОтветитьHi Philipp! How to prevent involuntary recomposition ? 1) Same "fragment" on the screen many recomposition 2) When i navigate to other screen all prev screens recompose . Is this ok ? Can you please provide any fix usign states (HomeState like in your videos ) ? Thanks
ОтветитьWie gewohnt toller Content der mir direkt wieder weiter hilft! Noch ein kleiner Verbesserungsvorschlag: Eine Grafik, die den gesamten Prozess schematisch darstellt kann hier wohlmöglich noch für weitere Klarheit sorgen. Ich persönlich würde vermutlich auch jedem Nested Graph seine eigene file geben, da es in größeren Programmen für mich schnell unübersichtlich wird. Dann kann man schon in der Ordnerstruktur ablesen, welche Graphs es gibt. Wohlmöglich korrelieren die dann sogar mit Feature Modulen und helfen bei der Übersicht über das Projekt ✌
ОтветитьUpdate all the playlists
Add your recent videos to the corresponding playlist
I will be helpful for beginners like me to understand all the topics
I was really thinking of implemetning this in a project I'm working on. Thanks for this man
ОтветитьHow about a video where you show us how to properly update all dependencies in gradle!? :)
ОтветитьWhat about navigation between screens with topbar + bottomNavBar and full-size screens? Full size screens might be located in another NavHost which is 'above' the NavHost with screens with top-bottom bars. But then, how would it be possible to navigate from parent NavHost to child NavHost?
ОтветитьHi can you do a video on toolchains? Very confusing topic.
ОтветитьHow does this work with deeplink?
ОтветитьNice video! 🚀
ОтветитьNice video as always,
ОтветитьVery informative and helpful tutorial
ОтветитьIt would be great if it was illustrated with a sample demo
ОтветитьHi Philipp, could you share how to go to specific screen in other nested graph from another nested graph?
ОтветитьHi Philipp, please show us navigation with bottombar(bottom navigation view). It has two navGraph. Managing these is a problem. Make a video about it.
ОтветитьJust on time for another great guide! I was not aware that it is possible to pop the whole navigation graph using the graph route. I've been using the start destination route for poping the back stack the whole time. 😅
ОтветитьGood
ОтветитьHi Philipp, though I understood the whole video and it's context but I just think it would have been a little better if you could have added some pictorial demonstration of the navigation which you are taking as an example. Great content as usual!
Ответить