Comments (7)
Ah yea that makes sense..It wouldn't be good for the dialog to trigger every time the user tries to move the pin. I think it sounds good that once they drop the pin and move it around to the exact location and then pressing "next" has the dialog come up.
from ground-android.
Thank you so much @rawbzz for the leniency! This is the rare occasion when taking the simpler approach doesn't detract from the UX :).
Makes sense, @gino-m. SubmitDataUseCase
is where we extract the final LOI data from the LOI task of a given job in addLocationOfInterest()
, so the challenge will be to figure out how to pipe the LOI name into here for property construction.
- Edit: Turns out that the "challenge" is to simply pass in a new variable from
DataCollectionViewModel
sinceinvoke
is called fromDataCollectionViewModel
!
For 2), we will want to save the loiName
to the local DB alongside loiID
in DraftSubmissionEntity
where it can be recovered in draft state. I will also use a new saveState
key, TASK_LOI_NAME_KEY
to handle fragment refresh etc.
from ground-android.
Edit on 1) I found success in intercepting the "next" click handler on the AbstractTaskFragment
, detecting whether the task is an LOI task and open the dialog, set the LOI name on the linked DataCollectionViewModel
from the AbstractTaskFragment
. From there it seems to work as intended!
from ground-android.
@rawbzz ok to trigger the LOI name dialog after the user clicked "Next" for the reasons @sufyanAbbasi mentions above?
In terms of implementation, that all sounds good with one delta - iirc SubmitDataUseCase represents the user hitting the "submit" button at the end of the data collection flow. The data collection flow keeps internal state with all the user responses, I assume the LOI name would belong in there until the data collection flow is completed.
from ground-android.
Requested by @lecrabe. Added to the next milestone after field testing.
from ground-android.
Had a chance to discuss the solution with @shobhitagarwal1612, who gave me some implementation details to consider. I found that the code complexity increases substantially when the dialog is to be triggered inside of the *TaskFragment
(i.e. capture location, point, and polygon tasks), in between when the location is captured but before hitting next while the user has a chance to undo. I would avoid retriggering the dialog every time the user wants to undo the location, since adjusting the pin requires a lot of microadjustments. What if instead, we trigger the dialog after the user hits "Next", before moving on to the next task? That way, the user can adjust the location without retriggering the dialog and allow the user to go back to the LOI task if they decide they want to rename, making sure to load the previously selected name into the dialog. Here is a quick implementation sketch:
- Use
Composable
dialogs to create the dialog, instead of using XML -> Fragment -> ViewModel system. - Trigger the dialog in
DataCollectionViewModel
and save the LOI data in a persistent manner. - Send the LOI data to
SubmitDataUseCase
where it will be saved locally then later sent remotely.
WDYT, @gino-m?
from ground-android.
That makes sense based on my fuzZy recollection. If you like, send a scratch PR so we can discuss in context!
from ground-android.
Related Issues (20)
- [Sync] Zooms out 1-2 zoom levels each time an LOI is changed remotely
- [Sign in] Sign in fails silently when emu can't connect
- [ACLs] Add support for "shared" surveys
- [Code health] Restore tests deleted in #2383
- [UI Bug] Sign out confirmation dialog not Material 3 dialog
- [Capture location] Location permissions requested on wrong task HOT 3
- [Offline sync status] Duplicate entries shown in status screen
- [BLOCKING] User logged out when app killed
- [Code health] Define field names on DocumentReference objects, not converters
- [Data collection] Done button not showing when conditional task is final task HOT 1
- [Nav Drawer] Move user profile and sign out link into popup HOT 20
- [Code health] Migrate to docker images to Artifact Registry HOT 1
- [Select one - other] Disabling "other" option doesn't hide/disable "Other" text HOT 4
- [ACLs] Add custom text and link to sign up form HOT 6
- [Select one/many - Other] Focus on "other" text field when other option is selected
- [Survey list] Screen freezes while loading LOI on slower connections
- [Map] Pins don't cluster where there's only one LOI in a job
- App in an invalid state after being restored from background HOT 1
- [Bug] App crash in data collection screen HOT 2
- [Code health] Stop relying on index for determining position of a task
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ground-android.