1<com.makeramen.roundedimageview.RoundedImageView
2 xmlns:app="http://schemas.android.com/apk/res-auto"
3 android:id="@+id/imageView1"
4 android:src="@drawable/photo1"
5 android:scaleType="fitCenter"
6 app:riv_corner_radius="30dip"
7 app:riv_border_width="2dip"
8 app:riv_border_color="#333333"
9 app:riv_mutate_background="true"
10 app:riv_tile_mode="repeat"
11 app:riv_oval="true" />
1repositories {
2 mavenCentral()
3}
4
5dependencies {
6 compile 'com.makeramen:roundedimageview:2.3.0'
7}
8
1Transformation transformation = new RoundedTransformationBuilder()
2 .borderColor(Color.BLACK)
3 .borderWidthDp(3)
4 .cornerRadiusDp(30)
5 .oval(false)
6 .build();
7
8Picasso.with(context)
9 .load(url)
10 .fit()
11 .transform(transformation)
12 .into(imageView);
1RoundedImageView riv = new RoundedImageView(context);
2riv.setScaleType(ScaleType.CENTER_CROP);
3riv.setCornerRadius((float) 10);
4riv.setBorderWidth((float) 2);
5riv.setBorderColor(Color.DKGRAY);
6riv.mutateBackground(true);
7riv.setImageDrawable(drawable);
8riv.setBackground(backgroundDrawable);
9riv.setOval(true);
10riv.setTileModeX(Shader.TileMode.REPEAT);
11riv.setTileModeY(Shader.TileMode.REPEAT);