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

[CaptureLocation & DropPin task] Fix crashes on config change #2765

Merged
merged 30 commits into from
Oct 10, 2024

Conversation

anandwana001
Copy link
Collaborator

Complete Detail #2761

@anandwana001 anandwana001 linked an issue Sep 25, 2024 that may be closed by this pull request
gino-m and others added 5 commits September 25, 2024 11:48
…-support

# Conflicts:
#	ground/src/main/java/com/google/android/ground/ui/datacollection/tasks/polygon/DrawAreaTaskFragment.kt
…pport' into anandwana001/2764/task-config-support
@anandwana001
Copy link
Collaborator Author

@gino-m tried test

Idea was to mock the instance of drawAreaTaskMapFragment, so that whenever drawAreaTaskMapFragment.requireParentFragment() invokes, our mockDataCollectionFragment instance can be use and get the viewModel of DrawAreaTaskViewModel

but, not able to mock the instance of DrawAreaTaskMapFragment.

@gino-m
Copy link
Collaborator

gino-m commented Sep 27, 2024

@gino-m tried test

Idea was to mock the instance of drawAreaTaskMapFragment, so that whenever drawAreaTaskMapFragment.requireParentFragment() invokes, our mockDataCollectionFragment instance can be use and get the viewModel of DrawAreaTaskViewModel

but, not able to mock the instance of DrawAreaTaskMapFragment.

What about creating a real instance of the parent fragment instead of the child as we do now, and configuring that instead? Could that work?

…upport

# Conflicts:
#	ground/src/main/java/com/google/android/ground/ui/datacollection/DataCollectionFragment.kt
#	ground/src/main/java/com/google/android/ground/ui/datacollection/DataCollectionViewPagerAdapter.kt
#	ground/src/main/java/com/google/android/ground/ui/datacollection/tasks/polygon/DrawAreaTaskFragment.kt
#	ground/src/main/java/com/google/android/ground/ui/datacollection/tasks/polygon/DrawAreaTaskMapFragment.kt
#	ground/src/test/java/com/google/android/ground/HiltExt.kt
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 73.07692% with 7 lines in your changes missing coverage. Please review.

Project coverage is 60.89%. Comparing base (7d41026) to head (7adfdd1).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...tion/tasks/location/CaptureLocationTaskFragment.kt 80.00% 0 Missing and 2 partials ⚠️
...n/tasks/location/CaptureLocationTaskMapFragment.kt 50.00% 2 Missing ⚠️
...tacollection/tasks/point/DropPinTaskMapFragment.kt 50.00% 2 Missing ⚠️
.../datacollection/tasks/point/DropPinTaskFragment.kt 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2765      +/-   ##
============================================
- Coverage     60.90%   60.89%   -0.02%     
  Complexity     1162     1162              
============================================
  Files           265      265              
  Lines          6169     6175       +6     
  Branches        860      859       -1     
============================================
+ Hits           3757     3760       +3     
- Misses         1922     1924       +2     
- Partials        490      491       +1     
Files with missing lines Coverage Δ
...tacollection/tasks/polygon/DrawAreaTaskFragment.kt 59.25% <100.00%> (ø)
...ollection/tasks/polygon/DrawAreaTaskMapFragment.kt 26.31% <ø> (-0.96%) ⬇️
.../datacollection/tasks/point/DropPinTaskFragment.kt 57.77% <85.71%> (+4.11%) ⬆️
...tion/tasks/location/CaptureLocationTaskFragment.kt 93.33% <80.00%> (-2.97%) ⬇️
...n/tasks/location/CaptureLocationTaskMapFragment.kt 56.25% <50.00%> (-10.42%) ⬇️
...tacollection/tasks/point/DropPinTaskMapFragment.kt 38.46% <50.00%> (-11.54%) ⬇️

@anandwana001
Copy link
Collaborator Author

@gino-m ca we merge this?

@anandwana001 anandwana001 merged commit 3005856 into master Oct 10, 2024
4 checks passed
@anandwana001 anandwana001 deleted the anandwana001/2764/task-config-support branch October 10, 2024 23:18
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.

Config Change Support for CaptureLocation and DropPin Tasks
3 participants