Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederikos committed Apr 11, 2017
2 parents 3167226 + b0af223 commit 5067fdc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In your build.gradle :

```gradle
dependencies {
compile 'com.mlsdev.rximagepicker:library:1.3.0'
compile 'com.mlsdev.rximagepicker:library:1.3.1'
compile 'io.reactivex:rxjava:1.0.14'
}
```
Expand Down
17 changes: 10 additions & 7 deletions library/src/main/java/com/mlsdev/rximagepicker/HiddenActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ private void handleIntent(Intent intent) {
case GALLERY:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
pictureChooseIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
pictureChooseIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, getIntent().getBooleanExtra(ALLOW_MULTIPLE_IMAGES, false));
pictureChooseIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE,
getIntent().getBooleanExtra(ALLOW_MULTIPLE_IMAGES, false));
pictureChooseIntent.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
} else {
pictureChooseIntent = new Intent(Intent.ACTION_GET_CONTENT);
Expand All @@ -133,11 +134,13 @@ private void handleIntent(Intent intent) {
}

private boolean checkPermission() {
if (ContextCompat.checkSelfPermission(HiddenActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE) !=
PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(HiddenActivity.this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
0);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED
|| (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
!= PackageManager.PERMISSION_GRANTED)) {

ActivityCompat.requestPermissions(this,
new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA}, 0);
return false;
} else {
return true;
Expand All @@ -152,4 +155,4 @@ private Uri createImageUri() {
return contentResolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, cv);
}

}
}

0 comments on commit 5067fdc

Please sign in to comment.