本文整理汇总了Java中com.soundcloud.android.crop.Crop.RESULT_ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java Crop.RESULT_ERROR属性的具体用法?Java Crop.RESULT_ERROR怎么用?Java Crop.RESULT_ERROR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.soundcloud.android.crop.Crop
的用法示例。
在下文中一共展示了Crop.RESULT_ERROR属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processCroppedPhoto
private void processCroppedPhoto(int resultCode, Intent data){
if (resultCode == Crop.RESULT_ERROR)
{
uiHelper.dismissProgressCard();
return;
}
try
{
// If enabled we will save the image to the app
// directory in gallery else we will save it in the cache dir.
File dir;
if (BDefines.Options.SaveImagesToDir)
dir = Utils.ImageSaver.getAlbumStorageDir(activity.get(), Utils.ImageSaver.IMAGE_DIR_NAME);
else
dir = this.activity.get().getCacheDir();
if (dir == null)
{
uiHelper.dismissProgressCard();
uiHelper.showAlertToast(R.string.unable_to_fetch_image);
return;
}
File image = new File(dir, mFileName + ".jpeg");
selectedFilePath = image.getPath();
// Scanning the image so it would be visible in the gallery images.
if (BDefines.Options.SaveImagesToDir)
ImageUtils.scanFilePathForGallery(activity.get(), selectedFilePath);
sendImageMessage(image.getPath());
}
catch (NullPointerException e){
uiHelper.showAlertToast(R.string.unable_to_fetch_image);
}
}
示例2: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
// resultView.setImageURI(Crop.getOutput(result));
presenter.requestChangeHeadPic(FileUtils.getImageAbsolutePath(this, Crop.getOutput(result)));
} else if (resultCode == Crop.RESULT_ERROR) {
ToastUtil.getInstance().showLongT(Crop.getError(result).getMessage());
}
}
示例3: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
/*ChangeProfile.setImageURI(Crop.getOutput(result));*/
Uri output = Crop.getOutput(result);
String filepath = output.getPath();
bitmap = decodeSampledBitmapFromFile(filepath, 200, 200);
bitmap = getRotatedImage(filepath, bitmap);
user_img.setImageBitmap(bitmap);
profile_uploaded = true;
} else if (resultCode == Crop.RESULT_ERROR) {
Toast.makeText(this, Crop.getError(result).getMessage(), Toast.LENGTH_SHORT).show();
}
}
示例4: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
user_img.setImageURI(Crop.getOutput(result));
Uri output = Crop.getOutput(result);
String filepath = output.getPath();
bitmap = decodeSampledBitmapFromFile(filepath, 200, 200);
bitmap = getRotatedImage(filepath, bitmap);
user_img.setImageBitmap(bitmap);
/* bt_upload.setVisibility(View.INVISIBLE);*/
profile_uploaded = true;
} else if (resultCode == Crop.RESULT_ERROR) {
Toast.makeText(this, Crop.getError(result).getMessage(), Toast.LENGTH_SHORT).show();
}
}
示例5: handleCrop
private void handleCrop(int resultCode, Intent result)
{
if (resultCode == Activity.RESULT_OK) {
Uri photoUri = Crop.getOutput(result);
File myFile = new File(photoUri.getPath());
int degree = readPictureDegree(myFile.getAbsolutePath());
Bitmap croppedBmp = getBitmapFromUri(getActivity().getContentResolver(), photoUri);
Bitmap rotatedBitmap = rotateBitmapToCorrectDirection(croppedBmp, degree); // 将需要旋转的Bitmap进行旋转
photoImageView.setImageBitmap(null);
photoImageView.setImageBitmap(rotatedBitmap);
((GlobalPhotoApplication) getActivity().getApplication()).setPhotoBmp(rotatedBitmap); // 保存该bitmap
} else if (resultCode == Crop.RESULT_ERROR) {
Log.e("handleCrop Error", Crop.getError(result).getMessage());
}
}
示例6: handleCrop
private void handleCrop(int resultCode, Intent result)
{
if (resultCode == Activity.RESULT_OK) {
Uri photoUri = Crop.getOutput(result);
File myFile = new File(photoUri.getPath());
int degree = readPictureDegree(myFile.getAbsolutePath());
Log.d("degree", String.valueOf(degree));
Bitmap croppedBmp = getBitmapFromUri(getActivity().getContentResolver(), photoUri);
Bitmap rotatedBitmap = rotateBitmapToCorrectDirection(croppedBmp, degree); // 将需要旋转的Bitmap进行旋转
photoImageView.setImageBitmap(null);
photoImageView.setImageBitmap(rotatedBitmap);
((GlobalPhotoApplication) getActivity().getApplication()).setPhotoBmp(rotatedBitmap); // 保存该bitmap
} else if (resultCode == Crop.RESULT_ERROR) {
Log.e("handleCrop Error", Crop.getError(result).getMessage());
}
}
示例7: handleCrop
private void handleCrop(int resultCode, int requestCode, Intent result)
{
if (resultCode == Activity.RESULT_OK) {
Uri photoUri = Crop.getOutput(result);
File myFile = new File(photoUri.getPath());
int degree = readPictureDegree(myFile.getAbsolutePath());
Bitmap croppedBmp = getBitmapFromUri(getActivity().getContentResolver(), photoUri);
Bitmap rotatedBitmap = rotateBitmapToCorrectDirection(croppedBmp, degree); // 将需要旋转的Bitmap进行旋转
if (requestCode == CROP_FACE1_REQUEST) {
hasFace1 = true;
similarFace1ImageView.setImageBitmap(null);
similarFace1ImageView.setImageBitmap(rotatedBitmap);
} else if (requestCode == CROP_FACE2_REQUEST) {
hasFace2 = true;
similarFace2ImageView.setImageBitmap(null);
similarFace2ImageView.setImageBitmap(rotatedBitmap);
}
} else if (resultCode == Crop.RESULT_ERROR) {
Log.e("handleCrop Error", Crop.getError(result).getMessage());
}
}
示例8: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
mImageView.setImageURI(Crop.getOutput(result));
WallpaperManager myWallpaperManager = WallpaperManager
.getInstance(getApplicationContext());
try {
Bitmap mBitmap = getImageBitmap();
myWallpaperManager.setBitmap(mBitmap);
Toast.makeText(DetailActivity.this, "Wallpaper set",
Toast.LENGTH_SHORT).show();
} catch (IOException e) {
Toast.makeText(DetailActivity.this,
"Error setting wallpaper", Toast.LENGTH_SHORT)
.show();
}
} else if (resultCode == Crop.RESULT_ERROR) {
Toast.makeText(this, Crop.getError(result).getMessage(), Toast.LENGTH_SHORT).show();
}
}
示例9: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
// resultView.setImageURI(Crop.getOutput(result));
presenter.requestChangeHeadPic(FileUtils.getImageAbsolutePath(getActivity(), Crop.getOutput(result)));
} else if (resultCode == Crop.RESULT_ERROR) {
ToastUtil.getInstance().showLongT(Crop.getError(result).getMessage());
}
}
示例10: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
resultView.setImageURI(Crop.getOutput(result));
} else if (resultCode == Crop.RESULT_ERROR) {
TToast.show(Crop.getError(result).getMessage());
}
}
示例11: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
setResult(RESULT_OK);
} else if (resultCode == Crop.RESULT_ERROR) {
Toast.makeText(this, Crop.getError(result).getMessage(), Toast.LENGTH_SHORT).show();
}
finish();
}
示例12: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
resultView.setImageURI(Crop.getOutput(result));
} else if (resultCode == Crop.RESULT_ERROR) {
Toast.makeText(this, Crop.getError(result).getMessage(), Toast.LENGTH_SHORT).show();
}
}
示例13: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
isNeedUpdateImage = true;
photoImageView.setImageURI(imageUri);
} else if (resultCode == Crop.RESULT_ERROR) {
ToastUtils.longToast(Crop.getError(result).getMessage());
}
canPerformLogout.set(true);
}
示例14: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
isNeedUpdateImage = true;
avatarImageView.setImageURI(imageUri);
} else if (resultCode == Crop.RESULT_ERROR) {
ToastUtils.longToast(Crop.getError(result).getMessage());
}
}
示例15: handleCrop
private void handleCrop(int resultCode, Intent result) {
if (resultCode == RESULT_OK) {
if (imageUri != null) {
photoImageView.setImageURI(imageUri);
}
} else if (resultCode == Crop.RESULT_ERROR) {
ToastUtils.longToast(Crop.getError(result).getMessage());
}
canPerformLogout.set(true);
}