Skip to content

[WIP] changed confusing message about location permission(#2011) #2305

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

Closed
wants to merge 3 commits into from

Conversation

cypherop
Copy link
Contributor

Fixes #2011 Nearby: confusing message about location permission

What changes did you make and why?
Added a new Alert Dialog when user taps on "Cancel"

Tests performed (required)

Tested on Motorola Moto G5 plus with API level 24

screenshot_1547570243

after tapping on cancel
screenshot_1547570252

If the user clicks on cancel again then the user is redirected to contributions activity

@cypherop
Copy link
Contributor Author

Sure :)

@codecov-io
Copy link

codecov-io commented Jan 15, 2019

Codecov Report

Merging #2305 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2305      +/-   ##
=========================================
- Coverage    6.42%   6.41%   -0.01%     
=========================================
  Files         236     236              
  Lines       11537   11549      +12     
  Branches     1049    1049              
=========================================
  Hits          741     741              
- Misses      10735   10747      +12     
  Partials       61      61
Impacted Files Coverage Δ
...ava/fr/free/nrw/commons/nearby/NearbyFragment.java 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e93564f...ff2ac56. Read the comment docs.

@sivaraam
Copy link
Member

It would be nice if this could also be tested with an Android device running Android 5 or less as the issue #2011 was filed mainly because a confusing message about permissions was shown in a device running an Android version which does not support runtime permissions (yeah, I'm not asked to allow or deny when the requests access to my location etc.). I'm trying to test this as I have a device running Android 5.1.1 but it would be great if someone could test this before me :-)

Also, IIUC from the screen shots posted the when the user visits 'Nearby' the dialog in the first screen shot is shown. If he hits on 'Cancel' in it then pop-up in the second one would be shown. Is that right? If yes, I'm not sure how this improves the status quo. Adding another dialog just seems to be worsening it. I guess an improvement would be to avoid drop the first pop-up in the first one. That would reduce the frustration a little.

Also, I had another doubt. Given that #591 has been closed, does asking for the GPS permission as a mandatory requirement make sens? I think it could be made optional which would make Nearby even more useful.

@cypherop
Copy link
Contributor Author

@maskaravivek Done reusing DialogUtil for displaying this dialog.

@cypherop
Copy link
Contributor Author

@sivaraam Actually the screenshots are of an emulator running android 5.1. I had already tested on this emulater and also on my device.
Also I think the dialog should be there to inform the user that the GPS needs to be enabled in order to use that feature.After cancelling again the user is redirected to the contributions fragment and no further dialog appears

@maskaravivek
Copy link
Member

It would be nice if this could also be tested with an Android device running Android 5 or less

The "GPS dialog" suggests that the app has location permissions(on Android 5 it has it by default) but the app wasn't able to fetch the location.

If the app has location permissions it checks if the GPS provider is enabled:

locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);

If the GPS_PROVIDER isn't enabled, the GPS dialog is shown.

So the dialog is not about location permissions. It is trying to check if you have enabled location services on your device or not.

@sivaraam
Copy link
Member

sivaraam commented Jan 17, 2019

Also I think the dialog should be there to inform the user that the GPS needs to be enabled in order to use that feature.

@sp2710 It might be good to have a dialog that informs the user that GPS is required for the feature. I just don't find how the first dialog which plainly states "GPS is disabled" is useful now. It's better not to have subsequent pop-up dialog. In this particular case, the first dialog seems useless, at least to me. So, it would be nice to drop it.

Just to give an idea. If the first dialog is dropped, the flow should be something like:

  1. The user visits 'Nearby'
  2. If GPS disabled, he is shown a dialog stating "GPS is needed to use this feature"
  3. If he hits 'Cancel' he's taken back to 'Contributions'.
  4. If he hits 'Enable GPS', he's taken to 'Nearby'.

Hope that clarifies what I'm trying to say. Let me know if it doesn't.

@sivaraam
Copy link
Member

sivaraam commented Jan 17, 2019

So the dialog is not about location permissions. It is trying to check if you have enabled location services on your device or not.

