本文整理汇总了Java中com.theartofdev.edmodo.cropper.CropImage.startPickImageActivity方法的典型用法代码示例。如果您正苦于以下问题:Java CropImage.startPickImageActivity方法的具体用法?Java CropImage.startPickImageActivity怎么用?Java CropImage.startPickImageActivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.theartofdev.edmodo.cropper.CropImage
的用法示例。
在下文中一共展示了CropImage.startPickImageActivity方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRequestPermissionsResult
import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
if (requestCode == CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
CropImage.startPickImageActivity(this);
} else {
Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG).show();
}
}
if (requestCode == CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE) {
if (mCropImageUri != null && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
mCurrentFragment.setImageUri(mCropImageUri);
} else {
Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG).show();
}
}
}
示例2: onRequestPermissionsResult
import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
if (requestCode == CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
CropImage.startPickImageActivity(this);
} else {
Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG).show();
}
}
if (requestCode == CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE) {
if (cropImageUri != null && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// required permissions granted, start crop image activity
startCropImageActivity(cropImageUri);
} else {
Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG).show();
}
}
}
示例3: onRequestPermissionsResult
import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
if (requestCode == CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
LogUtil.logDebug(TAG, "CAMERA_CAPTURE_PERMISSIONS granted");
CropImage.startPickImageActivity(this);
} else {
showSnackBar(R.string.permissions_not_granted);
LogUtil.logDebug(TAG, "CAMERA_CAPTURE_PERMISSIONS not granted");
}
}
if (requestCode == CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE) {
if (imageUri != null && grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// required permissions granted, start crop image activity
LogUtil.logDebug(TAG, "PICK_IMAGE_PERMISSIONS granted");
// if (isImageFileValid(imageUri)) {
onImagePikedAction();
// }
} else {
showSnackBar(R.string.permissions_not_granted);
LogUtil.logDebug(TAG, "PICK_IMAGE_PERMISSIONS not granted");
}
}
}
示例4: onRequestPermissionsResult
import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
@Override
public void onRequestPermissionsResult(
int requestCode, String permissions[], int[] grantResults) {
if (requestCode == CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE) {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
CropImage.startPickImageActivity(this);
} else {
Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG)
.show();
}
}
if (requestCode == CropImage.PICK_IMAGE_PERMISSIONS_REQUEST_CODE) {
if (mCropImageUri != null
&& grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
mCurrentFragment.setImageUri(mCropImageUri);
} else {
Toast.makeText(this, "Cancelling, required permissions are not granted", Toast.LENGTH_LONG)
.show();
}
}
}
示例5: onClickPhoto
import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
public void onClickPhoto(View w) {
if (vehiclePicturePath != null && new File(vehiclePicturePath).exists()) {
deletePhoto();
} else {
if (CropImage.isExplicitCameraPermissionRequired(this)) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE);
} else {
CropImage.startPickImageActivity(this);
}
}
}
示例6: onSelectImageClick
import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
@SuppressLint("NewApi")
public void onSelectImageClick(View view) {
if (CropImage.isExplicitCameraPermissionRequired(this)) {
requestPermissions(new String[]{Manifest.permission.CAMERA}, CropImage.CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE);
} else {
CropImage.startPickImageActivity(this);
}
}
示例7: startPicker
import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
private void startPicker() {
CropImage.startPickImageActivity(this);
}
示例8: onSelectImageClick
import com.theartofdev.edmodo.cropper.CropImage; //导入方法依赖的package包/类
/**
* Start pick image activity with chooser.
*/
public void onSelectImageClick(View view) {
CropImage.startPickImageActivity(this);
}