第二阶段:冲刺2(个人界面的优化---头像上传)

今天主要完成了个人界头像的优化,上次是做的真垃圾,这次稍微美观了一下。有默认的头像,还带有磨砂背景,效果图如下


磨砂背景和圆角头像的依赖:

//    glide框架:用于加载图片
//    glide-transformations:用于磨砂实现
//    circleimageview:圆形图片view
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'jp.wasabeef:glide-transformations:2.0.1'
    implementation 'de.hdodenhof:circleimageview:2.1.0'

磨砂背景的代码:

imageViewHead = findViewById(R.id.h_head);
blurImageView = findViewById(R.id.h_back);
Glide.with(this).load(R.drawable.head)
                    .bitmapTransform(new BlurTransformation(this, 25), new CenterCrop(this))
                    .into(blurImageView);

            Glide.with(this).load(R.drawable.head)
                    .bitmapTransform(new CropCircleTransformation(this))
                    .into(imageViewHead);
原文地址:https://www.cnblogs.com/yangxiao-/p/13045218.html