CommonUtils.java 文件源码

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

项目:CeaselessAndroid 作者:
public static void setDynamicImage(Context context, ImageView target) {
    File currentBackgroundImage = new File(context.getCacheDir(), Constants.CURRENT_BACKGROUND_IMAGE);
    List<Transformation> transformations = new ArrayList<>();
    transformations.add(new BlurTransformation(context, 25, 4));

    if (currentBackgroundImage.exists()) {
        Picasso.with(context).load(currentBackgroundImage)
                .placeholder(R.drawable.placeholder_rectangle_scene)
                .fit()
                .centerCrop()
                .transform(transformations)
                .into(target);
    } else {
        Picasso.with(context).load(R.drawable.at_the_beach)
                .placeholder(R.drawable.placeholder_rectangle_scene)
                .fit()
                .centerCrop()
                .transform(transformations)
                .into(target);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号