-
Notifications
You must be signed in to change notification settings - Fork 1.3k
"Locate me" icon in Nearby doesn't prompt user to enable GPS #3397
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
Comments
I'd like to help. Can I start working on this issue? I am starting to contribute to open source projects and this seems like a good first issue for me. |
Yes, go for it @glitch101 :) |
In my opinion option 2 is better. Let us wait to hear from others as well. |
The option 2 sound like the way to go to me too as that would be more helpful than just showing a simple toast. One odd thing I noticed in the GIF for option 2 is that the "Yes" appears to the left and the "No" to the right. In Android, I suppose it's customary to have it the other way round. So, it would be nice to have them swapped. |
I forgot to mention that I've noticed some devices change the custom behaviour and show the positive action in the left and the negative in the right. If the GIF was taken in one of those devices, kindly ignore the quoted comment. |
The tl;dr version of the previous comment is: The positive and negative buttons have been set as opposed to the Android design conventions in the DialogUtils class and should be swapped to follow common Android conventions as pointed out by @sivaraam. I think a new issue should be created for this? @maskaravivek What do you think? |
So, should we go with a Toast or a Dialog? @maskaravivek |
Yes please create a new issue for it. :)
Lets go with a permission dialog if the location is not enabled. Check
Lets discuss it on a separate issue thread. :) |
The way I have been programming the app is this: 5: Presses No - > Don't show the dialog box again until and unless the user enables/disables the GPS or if the app is minimized/closed and if the Nearby activity is paused. This was necessary as showing the dialog again and again can be annoying. |
Okay thats sounds good. I confused it with something else so i was suggesting about permission utils. I assume that location permissions are already given to the app. After the location is turned on, we should also check if location permission is provided or not. If not we should invoke location permission dialog. |
Just wondering, wouldn't it be possible to turn on the location automatically like the way Google maps does it? It would be a more pleasant experience.
IMO, as we show the dialog only when the user taps on the "Locate me" icon I don't think it would be annoying to show the dialog whenever the user taps on it. Actually, I believe it would be the other way round. When a user taps on the "Locate me" icon and the dialog doesn't appear when the location is turned off, it would be confusing. So, it would be better to show the dialog whenever the user taps on the "Locate me" icon and the location is turned off. |
Completely agree on that one. But, there is a catch. |
Sometimes, the user might not need location-enabled since the last location might be already acquired using Wifi and cell towers and in that case, it will only distract them when they press the Re Center button again. If it helps convey my point, the same behavior can be found in Google Maps.
Well, we could add a count or something. I mean, let's show the user the dialog 3 times and on the 3rd time they press on NO, the dialog won't appear again until the location is turned on/off or if the app is minimized. |
Thanks for the info. Its fine if you would like to implement this without the Play Service API dependency. It would indeed be better to do that change after discussing in a separate issue about whether the dependency is worth introducing. |
Ah! So, all this while you were explaining the behaviour of dialog when the GPS is turned off but the location is not. Is that correct? If yes, then it clears some confusion as I've been thinking it would be the behaviour when the location is completely turned off. I think then we need to discuss both the flows:
Note: When I refer to "Location", I refer to the "Location" setting in general 🙂
Just wanted to note this. When I have location on but GPS off tapping on the "Locate me" marker doesn't prompt me at all. It just takes me to the location it has identified using the means other than GPS. FYI, I use Maps version 10.35.2 on an Android 5.1.1 device. I'm not sure why the behaviour is different for you. May be its related to the Android version. |
Now I am confused too. Let's get this straight together. Assumption 1: A device has three location modes.
Assumption 2:When you click on GPS icon from your notification panel to disable the GPS, it drops the level from High accuracy to Battery Saving. This is how it is on my device and it would be helpful if you can verify this. Side Notes:On my device, if the location is not set to High Accuracy but it is on Battery Saving or GPS only, Google Maps doesn't prompt me too to turn on location. It only prompts if the location is set to off ie all mode off in which case apps cannot access the location. |
And I programmed the dialog box to appear in case when the App cannot access the GPS. So, the dialog will prompt the user if the location is on Battery Saver mode in which case it can only access Wifi, Bluetooth, and cell towers but not GPS. |
Do note that in my previous two comments, by "Location" I also mean the exact meaning you wrote in the tagged line above:point_up: |
Sure.
Interesting. My device has those modes too but they're not named like that. Regardless, I think we could use those names for discussion as they seem pretty standard in devices running newer Android versions.
I actually don't have the option to turn the GPS alone on/off in my notification panel. I only have the option to turn the "Location" setting on/off.
Just for confirmation, in this case it prompts you whenever you tap on the "Locate me" button until you hit "Yes", doesn't it?
What happens when the location is completely turned-off? Also, I'm not sure how you've achieved this but I wanted to share with you a Android developer page which is particularly about prompting the user to change location settings. Here's the link: https://developer.android.com/training/location/change-location-settings#prompt Also, came across an Android training page for building location aware apps which might be useful: https://developer.android.com/training/location |
Yes
In that case, when the user opens Nearby tab they will get a toast saying "Nearby might not work properly. Location not available". This behaviour was already in the App before I started hacking on it. |
Well, you can take a look at my fork https://github.com/Glitch101/apps-android-commons/tree/add_location_off_dialog_in_nearby
Thank you very much. I will see if I can find something useful in there. :) |
Actually, I have read this page before and it is using the Play Services API like we discussed before.
I haven't gone through this one before. So, let's see if it contains some gold. |
I'm not sure why you're special casing the behaviour when the latitude/longitude is
I have some comments to share regarding the code but I'll save them for the PR review. Speaking of PRs, I suppose we're discussing a lot of implementation related things here which should better be in the PR, IMO. If you're fine with it, please open a PR and we can continue the discussion there. 🙂 |
@glitch101 Can you update the opening comment of this issue to summarise the final proposed approach so that its easier for everyone to follow. If the approach looks good to everyone you can go ahead and work on the issue. |
Sure. I will do that! |
Nearby needs both GPS and cell towers to work properly(High accuracy mode) and if you will open the app when the location is set to **Device only ** i.e only GPS, nearby won't work and will stay at the Tower of London as the Latitude and Longitude are NULL(found this using the logs) in this case. This is the case I am referring the location as null.
Now let's continue our discussion over the PR which I will send tomorrow :) |
Hey, @maskaravivek! I updated the opening comment on this issue. Could you please take a look at it whenever you are free and let me know if it's explanatory enough or do I need to improve it further 😃 |
Summary:
The "Nearby" screen shows a toast when the location is disabled. This is fine. But when I tap on the "Locate me" button in the Nearby, I expect the app to prompt me to turn on GPS when location is disabled. But, as of now, nothing happens when I tap on the "Locate me" icon and location is disabled.
Steps to reproduce:
I expect the app to prompt me to enable the location (GPS).
Device and Android version:
Samsung SM-J111F, Android 5.1.1
Commons app version:
2.12.3.572
The text was updated successfully, but these errors were encountered: