Skip to content

Conversation

IanGClifton
Copy link
Contributor

@IanGClifton IanGClifton commented Dec 28, 2022

This eliminates all fragments in favor of navigating at the composable
level. I also updated the screen-level composables to take in explicit
lambdas rather than event handlers to follow best practices.

One notable change here is that there is no longer a fragment from which
to launch the camera. Instead, the PhotoQuestion uses
rememberLauncherForActivityResult and selfies are now stored in the
app's cache directory, which means no file permission is required.

Fixes #1038

@IanGClifton

This comment was marked as resolved.

@IanGClifton IanGClifton force-pushed the iangclifton/composenav branch from ace160e to c77fb01 Compare January 3, 2023 22:44
This eliminates all fragments in favor of navigating at the composable
level. I also updated the screen-level composables to take in explicit
lambdas rather than event handlers to follow best practices.

One notable change here is that there is no longer a fragment from which
to launch the camera. Instead, the PhotoQuestion uses
rememberLauncherForActivityResult and selfies are now stored in the
app's cache directory, which means no file permission is required.
@IanGClifton IanGClifton force-pushed the iangclifton/composenav branch from c77fb01 to d557d6a Compare January 4, 2023 18:54
@IanGClifton IanGClifton changed the title PREVIEW: [Jetsurvey] Changed to use Navigation Compose [Jetsurvey] Changed to use Navigation Compose Jan 4, 2023
@IanGClifton IanGClifton marked this pull request as ready for review January 4, 2023 19:00
@IanGClifton IanGClifton requested a review from a team as a code owner January 4, 2023 19:00
@arriolac arriolac self-requested a review February 14, 2023 22:31
Copy link
Contributor

@arriolac arriolac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How satisfying was it to remove all those Fragments?? 😛

I just had one comment about scoping the ViewModel within individual screens so that the NavHost doesn't need to concern itself with that logic.

val welcomeViewModel: WelcomeViewModel = viewModel(factory = WelcomeViewModelFactory())
WelcomeScreen(
onSignInSignUp = { email ->
welcomeViewModel.handleContinue(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this logic should be handled within WelcomeScreen and JetsurveyNavHost? This way, JetsurveyNavHost is only concerned with navigation events (i.e. once sign in/up completes and ViewModels would only be scoped within individual screens. Same comment for other screens.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I'll create a route composable for each route that has the logic for getting the view model and any setup needed for the individual screen.

Copy link
Contributor

@arriolac arriolac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@IanGClifton IanGClifton merged commit d34d19a into main Feb 17, 2023
@IanGClifton IanGClifton deleted the iangclifton/composenav branch February 17, 2023 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[JetSurvey]: Migrate to Compose navigation
2 participants