Skip to content

Commit

Permalink
re-ordered code.
Browse files Browse the repository at this point in the history
  • Loading branch information
kosh committed Aug 9, 2016
1 parent 9beedb0 commit 54b0b3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ app</a>**
# Dependency

Android Support library ```v23.1.1```
Android Support library ```v24.1.1```

CirclePageIndicator by **JakeWharton** (integrated within the library).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
import java.util.List;

public class PermissionHelper implements OnActivityPermissionCallback {
private final OnPermissionCallback permissionCallback;
private static final int OVERLAY_PERMISSION_REQ_CODE = 2;
private final int REQUEST_PERMISSIONS = 1;
private static final int REQUEST_PERMISSIONS = 1;

private final OnPermissionCallback permissionCallback;
private final Activity context;
private boolean forceAccepting;

Expand Down Expand Up @@ -57,11 +58,9 @@ public static PermissionHelper getInstance(@NonNull Activity context, @NonNull O
String[] declinedPermissions = declinedPermissions(context, permissions);
List<Boolean> deniedPermissionsLength = new ArrayList<>();//needed
for (String permissionName : declinedPermissions) {
if (permissionName != null) {
if (!isExplanationNeeded(permissionName)) {
permissionCallback.onPermissionReallyDeclined(permissionName);
deniedPermissionsLength.add(false);
}
if (permissionName != null && !isExplanationNeeded(permissionName)) {
permissionCallback.onPermissionReallyDeclined(permissionName);
deniedPermissionsLength.add(false);
}
}
if (deniedPermissionsLength.size() == 0) {
Expand Down Expand Up @@ -105,7 +104,7 @@ public PermissionHelper setForceAccepting(boolean forceAccepting) {
* (it can be one of these types (String), (String[])
*/
public PermissionHelper request(@NonNull Object permissionName) {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (permissionName instanceof String) {
handleSingle((String) permissionName);
} else if (permissionName instanceof String[]) {
Expand Down

0 comments on commit 54b0b3b

Please sign in to comment.