Giter Club home page Giter Club logo

Comments (7)

rawbzz avatar rawbzz commented on July 19, 2024 2

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.

sufyanAbbasi avatar sufyanAbbasi commented on July 19, 2024 2

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 since invoke is called from DataCollectionViewModel!

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.

Screenshot 2024-03-07 at 2 57 38 PM

from ground-android.

sufyanAbbasi avatar sufyanAbbasi commented on July 19, 2024 2

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.

gino-m avatar gino-m commented on July 19, 2024 1

@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.

gino-m avatar gino-m commented on July 19, 2024

Requested by @lecrabe. Added to the next milestone after field testing.

from ground-android.

sufyanAbbasi avatar sufyanAbbasi commented on July 19, 2024

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:

  1. Use Composable dialogs to create the dialog, instead of using XML -> Fragment -> ViewModel system.
  2. Trigger the dialog in DataCollectionViewModel and save the LOI data in a persistent manner.
  3. Send the LOI data to SubmitDataUseCase where it will be saved locally then later sent remotely.

image

WDYT, @gino-m?

from ground-android.

gino-m avatar gino-m commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.