Skip to content
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

Geo: Use one activity for GeoTrace and GeoShape. #2933

Merged
merged 16 commits into from
Mar 13, 2019

Conversation

zestyping
Copy link
Contributor

@zestyping zestyping commented Mar 4, 2019

Issues: Closes #1084. Closes #1085. Closes #2868. Makes progress on #1028.
Risk: High (two activities)
Code scope: Geo widgets and activities
UX scope: GeoTrace, GeoShape
Doc updates needed: getodk/docs#968

Requested reviewers: @cooperka

User-visible changes

GeoTrace:

  • There is a new option for data entry, "Tap to place points," that allows the users to add points directly by tapping on the map. Because this does not depend on GPS, the "Add marker" button (first button) is enabled always, not only when there is a GPS lock.
  • The "Save as Polygon" / "Save as Polyline" dialog now has a warning, indicating that the option to save as a polygon will soon be removed.

GeoShape:

  • This activity now looks like GeoTrace, except that it edits and saves a polygon. Thus, it is possible to create a polygon by recording GPS locations. Also, you don't have to long-press every point to draw a polygon; you can simply tap.

Notes for reviewers

In the code, the new data entry mode is called "placement mode", as opposed to manual recording or automatic recording. The activity now needs to know whether it's being asked to collect a GeoTrace or a GeoShape; this is called the "output mode".

I recommend reviewing these commits one by one.

Notes for testers

The main risk is that GeoShape could break or lose functionality. Another possible risk is that the new tapping mode does not work well in GeoTrace.

Verification performed

I have tried using both GeoTrace and GeoShape in placement mode, manual mode, and automatic mode.

@zestyping zestyping force-pushed the ping/geopoly-merge branch 2 times, most recently from ee24f58 to 3e61889 Compare March 4, 2019 09:43
@zestyping
Copy link
Contributor Author

The deprecation warning looks like this. We would make http://bit.ly/odk-polygon point at a page that explains when this dialog will be going away, and advises form designers to use GeoShape instead of GeoTrace when they want to collect a polygon.

2019-03-04 09-40-30

@yanokwa yanokwa added this to the v1.21 milestone Mar 4, 2019
@yanokwa yanokwa requested a review from cooperka March 4, 2019 19:27
<string name="start">Start</string>
<string name="enable_gps">Enable GPS</string>
<string name="geotrace_title">GeoTrace</string>
<string name="polygon_save">Save as Polygon</string>
<string name="polygon_save">Save as Polygon (This option will soon be removed! See http://bit.ly/odk-polygon)</string>
Copy link
Member

Choose a reason for hiding this comment

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

I would split this out into two strings so we don't trigger a translation of polygon_save. Maybe we can add a \n\n to separate this out. And perhaps something that is less vague than soon?

This option will be removed in next update. See https://forum.opendatakit.org/t/18277 for alternatives.

That ID is valid, by the way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, that's weird. When I go to https://forum.opendatakit.org/t/topic/18277, I get "Sorry, you don't have access to that topic!"

I was going to suggest that we start a forum topic just specifically about the disappearance of this button. Is that what https://forum.opendatakit.org/t/topic/18277 is?

Copy link
Member

@yanokwa yanokwa Mar 8, 2019

Choose a reason for hiding this comment

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

You don't have access yet cause it's a scheduled post (and mostly empty) and you aren't a forum mod. Once we are close to release, we'll write it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. I've updated the message.

This is on a button, so the URL cannot be made a clickable link; and moreover the target audience, the form designer, will most likely view the forum page on a desktop or laptop computer. So the URL will need to be retyped into a browser. To make the message fit better inside the button and make the URL easier to retype, I set up a permanent bit.ly link that redirects to the forum page.

Here's how it looks:
device-2019-03-08-052203

How's that?

Copy link
Member

@yanokwa yanokwa left a comment

Choose a reason for hiding this comment

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

I'm curious why you chose tap and not long press (to match geopoint's placement-map) option.

