Java Code Examples for me.iwf.photopicker.utils.PermissionsConstant

The following examples show how to use me.iwf.photopicker.utils.PermissionsConstant. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: PhotoPicker   Source File: PhotoPickerFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    if (grantResults.length > 0
            && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
        switch (requestCode) {
            case PermissionsConstant.REQUEST_CAMERA:
            case PermissionsConstant.REQUEST_EXTERNAL_WRITE:
                if (PermissionsUtils.checkWriteStoragePermission(this) &&
                        PermissionsUtils.checkCameraPermission(this)) {
                    openCamera();
                }
                break;
        }
    }
}
 
Example 2
Source Project: PhotoPicker   Source File: PhotoPickerFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    if (grantResults.length > 0
            && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
        switch (requestCode) {
            case PermissionsConstant.REQUEST_CAMERA:
            case PermissionsConstant.REQUEST_EXTERNAL_WRITE:
                if (PermissionsUtils.checkWriteStoragePermission(this) &&
                        PermissionsUtils.checkCameraPermission(this)) {
                    openCamera();
                }
                break;
        }
    }
}
 
Example 3
Source Project: PhotoPicker   Source File: PhotoPickerFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
  if (grantResults.length > 0
          && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
    switch (requestCode) {
      case PermissionsConstant.REQUEST_CAMERA:
      case PermissionsConstant.REQUEST_EXTERNAL_WRITE:
        if (PermissionsUtils.checkWriteStoragePermission(this) &&
                PermissionsUtils.checkCameraPermission(this)) {
          openCamera();
        }
        break;
    }
  }
}