CircularImageView
This is an Android project allowing to realize a circular ImageView in the simplest way possible.
USAGE
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:3.0.2'
XML
<com.mikhaellopez.circularimageview.CircularImageView
android:layout_width="250dp"
android:layout_height="250dp"
android:src="@drawable/image"
app:civ_border_color="#EEEEEE"
app:civ_border_width="4dp"
app:civ_shadow="true"
app:civ_shadow_radius="10"
app:civ_shadow_color="#8BC34A"/>
You must use the following properties in your XML to change your CircularImageView.
#####Properties:
app:civ_border
(boolean) -> default trueapp:civ_border_color
(color) -> default WHITEapp:civ_border_width
(dimension) -> default 4dpapp:civ_shadow
(boolean) -> default falseapp:civ_shadow_color
(color) -> default BLACKapp:civ_shadow_radius
(float) -> default 8.0f
JAVA
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);
LINK
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?
LICENCE
CircularImageView by Lopez Mikhael is licensed under a Apache License 2.0.