There seems to be some confusion as to what the actual issue in #2011 is. The issue is not about the "GPS is disabled .." dialog that is shown. It is about the "Nearby places cannot be displayed without the location permissions" dialog. I'm not sure when that dialog is shown but the message made me think it is shown incorrectly for device running Android < 6. I suggested to test it in a device running Android < 6 just to ensure the dialog is not shown anymore (I've just tested it and it doesn't seem to be appearing which is fine with my device).

This PR seems to have removed that unnecessary dialog about permissions when it removed the call to showLocationPermissionDeniedErrorDialog(). But it now seems to add another dialog which seems unnecessary (at least to me).

@sivaraam
Copy link
Member

Actually the screenshots are of an emulator running android 5.1

@sp2710 I asked as the fact that it was also tested with a device running Android 5.1 wasn't mentioned in the Tests performed section of the description.

@cypherop
Copy link
Contributor Author

cypherop commented Jan 28, 2019

@maskaravivek I think only one dialog will be sufficient and we should change the message to something like

GPS needs to be enabled to use this feature. Would you like to enable it?

Would you like to give your suggestions?

@domdomegg
Copy link
Member

@maskaravivek I think only one dialog will be sufficient and we should change the message to something like

GPS needs to be enabled to use this feature. Would you like to enable it?

Would you like to give your suggestions?

I agree with changing the current message. On API 19, this is what happens if GPS is disabled and I open the app:

  1. Immediately get message about permissions (without navigating to nearby) (which doesn't make sense as runtime permissions only added in API 23)
  2. Get message about GPS being off (which is actually correct (well more like location services but it's close) - possibly wording could be improved to "Location services need to be enabled to use nearby. Would you like to enable them?")
  3. Clicking cancel on (2) results in a toast being displayed saying I rejected permissions which is false. I think we don't need a message here at all really as the user will understand that by choosing not to enable location they can't use nearby.

Screenshots:

1 2 3
Screenshot_1552835643 Screenshot_1552835649 Screenshot_1552835651

What I think should happen is:

  1. I open the app, and nothing happens yet as haven't tried to view nearby
  2. I navigate to nearby by clicking the tab at the top
  3. I get the message (2 previously) telling me location services is disabled, and this part of the app needs them enabled
    4a. If I enable them, nearby loads correctly
    4b. If I keep them disabled, I am returned back to the contributions view

@domdomegg domdomegg changed the title changed confusing message about location permission(#2011) [WIP] changed confusing message about location permission(#2011) Mar 17, 2019
@cypherop
Copy link
Contributor Author

@domdomegg So shall i modify my PR according to it?

@domdomegg
Copy link
Member

domdomegg commented Mar 17, 2019

@domdomegg So shall i modify my PR according to it?

I'd be happy to merge it. The one tricky thing might be only requesting location on viewing nearby (step 1), as I think location is used when it tries to get the nearby notification card to display on top of contributions fragment. If the other bits work I'd be happy to merge that and then step 1 can be done separately - whatever is easier.

@cypherop
Copy link
Contributor Author

@domdomegg IMO for contributions fragment we can show dialog with content

Location services need to be enabled to get nearby notification. Would you like to enable them?

And if in nearby we can show this dialog

Location services need to be enabled to use nearby. Would you like to enable them?

@domdomegg
Copy link
Member

Location services need to be enabled to get nearby notification. Would you like to enable them?

I don't know if this will be clear as users might not know what the nearby notification is referring too, especially as this message is likely to be the first thing the user experiences when opening the app. Maybe just say something like 'location services need to be enabled if you want to know about nearby places of interest that lack media on Commons'

@cypherop
Copy link
Contributor Author

Looks nice.
So shall I update my PR according to it ?

@neslihanturan
Copy link
Collaborator

@sp2710 please do. After a long discussion, this PR seems like ready to be merged after some string refactors.

@maskaravivek
Copy link
Member

IMO, this is no longer needed after #2925 is merged. We can probably close this PR

@neslihanturan
Copy link
Collaborator

Sorry I have missed it @maskaravivek

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

Successfully merging this pull request may close these issues.

Nearby: confusing message about location permission
6 participants