@@ -338,11 +338,11 @@
<string name="get_trace">Start GeoTrace</string>

<string name="geoshape_title">GeoShape</string>
<string name="select_geotrace_mode">"Select GeoTrace Mode"</string>
<string name="data_entry_mode">Data entry mode</string>
Copy link
Member

Choose a reason for hiding this comment

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

Data entry is an overloaded term. Maybe "Placement mode"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll address this together with the other comment below.

<string name="manual_mode">Manual recording</string>
<string name="automatic_mode">Automatic recording</string>
<string name="placement_mode">Tap to place points</string>
<string name="manual_mode">Manual GPS recording</string>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the naming is accurate since it's not technically GPS. How does this feel?

  • Manual - Tap map to place points
  • Manual - Use location provider
  • Automatic - Use location provider

Copy link
Contributor Author

@zestyping zestyping Mar 7, 2019

Choose a reason for hiding this comment

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

It doesn't feel as good as the current wording to me. "Manual" is slightly confusing because in the first item the time and position are manually controlled, whereas in the second item the time is manually controlled but the position is recorded from a sensor. Also, I'm not sure that "provider" makes sense to users—I don't think I've seen that word in any location-related UI; in Settings, the choice of provider is called "Location mode".

When writing this PR, I tried to come up with terminology for this that I could use consistently in the UI and in our code; here's what I was going for:

  • Clearly different names for each of the three ways of entering points
  • Ideally a single word that characterizes each option
  • Putting the distinguishing word at the beginning of the option
  • Phrases that aren't too different from the current text ("Manual recording", "Automatic recording") or the previous text ("Manual Mode", "Automatic Mode"), so they're recognizable to existing users
  • Terminology that separates the first option (location from a tap) and groups the other two (location from the sensor)

To elaborate on the last criterion, I think the similarity hierarchy should look like this:

  • Let the user indicate the position of each point
    • A. Tap the map to place points
  • Read the location from a sensor
    • B. Read from a sensor on user command
    • C. Read from a sensor at regular intervals

and not like this:

  • Place each point on user command
    • A. Place the point according to where the user tapped
    • B. Place the point according to a sensor reading
  • Place points automatically at regular intervals
    • C. Place points at regular intervals according to the sensor reading

because the use case for A is quite different from the use cases for B and C.

Thus I need a term for (A or B or C), a term for A, a term for (B or C), a term for B, and a term for C. I went with:

  • Data entry
    • Placement
      • Tap to place points
    • Recording
      • Manual GPS recording
      • Automatic GPS recording

The code uses the same terminology (placement, recording mode, automatic recording, etc.) except that the topmost term in the code is "input" rather than "data entry". The choice of "placement" is inspired by the use of "placement-map" to have a similar meaning in the existing GeoPoint activity, where "placement" means "placed by the user". This has a little bit of value in that, if we decide to let the form designer configure the default input mode in the future, we can use consistent terminology "placement", "manual", "automatic" for the XML that lines up with what's in the UI.

I see what you mean about "GPS" being potentially wrong. Instead of "data entry", how about "input method"? What if we used:

  • Input method
    • Placement
      • Placement by tapping
    • Recording
      • Manual location recording
      • Automatic location recording

Is that better?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the explanation, Ping. Naming is hard. I think Input method, placement by tapping, manual/automatic location recording is fine. I'd like to request feedback from @cooperka and @smoyth, but we shouldn't block testing and merging because of that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I've made these changes for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

I rather liked the original options, but with "input method":

Input method:
- Tap to place points
- Manual GPS recording
- Automatic GPS recording

They sound explicit and clear. The new options (below for clarity)

Input method:
- Placement by tapping
- Manual location recording
- Automatic location recording

these to me sound more ambiguous. I understand GPS is technically only one of several location provider methodologies, but I think most users don't know the difference and even those who do would understand that it means whatever location provider is on the device.

I like "GPS" because it makes it clear that there's technology being used to determine your location, as opposed to "Manual location recording" which sounds like I might be able to type in my current address or something else entirely.

Perhaps instead of "GPS" we could say "position"? Not to throw a wrench in things, but what about:

Input method:
- Tap to place points
- Manually record positions
- Automatically record positions

[I don't want this to prevent merging, feel free to punt to a separate issue.]

Copy link
Contributor Author

@zestyping zestyping Mar 8, 2019

Choose a reason for hiding this comment

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

Hahaha, yes, you've independently hit upon the reason I initially went with "GPS". 😄

I do see what you're trying to achieve, but "Manually record positions" actually sounds even less like using sensor readings, to me. I think it's because "location" is the word Android has standardized upon to mean "the sensed location of your phone"; I don't see "position" in any of the standard UI. Also, somehow, the imperative "record X" sounds more like the user is entering data than "X recording".

But, since we all have slightly different impressions, that probably means none of the wordings so far is truly strong enough to be obvious to everyone.

I'm open trying to find something even better, though.

Copy link
Contributor Author

@zestyping zestyping Mar 8, 2019

Choose a reason for hiding this comment

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

One more try... perhaps "your" will help?

Input method
  - Place each point yourself
  - Manually record your location
  - Automatically record your location

Or for the first one, "Choose where to place each point"? Or "Place each point manually"?

Feel free to make other suggestions!

Copy link
Contributor

Choose a reason for hiding this comment

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

I like your latest suggestion as-is! 👍

@zestyping
Copy link
Contributor Author

zestyping commented Mar 7, 2019

Regarding tap instead of long-press:

One of the feedback items we got from the NBS was that they wanted to draw shapes (or roads, fences, etc.) directly on the map, and specifically that they wanted to tap instead of long-pressing. It's kind of slow and annoying to long-press a lot of points (e.g. try drawing a square), so I see why they would want that.

Their alternative (and what they're used to) is ArcGIS Collector, which places points with a single tap. It lets you place the points with greater precision, though, because instead of tapping on the spot where you want the point, you drag the map around until the point you want lines up with a fixed marker in the center of the screen, and then you tap a button to add the point. The map-dragging method lets you see where the point is going to appear and place it more precisely than using a big finger that covers up the spot you're trying to drop the point on.

We might want to consider adding (or replacing the tap-to-place method with) the map-dragging method. What do you think?

Copy link
Contributor

@cooperka cooperka left a comment

Choose a reason for hiding this comment

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

Code LGTM besides a small comment, tested and verified on emulator.

Should we also modify the All Widgets demo form to reflect these changes? Edit: they're still distinct widgets even though they share the same activity now, so this doesn't apply.

There are some pending comments about wording but they shouldn't affect logic -- I'll let you confirm this and add your own "needs testing" label if so (after resolving master conflicts).

private int recordingMode; // 0 manual, 1 is automatic
private boolean inputActive; // whether we are ready for the user to add points
private boolean recordingEnabled; // whether points are taken from GPS readings (if not, placed by tapping)
private boolean recordingAutomatic; // whether GPS readings are taken at regular intervals (if not, only when user-directed)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Comments like this don't usually get parsed by IDEs for inline advice; if you use /** JavaDoc comments */ above the var they'll be available elsewhere. Less important here because they're private but still useful.

@cooperka
Copy link
Contributor

cooperka commented Mar 7, 2019

consider adding (or replacing the tap-to-place method with) the map-dragging method

To clarify, in both cases it would be a single tap to add new points, right (but the map-dragging would be more accurate)? I think this would be great for certain users, but might just add complexity without significant benefit. Can we get some feedback from the forum or users elsewhere?

@zestyping
Copy link
Contributor Author

zestyping commented Mar 7, 2019

Thanks for the review!

Should we also modify the All Widgets demo form to reflect these changes?

What would need to change about the form?

consider adding (or replacing the tap-to-place method with) the map-dragging method

To clarify, in both cases it would be a single tap to add new points, right (but the map-dragging would be more accurate)?

Yes, that's right.

As it stands (with long press or tap), it's very hard to place a point exactly. To test this out, I tried just now to drop a point right at the center of an intersection; I've tapped 7 times, and it's close but it still isn't exactly right.

The more I think about it, the more it seems like the right solution. A nice consequence is that we can then use the same consistent method across all the Geo activities, and it also makes the placement mode and the recording modes more consistent (the point is always dropped at the center; the only difference is whether you pan the map by dragging or the map pans by itself to track your location).

That would be a significant UX change, though, and it affects all the activities, so I think the best path is to get this PR merged first, and then consider a possible separate PR to change the UX for manual placement.

Copy link
Member

@yanokwa yanokwa left a comment

Choose a reason for hiding this comment

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

This looks good to me. I played both GeoTrace and GeoShape on a real device. @zestyping maybe you can fix the merge conflicts and I think the feature should be ready for a quick review from @grzesiek2010 and then testing.

@zestyping
Copy link
Contributor Author

Okay, I've fixed the merge conflicts. @grzesiek2010, could you please review this, and if there are no major issues, tag this with "needs testing" to bring it to @mmarciniak90 's attention? Thanks!

@zestyping
Copy link
Contributor Author

consider adding (or replacing the tap-to-place method with) the map-dragging method

Can we get some feedback from the forum or users elsewhere?

Good idea; I just made a post on the forum.

@mmarciniak90
Copy link
Contributor

@zestyping I tested these cases on Google Maps on Android: 4.2, 4.4, 5.1, 6.0, 7.0
I will continue with OSM.

GeoTrace

GeoShape

I noticed that message: Must have at least 2 points to create Polyline is visible for GeoShape when I put only 1 point. When I put 2 points, the area is saved with 3 coordinates.
I wonder if the message is not confused for users. We are saying that GeoShape edits and saves a Polygon but the message contains Polyline.
@zestyping what do you think about it?

@zestyping
Copy link
Contributor Author

@mmarciniak90 Good point about the error message. That needs to be fixed.

@zestyping
Copy link
Contributor Author

@mmarciniak90 Okay, this last change should fix the error message in GeoShape.

@mmarciniak90
Copy link
Contributor

mmarciniak90 commented Mar 11, 2019

Cases for OSM checked.
@zestyping I noticed two more problems.

  1. I used devices with 4.5 and 4.3 inches screen. I opened Save GeoTrace As dialog in a horizontal orientation. Because there is no scroll I was not able to click on the second option.
    The scroll was never available on this dialog. Problem is visible because the content of the first option is bigger than before. I know that it is a temporary message, so I'm not sure that we should spend time on it. It is not a blocker because dialog looks good in the vertical orientation.
    @zestyping When will we completely remove it?
current fix v1.20
Screenshot_2019-03-11-14-30-16 Screenshot_2019-03-11-14-32-14
  1. Probably a typo in link. bit.ly/odk18277 does not exists. There should be: bit.ly/odk1827

@mmarciniak90
Copy link
Contributor

@opendatakit-bot unlabel "needs testing"

@zestyping
Copy link
Contributor Author

zestyping commented Mar 13, 2019

The polygon/polyline dialog is fixed so it scrolls when there isn't enough vertical space now.

I've set up the bit.ly link so that both bit.ly/odk18277 and bit.ly/ODK18277 go to the forum page. (The forum page says "Sorry, you don't have access" because it isn't published yet, but when we release the next version, we'll make the forum page visible to the public.)

So I think this is ready to go.

@mmarciniak90
Copy link
Contributor

@zestyping sorry, I had no idea that the page has not been published yet. That's why I thought it was a typo.
Thanks for adding the scroll.

Tested with success

Verified on Android: 4.2, 4.4, 5.1, 6.0, 7.0, 8.1
Verified cases described in previous comments.
Verified:

  • Google Maps and OpenStreetMap
  • light/dark theme

@opendatakit-bot label "behavior verified"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants