Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
736ef94
Change default color for lines in maps
seadowg Jan 8, 2026
36fad66
Simplify MapIconCreator interface
seadowg Jan 9, 2026
ecd7772
Add convenience extension for create marker icon bitmaps
seadowg Jan 9, 2026
c825cc2
Add new specific icon for line points
seadowg Jan 9, 2026
12b6cd8
Fill center of shapes
seadowg Jan 9, 2026
b05cc7a
Make first point in polygon bigger
seadowg Jan 9, 2026
98c9d9b
Fix constructor use in tests
seadowg Jan 9, 2026
71dc983
Update default color tests
seadowg Jan 9, 2026
cdc6503
Fix assertions on MarkerIconDescription
seadowg Jan 9, 2026
6a76557
Correct method name
seadowg Jan 13, 2026
dff3c30
Update implementations
seadowg Jan 13, 2026
2b6491d
Store line points in GeoPolyFragment instead of in MapFragment
seadowg Jan 13, 2026
be829c4
Fix clear behaviour
seadowg Jan 14, 2026
b6c1276
Remove unneeded formatting for shape
seadowg Jan 14, 2026
29b7bb3
Switch to using polygons with map for shapes
seadowg Jan 14, 2026
8415fc2
Don't use new API for Google and Mapbox
seadowg Jan 14, 2026
7e585a2
Highlight last point rather than first
seadowg Jan 14, 2026
d5f30e7
Remove add/remove methods for poly points
seadowg Jan 15, 2026
3d90579
Store LocationTracker location in Flow
seadowg Jan 15, 2026
b45e310
Expose location as StateFlow
seadowg Jan 15, 2026
7d09ee0
Remove unused field
seadowg Jan 15, 2026
0f8d2f2
Use ViewModel for points state
seadowg Jan 15, 2026
e576fa6
Use LocationTracker to schedule location recording
seadowg Jan 15, 2026
91b0bea
Fix whitespace issue
seadowg Jan 15, 2026
6ae1adb
Add updatePolyLine method
seadowg Jan 15, 2026
d0281d4
Add updatePolygon method
seadowg Jan 15, 2026
2774e36
Simplify feature description constructor calls
seadowg Jan 15, 2026
055f227
Highlight last point with different color
seadowg Jan 15, 2026
f3147e3
Update fake
seadowg Jan 15, 2026
3e07038
Clean up unneeded code
seadowg Jan 15, 2026
d508feb
Break up single line
seadowg Jan 19, 2026
974898f
Rename method
seadowg Jan 19, 2026
a63222a
Rename class
seadowg Jan 19, 2026
f3c1845
Remove double save to cache
seadowg Jan 19, 2026
46f0155
Correct whitespace
seadowg Jan 19, 2026
16eabc9
Fix formatting
seadowg Jan 19, 2026
2164907
Correct typo
seadowg Jan 19, 2026
72a978f
Use isNotEmpty
seadowg Jan 19, 2026
f6ded2d
Use last()
seadowg Jan 19, 2026
35ae10e
Remove redundant let
seadowg Jan 19, 2026
e6d579d
Remove redundant alpha setting
seadowg Jan 19, 2026
0b63d63
Only update map when points updated
seadowg Jan 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove redundant let
  • Loading branch information
seadowg committed Jan 19, 2026
commit 35ae10e437458d7ffe1ee266f2cedf75ef9fac5e
18 changes: 8 additions & 10 deletions geo/src/main/java/org/odk/collect/geo/geopoly/GeoPolyViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,15 @@ class GeoPolyViewModel(
viewModelScope.launch {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We've talked off and on about whether to use coroutines directly like this (as opposed to through our Scheduler interface) - especially with ViewModels as it gives us viewModelScope. I can't immediately think of a benefit to using Scheduler here as this work is dispatched on the UI thread, so there's no need to integrate with IdlingResource for Espresso. That said, as far as I can tell, there are no tests for the automatic location recording. I'll backfill those as a follow up and see how this fits in.

locationTracker.getLocation().collect {
if (it != null) {
accuracyThreshold.let { threshold ->
if (threshold == 0 || it.accuracy <= threshold) {
add(
MapPoint(
it.latitude,
it.longitude,
it.altitude,
it.accuracy.toDouble()
)
if (accuracyThreshold == 0 || it.accuracy <= accuracyThreshold) {
add(
MapPoint(
it.latitude,
it.longitude,
it.altitude,
it.accuracy.toDouble()
)
}
)
}
}
}
Expand Down