Skip to content

Commit

Permalink
Add location permission fall back message in case permissions are deined
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Tarazi committed Feb 24, 2016
1 parent 4ce9f65 commit d2624a4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
16 changes: 0 additions & 16 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ public boolean onTouch(View v, MotionEvent event) {
// Else show request for Location permissions and/or request them.
else {

/**
* The reason why this block of code is here and not in the MainActivity
* is because we need references to rootLayout and the context.
*/
if (shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)
|| shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_COARSE_LOCATION)) {
Snackbar.make(rootLayout, "Location permissions are required in order to use your GPS.",
Expand All @@ -226,6 +230,10 @@ public void onClick(View v) {
}
})
.show();
} else {
Toast.makeText(getContext(),
"Location permission currently denied. Please enable in your app settings",
Toast.LENGTH_LONG).show();
}

return true;
Expand Down

0 comments on commit d2624a4

Please sign in to comment.