-
Notifications
You must be signed in to change notification settings - Fork 137
Added DrawGeometryTask #3421
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
base: master
Are you sure you want to change the base?
Added DrawGeometryTask #3421
Conversation
…sk' into anandwana001/3148/drawgeometrytask
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3421 +/- ##
============================================
- Coverage 69.92% 69.16% -0.77%
- Complexity 1599 1615 +16
============================================
Files 319 323 +4
Lines 8598 8768 +170
Branches 949 967 +18
============================================
+ Hits 6012 6064 +52
- Misses 2010 2122 +112
- Partials 576 582 +6
🚀 New features to boost your workflow:
|
shobhitagarwal1612
left a comment
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.
Please attach a screen recording as well to the description.
| if (obj is JSONObject) { | ||
| (obj as JSONObject).toCaptureLocationTaskData() | ||
| } else { | ||
| DataStoreException.checkType(String::class.java, obj) | ||
| val geometry = GeometryWrapperTypeConverter.fromString(obj as String)?.getGeometry() | ||
| DataStoreException.checkNotNull(geometry, "Missing geometry in draw geometry task result") | ||
| DataStoreException.checkType(Point::class.java, geometry!!) | ||
| DropPinTaskData(geometry as Point) | ||
| } |
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.
Can we define a new *taskData for DRAW_GEOMETRY data type?
Let's not reuse existing *taskData classes to prevent any confusions with legacy code.
| DrawGeometry( | ||
| task.drawGeometry.requireDeviceLocation, | ||
| task.drawGeometry.minAccuracyMeters, | ||
| ) |
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.
Looking at the proto, it also contains a allowed method field whose value can be one of "DROP_PIN" and "DRAW_AREA". Please add that field as well.
| */ | ||
| package org.groundplatform.android.model.task | ||
|
|
||
| data class DrawGeometry(val isLocationLockRequired: Boolean, val minAccuracyMeters: Float) |
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.
Please add ktdoc
| import org.groundplatform.android.util.renderComposableDialog | ||
|
|
||
| @AndroidEntryPoint | ||
| class DrawGeometryTaskFragment @Inject constructor() : |
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.
Please add some ktdoc
| @Inject lateinit var drawGeometryTaskMapFragmentProvider: Provider<DrawGeometryTaskMapFragment> | ||
|
|
||
| override fun onCreateTaskView(inflater: LayoutInflater): TaskView = | ||
| TaskViewFactory.createWithCombinedHeader(inflater, R.drawable.outline_pin_drop) |
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.
IIUC, this task should be able to choose between DROP_PIN and DRAW_AREA depending upon the proto field and should not always default to DROP_PIN.
Fixes #3148
This PR implements the new DrawGeometry task UI for Android, unifying the "Drop Pin" and "Capture Location" functionalities into a single, configurable task type. This change aligns the Android client with the updated DrawGeometry task model, allowing survey administrators to configure location lock requirements and accuracy thresholds.
Key Changes
Model & Schema:
UI Implementation:
Persistence:
Tests:
- Location lock enforcement logic.
- Correct generation of CaptureLocationTaskData vs. DropPinTaskData.
- Location lock flow initialization.
Verification
Automated Tests:
Manual Verification:
@shobhitagarwal1612 PTAL?