This is an Android project allowing to realize a circular ImageView in the simplest way possible.
To make a circular ImageView add CircularImageView in your layout XML and add CircularImageView library in your project or you can also grab it via Gradle:
compile 'com.mikhaellopez:circularimageview:2.0.2'
<com.mikhaellopez.circularimageview.CircularImageView
android:layout_width="250dp"
android:layout_height="250dp"
android:src="@drawable/image"
app:border_color="#EEEEEE"
app:border_width="4dp"
app:shadow="true"
app:shadow_radius="10"
app:shadow_color="#8BC34A"/>
You must use the following properties in your XML to change your CircularImageView.
#####Properties:
app:border
(boolean) -> default trueapp:border_color
(color) -> default WHITEapp:border_width
(dimension) -> default 4dpapp:shadow
(boolean) -> default falseapp:shadow_color
(color) -> default BLACKapp:shadow_radius
(float) -> default 8.0f
CircularImageView circularImageView = (CircularImageView)findViewById(R.id.yourCircularImageView);
// Set Border
circularImageView.setBorderColor(getResources().getColor(R.color.GrayLight));
circularImageView.setBorderWidth(10);
// Add Shadow with default param
circularImageView.addShadow();
// or with custom param
circularImageView.setShadowRadius(15);
circularImageView.setShadowColor(Color.RED);
Stack OverFlow:
I realized this project using this post:
- Create circular image view in android
- How to add a shadow and a border on circular imageView android?
CircularImageView by Lopez Mikhael is licensed under a Apache License 2.0.