Need help with CircleView?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

lopspower
155 Stars 16 Forks Apache License 2.0 62 Commits 2 Opened issues

Description

Create circular view in android (change color, border & shadow) ⚫

Services available

!
?

Need anything else?

Contributors list

# 23,332
Java
Kotlin
Android
rxkotli...
60 commits
# 29,539
Kotlin
Android
Shell
android...
1 commit

CircleView

sample

Platform API Maven Central Twitter

This is an Android project allowing to realize a circular View in the simplest way possible. Finish the oval shapes of all colors in your projects.

Android app on Google Play

USAGE

To make a circular View add CircleView in your layout XML and add CircleView library in your project or you can also grab it via Gradle:

implementation 'com.mikhaellopez:circleview:1.4.0'

XML


You must use the following properties in your XML to change your CircleView.

| Properties | Type | Default | | ------------------------------- | ------------------------------------------------------------ | --------------- | |

app:cv_color
| color | WHITE | |
app:cv_color_start
| color | cvcolor | | `app:cvcolorend` | color | cvcolor | |
app:cv_color_direction
| lefttoright, righttoleft, toptobottom or bottomtotop | lefttoright | |
app:cv_border
| boolean | false | |
app:cv_border_width
| dimension | 4dp | |
app:cv_border_color
| color | BLACK | |
app:cv_border_color_start
| color | cvbordercolor | |
app:cv_border_color_end
| color | cvbordercolor | |
app:cv_border_color_direction
| lefttoright, righttoleft, toptobottom or bottomtotop | lefttoright | |
app:cv_shadow
| boolean | false | |
app:cv_shadow_color
| color | BLACK | |
app:cv_shadow_radius
| float | 8.0f | |
app:cv_shadow_gravity
| center, top, bottom, start or end | bottom |

:informationsource: You can also use

android:elevation
instead of `app:cvshadow` to have default Material Design elevation.

KOTLIN

sample

val circleView = findViewById(R.id.circleView)
circleView.apply {
    // Set Color
    circleColor = Color.WHITE
    // or with gradient
    circleColorStart = Color.BLACK
    circleColorEnd = Color.RED
    circleColorDirection = CircleView.GradientDirection.TOP_TO_BOTTOM

// Set Border
borderWidth = 10f
borderColor = Color.BLACK
// or with gradient
borderColorStart = Color.BLACK
borderColorEnd = Color.RED
borderColorDirection = CircleView.GradientDirection.TOP_TO_BOTTOM

// Add Shadow with default param
shadowEnable = true
// or with custom param
shadowRadius = 15f
shadowColor = Color.RED
shadowGravity = CircleView.ShadowGravity.CENTER

}

JAVA

CircleView circleView = findViewById(R.id.circleView);

// Set Color circleView.setCircleColor(Color.WHITE); // or with gradient circleView.setCircleColorStart(Color.BLACK); circleView.setCircleColorEnd(Color.RED); circleView.setCircleColorDirection(CircleView.GradientDirection.TOP_TO_BOTTOM);

// Set Border circleView.setBorderWidth(10f); circleView.setBorderColor(Color.BLACK); // or with gradient circleView.setBorderColorStart(Color.BLACK); circleView.setBorderColorEnd(Color.RED); circleView.setBorderColorDirection(CircleView.GradientDirection.TOP_TO_BOTTOM);

// Add Shadow with default param circleView.setShadowEnable(true); // or with custom param circleView.setShadowRadius(15f); circleView.setShadowColor(Color.RED); circleView.setShadowGravity(CircleView.ShadowGravity.CENTER);

SUPPORT ❤️

Find this library useful? Support it by joining stargazers for this repository ⭐️
And follow me for my next creations 👍

LICENCE

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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.