Convert GeoPointMapActivity to Fragment#7253
Conversation
89e5e17 to
eb1223a
Compare
GeoPointMapActivity to Fragment
|
Tested with success! Verified on a device with Android 10 Verified cases:
|
|
Tested with success Verified on Android 16 |
| import org.odk.collect.testshared.getOrAwaitValue | ||
|
|
||
| @RunWith(AndroidJUnit4::class) | ||
| class GeoPointMapDialogFragmentTest { |
There was a problem hiding this comment.
GeoPointMapDialogFragmentTest only covers the input configuration (configures GeoPointMapFragment with answer/draggable/readOnly), but none of the result-handling logic in onCreateFragment/onAnswer is tested. Compared to the sibling GeoPolyDialogFragmentTest there are some cases missing.
There was a problem hiding this comment.
Agreed, but I don't think we've lost any coverage compared to the GeoPointMapActivityTest right? I'd rather follow up with back-filling here.
There was a problem hiding this comment.
Agreed it's not a regression vs GeoPointMapActivityTest. But the result-handling in onCreateFragment (the REQUEST_GEOPOINT listener: onAnswer vs dismiss, empty → null) is new logic that's untested, and
GeoPolyDialogFragmentTest already covers the equivalent. Fine to back-fill in a separate PR.
Work towards #7118
Why is this the best possible solution? Were any other approaches considered?
We ideally want to be showing the geo point map UI within
FormFillingActivityso that we don't have to deal with passing reference geometry between Activity objects. Like with geopoly questions, I've converted it to aDialogFragment.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
This significantly restructures the way geopoint with
maps/placement-mapsworks, so we'll want to test this feature thoroughly. No changes to how maps work has been made, so this only needs to be tested with one source/style.Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest(or./gradlew testLab) and confirmed all checks still passDateFormatsTest