-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Feature/permissions library #1855
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
Merged
misaochan
merged 15 commits into
commons-app:master
from
ashishkumar468:feature/permissions_library
Sep 6, 2018
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
53a53e4
Added permission for Dexter, the runtime permission handling library
ashishkumar468 da39542
[Preparing fir issue #1773] Added a utility function which would take…
ashishkumar468 8783e9b
Added an alert dialog with positive and negative callback [Preparing …
ashishkumar468 4115048
Improvements in the way External Storage Permission is handled in Mul…
ashishkumar468 16a9afc
Added a Constants class to handle request and result codes from one p…
ashishkumar468 28dfae0
replaced hardcoded strings ok and cancel in DialogUtil to string reso…
ashishkumar468 c20c196
Merge branch 'master' into feature/permissions_library
ashishkumar468 d054767
init permission rationale dialog in activities onCreate
ashishkumar468 68fbf47
Merge branch 'master' of https://github.com/commons-app/apps-android-…
ashishkumar468 b871f65
Merge branch 'master' into feature/permissions_library
ashishkumar468 f4d1691
Merge branch 'master' into feature/permissions_library
ashishkumar468 8b07950
Code formatting, updated access modifiers wherever required, added ja…
ashishkumar468 5d83372
Merge branch 'master' into feature/permissions_library
ashishkumar468 59c21aa
*shifted constants to app class
ashishkumar468 a332be7
removed class REQUEST_CODES from CommonsApplication and instead put t…
ashishkumar468 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Preparing fir issue #1773] Added a utility function which would take…
… the user to app settings screen where he could manually give us the required permission
- Loading branch information
commit da395427572a4c242d8f2c7e87e7e49048670b0a
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
app/src/main/java/fr/free/nrw/commons/utils/PermissionUtils.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package fr.free.nrw.commons.utils; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.net.Uri; | ||
import android.provider.Settings; | ||
|
||
public class PermissionUtils { | ||
|
||
//Can be used by any activity which requires a permission which has been blocked(marked never ask again by the user) | ||
//It open the app settings from where the user can manully give us the required permission. | ||
public static void askUserToManuallyEnablePermissionFromSettings( | ||
Activity activity) { | ||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); | ||
Uri uri = Uri.fromParts("package", activity.getPackageName(), null); | ||
intent.setData(uri); | ||
activity.startActivityForResult(intent, Constants.REQUEST_CODES.OPEN_APPLICATION_DETAIL_SETTINGS); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very helpful comment! :) But could you please write this in Javadoc format to take advantage of IDE support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have been there, will do it