FloatingView.java 文件源码

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

项目:FastAccess 作者:
public void setupImageView() {
    if (imageView != null) {
        String path = PrefHelper.getString(PrefConstant.CUSTOM_ICON);
        if (!InputHelper.isEmpty(path)) {
            path = Uri.decode(PrefHelper.getString(PrefConstant.CUSTOM_ICON));
            boolean fileExists = new File(path).exists();
            if (fileExists) {
                imageView.setImageDrawable(null);
                Bitmap src = BitmapFactory.decodeFile(path);
                if (src == null) {
                    imageView.setImageResource(R.drawable.ic_app_drawer_icon);
                    onMoving(false);
                    return;
                }
                RoundedBitmapDrawable dr = RoundedBitmapDrawableFactory.create(getResources(), src);
                dr.setCornerRadius(Math.max(src.getWidth(), src.getHeight()) / 2.0f);
                imageView.setImageDrawable(dr);
                return;
            }
        }
        imageView.setImageResource(R.drawable.ic_app_drawer_icon);
        onMoving(false);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号