当前位置: 首页>>代码示例>>Java>>正文


Java Crop.RESULT_ERROR属性代码示例

本文整理汇总了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);
    }
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:38,代码来源:ChatSDKChatHelper.java

示例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());
        }
    }
 
开发者ID:weimin96,项目名称:shareNote,代码行数:9,代码来源:EditUserInfoActivity.java

示例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();
    }
}
 
开发者ID:salRoid,项目名称:Clasick,代码行数:17,代码来源:ChangeProfile.java

示例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();
    }
}
 
开发者ID:salRoid,项目名称:Clasick,代码行数:19,代码来源:UserImage.java

示例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());
    }
}
 
开发者ID:VernonVan,项目名称:Face,代码行数:16,代码来源:FaceDetectFragment.java

示例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());
    }
}
 
开发者ID:VernonVan,项目名称:Face,代码行数:17,代码来源:FunnyCharletFragment.java

示例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());
    }

}
 
开发者ID:VernonVan,项目名称:Face,代码行数:23,代码来源:SimilarFaceFragment.java

示例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();
    }
}
 
开发者ID:Technologx,项目名称:Fire-Bird-Dashboard-for-Zooper,代码行数:26,代码来源:DetailActivity.java

示例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());
        }
    }
 
开发者ID:xujiaji,项目名称:HaiNaBaiChuan,代码行数:9,代码来源:EditUserInfoFragment.java

示例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());
    }
}
 
开发者ID:MiracleWong,项目名称:MWZhiHuDaily,代码行数:7,代码来源:PickPhotoActivity.java

示例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();
}
 
开发者ID:androidertc,项目名称:iLocker,代码行数:8,代码来源:CropImageActivity.java

示例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();
  }
}
 
开发者ID:MMAUG,项目名称:FloodInfo,代码行数:7,代码来源:ReportActivity.java

示例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);
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:9,代码来源:MyProfileActivity.java

示例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());
    }
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:8,代码来源:SignUpActivity.java

示例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);
}
 
开发者ID:QuickBlox,项目名称:q-municate-android,代码行数:10,代码来源:CreateGroupDialogActivity.java


注:本文中的com.soundcloud.android.crop.Crop.RESULT_ERROR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。