EditDocCoverDialog.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:foco 作者:
/**
 * Update image path text and image views.
 */
private void updateImage() {
    mImagePathText.setText(TextUtils.isEmpty(mImagePath) ? "-" : mImagePath);
    if (TextUtils.isEmpty(mImagePath)) {
        // if there is no selected image, load image placeholder
        Picasso.with(getActivity())
                .load(R.drawable.image_placeholder)
                .into(mImageView);
    } else {
        // It is important to be very careful loading this image because it can be
        // high resolution, very heavy and cause application memory problems
        // (there is no danger of out of memory thanks to picasso)
        Picasso.with(getActivity())
                .load(new File(mImagePath))
                .placeholder(R.drawable.image_placeholder)
                .memoryPolicy(MemoryPolicy.NO_CACHE)
                .resize(IMAGE_MAX_WIDTH_PX, IMAGE_MAX_HEIGHT_PX)
                .centerInside()
                .onlyScaleDown()
                .into(mImageView);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号