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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion app/src/main/java/fr/free/nrw/commons/nearby/NearbyFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import fr.free.nrw.commons.location.LatLng;
import fr.free.nrw.commons.location.LocationServiceManager;
import fr.free.nrw.commons.location.LocationUpdateListener;
import fr.free.nrw.commons.utils.DialogUtil;
import fr.free.nrw.commons.utils.FragmentUtils;
import fr.free.nrw.commons.utils.NetworkUtils;
import fr.free.nrw.commons.utils.UriSerializer;
Expand Down Expand Up @@ -653,7 +654,21 @@ private void checkGps() {
startActivityForResult(callGPSSettingIntent, 1);
})
.setNegativeButton(R.string.menu_cancel_upload, (dialog, id) -> {
showLocationPermissionDeniedErrorDialog();
DialogUtil.showAlertDialog(
getActivity(),
null,
getString(R.string.nearby_needs_gps),
getString(R.string.enable_gps),
getString(R.string.cancel),
() -> {
Intent callGPSSettingIntent = new Intent(
android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
Timber.d("Loaded settings page");
startActivityForResult(callGPSSettingIntent, 1);
},
() -> {
((MainActivity)getActivity()).viewPager.setCurrentItem(((MainActivity)getActivity()).CONTRIBUTIONS_TAB_POSITION);
});
dialog.cancel();
})
.create()
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
<string name="navigation_item_notification">Notifications</string>
<string name="navigation_item_featured_images">Featured</string>
<string name="nearby_needs_permissions">Nearby places cannot be displayed without location permissions</string>
<string name="nearby_needs_gps">GPS needs to be enabled to use this feature.</string>
<string name="no_description_found">no description found</string>
<string name="nearby_info_menu_commons_article">Commons file page</string>
<string name="nearby_info_menu_wikidata_article">Wikidata item</string>
Expand Down