Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DialogFragment and BottomDialogFragment as part of navigation stack, question #276

Open
uberchilly opened this issue Jun 21, 2023 · 2 comments

Comments

@uberchilly
Copy link

uberchilly commented Jun 21, 2023

Hello, I've read all of the other issues about this topic like #250
where you mentioned some solutions, btw is there a complete demo project with these solutions somewhere to be looked at? You also mentioned that you historically used for example BottomSheetDialogFragment with .show(fragmentManager) to simplify, but I am not sure how would you then bindServices to add dependencies for example for ViewModels that will be used for that BottomSheetDialogFragment or DialogFragment since they kind of live outside of the scoped services in that case, we could maybe connect that dialog to jetpack's ViewModel and inject global services from the application via factory but we then again have 2 different worlds of view models

@Zhuinden
Copy link
Owner

Zhuinden commented Jun 21, 2023

we could maybe connect that dialog to jetpack's ViewModel and inject global services from the application via factory but we then again have 2 different worlds of view models

In a real project, this is exactly what I did.

It was easier to reason about than making the DialogFragment dismiss update the backstack. Then again, I didn't actually try that approach.

@Zhuinden
Copy link
Owner

image

Even Jetpack Navigation has trouble making this work 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants