Use Fragment for geopoly UI#6985
Merged
grzesiek2010 merged 26 commits intogetodk:masterfrom Dec 11, 2025
Merged
Conversation
1a6c4ed to
26ae3f7
Compare
bb2ef6d to
10b47a4
Compare
seadowg
commented
Dec 9, 2025
| import org.odk.collect.material.MaterialFullScreenDialogFragment | ||
| import kotlin.reflect.KClass | ||
|
|
||
| abstract class WidgetAnswerDialogFragment<T : Fragment>( |
Member
Author
There was a problem hiding this comment.
I imagine pretty soon we'll want this to be more general so that the "child" view doesn't have to be a Fragment (and allow Composables etc). I thought it'd be better to wait for that to be needed than try and anticipate the ideal structure now though.
seadowg
commented
Dec 9, 2025
| public class GeoPolyActivity extends LocalizedActivity implements GeoPolySettingsDialogFragment.SettingsDialogCallback { | ||
| public static final String EXTRA_POLYGON = "answer"; | ||
| public static final String OUTPUT_MODE_KEY = "output_mode"; | ||
| public class GeoPolyFragment extends Fragment implements GeoPolySettingsDialogFragment.SettingsDialogCallback { |
Member
Author
There was a problem hiding this comment.
I've not converted this to Kotlin yet as I haven't really had to touch much of the implementation. We should convert before adding in the new UI though.
grzesiek2010
requested changes
Dec 11, 2025
geo/src/test/java/org/odk/collect/geo/geopoly/GeoPolyFragmentTest.kt
Outdated
Show resolved
Hide resolved
geo/src/main/java/org/odk/collect/geo/geopoly/GeoPolyFragment.java
Outdated
Show resolved
Hide resolved
geo/src/main/java/org/odk/collect/geo/geopoly/GeoPolyFragment.java
Outdated
Show resolved
Hide resolved
...ct_app/src/main/java/org/odk/collect/android/widgets/items/SelectOneFromMapDialogFragment.kt
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/widgets/utilities/GeoPolyDialogFragment.kt
Show resolved
Hide resolved
...ect_app/src/test/java/org/odk/collect/android/widgets/utilities/GeoPolyDialogFragmentTest.kt
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/widgets/utilities/GeoPolyDialogFragment.kt
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/widgets/utilities/GeoPolyDialogFragment.kt
Show resolved
Hide resolved
46da6af to
98cc919
Compare
grzesiek2010
approved these changes
Dec 11, 2025
|
Tested with Success! Verified on Androids: 10 and 16 (by WIktor) Verified cases:
|
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
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.
Work towards #6969
Why is this the best possible solution? Were any other approaches considered?
To make it easier for the geopoly UI to access the form to deal with constraints, I pulled it into a Fragment that could be hosted by a shared "widget answer dialog" component (
WidgetAnswerDialogFragment) that "select one from map" also uses.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?
There should be no changes in behaviour here other than that I'd expect #6984 to affect
geotrace/geoshapeas well now. The main thing to look at here is the geopoly question UI to check that there are no regressions. I think for the moment we can hold off on testing in different map engines.Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest(or./gradlew testLab) and confirmed all checks still passDateFormatsTest