-
Notifications
You must be signed in to change notification settings - Fork 138
Move logic from SignInFragment to SignInScreen #3462
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Move startup initialization logic from `StartupFragment` to a new `StartupScreen` Composable. - Migrate error handling and progress dialog management from `StartupFragment` to `StartupViewModel` and `StartupScreen`. - Update `StartupViewModel` and `SignInViewModel` to use `@HiltViewModel` and remove manual bindings in `ViewModelModule`.
* Migrate `SignInViewModel` to use `@HiltViewModel`. * Move network error and loading state logic from `SignInFragment` to `SignInScreen` using `collectAsStateWithLifecycle`. * Implement `SnackbarHost` and `LoadingDialog` within the Compose `SignInScreen`. * Remove manual ViewModel instantiation and snackbar handling from `SignInFragment`. * Update `ViewModelModule` to remove manual binding for `SignInViewModel`.
The sign-in progress bar is now controlled by `SignInScreen`, so the `MainActivity`-managed modal spinner and associated logic are no longer needed.
9bf6ace to
8bd4b4c
Compare
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! Just a small suggestion
app/src/main/java/org/groundplatform/android/ui/signin/SignInScreen.kt
Outdated
Show resolved
Hide resolved
Removes manual check for sign-in state and network availability before calling `userRepository.signIn()`.
The test case "Sign-in button should be enabled when network is not available" is removed as manual network availability checks have been moved out of the UI layer.
The sign-in progress dialog is no longer managed by `MainActivity`, making these tests obsolete.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3462 +/- ##
============================================
- Coverage 70.07% 70.02% -0.06%
+ Complexity 1613 1604 -9
============================================
Files 322 322
Lines 8634 8646 +12
Branches 951 949 -2
============================================
+ Hits 6050 6054 +4
- Misses 2007 2017 +10
+ Partials 577 575 -2
🚀 New features to boost your workflow:
|
andreia-ferreira
approved these changes
Jan 21, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Towards #1795
Similar to #3461, this PR aims at moving remaining business logic from the fragment to it's compose screen.
This would allow us to later switch to Jetpack Compose Navigation to allow for screens to be reused for iOS without having to maintain separate view screens for iOS.
Screen_recording_20260121_105250.webm
@andreia-ferreira PTAL?