#3732 - Nearby Tab Accessible Without Location Permission (#4259)

* Added ability to access nearby tab without location permissions

* added ability to remember user choice if the permission is denied.

* fixed the issue with permission dialog box in contribution tab.

* changed name for stored variables

* minor change

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
This commit is contained in:
Pratham Pahariya 2021-02-26 18:19:11 +05:30 committed by GitHub
parent ba000eb26e
commit 630c2a5dcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 90 additions and 36 deletions

View file

@ -454,6 +454,7 @@ public class ContributionsFragment
onLocationPermissionGranted();
} else if (shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)
&& store.getBoolean("displayLocationPermissionForCardView", true)
&& !store.getBoolean("doNotAskForLocationPermission", false)
&& (((MainActivity) getActivity()).activeFragment == ActiveFragment.CONTRIBUTIONS)) {
nearbyNotificationCardView.permissionType = NearbyNotificationCardView.PermissionType.ENABLE_LOCATION_PERMISSION;
showNearbyCardPermissionRationale();
@ -486,6 +487,7 @@ public class ContributionsFragment
private void displayYouWontSeeNearbyMessage() {
ViewUtil.showLongToast(getActivity(), getResources().getString(R.string.unable_to_display_nearest_place));
store.putBoolean("doNotAskForLocationPermission", true);
}