Skip to content

Create circular ImageView in Android in the simplest way possible.

License

Notifications You must be signed in to change notification settings

NinjaRat84/CircularImageView-1

 
 

Repository files navigation

CircularImageView

Android Arsenal Platform API Twitter

This is an Android project allowing to realize a circular ImageView in the simplest way possible.

sample

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 true
  • app:civ_border_color (color) -> default WHITE
  • app:civ_border_width (dimension) -> default 4dp
  • app:civ_shadow (boolean) -> default false
  • app:civ_shadow_color (color) -> default BLACK
  • app: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:

LICENCE

CircularImageView by Lopez Mikhael is licensed under a Apache License 2.0.

About

Create circular ImageView in Android in the simplest way possible.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%