Com.Mikhaellopez.CircularImageView
4.5.1
dotnet add package Com.Mikhaellopez.CircularImageView --version 4.5.1
NuGet\Install-Package Com.Mikhaellopez.CircularImageView -Version 4.5.1
<PackageReference Include="Com.Mikhaellopez.CircularImageView" Version="4.5.1" />
<PackageVersion Include="Com.Mikhaellopez.CircularImageView" Version="4.5.1" />
<PackageReference Include="Com.Mikhaellopez.CircularImageView" />
paket add Com.Mikhaellopez.CircularImageView --version 4.5.1
#r "nuget: Com.Mikhaellopez.CircularImageView, 4.5.1"
#:package Com.Mikhaellopez.CircularImageView@4.5.1
#addin nuget:?package=Com.Mikhaellopez.CircularImageView&version=4.5.1
#tool nuget:?package=Com.Mikhaellopez.CircularImageView&version=4.5.1
CircularImageView Binding for .NET Android
.NET 10 Android Binding Library for CircularImageView by Mikhael LOPEZ (lopspower).
About
CircularImageView is a fast circular ImageView for Android with optional border and shadow.
- Original Library: lopspower/CircularImageView
- Binding Version: 4.3.1
- Target Framework: net10.0-android
- Dependencies: Xamarin.AndroidX.AppCompat 1.7.0.5
Installation
NuGet Package Manager
Install-Package Com.Mikhaellopez.CircularImageView
.NET CLI
dotnet add package Com.Mikhaellopez.CircularImageView
PackageReference
<PackageReference Include="Com.Mikhaellopez.CircularImageView" Version="4.5.0" />
Usage
XML Layout (AXML)
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/circularImageView"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="@drawable/my_image"
app:civ_border_width="4dp"
app:civ_border_color="#FF0000"
app:civ_circle_color="#FFFFFF"
app:civ_shadow="true"
app:civ_shadow_radius="10dp"
app:civ_shadow_color="#8BC34A" />
C# Programmatic Usage
using Com.Mikhaellopez.Circularimageview;
using Android.Graphics;
// In your Activity
var circularImageView = FindViewById<CircularImageView>(Resource.Id.circularImageView);
// Set border
circularImageView.BorderWidth = 10f; // Pixels
circularImageView.BorderColor = Color.Red;
// Set gradient border
circularImageView.BorderColorStart = new Java.Lang.Integer(Color.ParseColor("#FF5722"));
circularImageView.BorderColorEnd = new Java.Lang.Integer(Color.ParseColor("#FFC107"));
circularImageView.BorderColorDirection = GradientDirection.LeftToRight;
// Set circle background color
circularImageView.CircleColor = Color.White;
// Set gradient circle color
circularImageView.CircleColorStart = new Java.Lang.Integer(Color.ParseColor("#E91E63"));
circularImageView.CircleColorEnd = new Java.Lang.Integer(Color.ParseColor("#9C27B0"));
circularImageView.CircleColorDirection = GradientDirection.TopToBottom;
// Configure shadow
circularImageView.ShadowEnable = true;
circularImageView.ShadowRadius = 15f;
circularImageView.ShadowColor = Color.Gray;
circularImageView.ShadowGravity = ShadowGravity.Bottom;
Available Properties
Border Properties
| Property | Type | Description |
|---|---|---|
BorderColor |
int |
Solid border color (ARGB format) |
BorderColorStart |
Java.Lang.Integer? |
Gradient border start color |
BorderColorEnd |
Java.Lang.Integer? |
Gradient border end color |
BorderColorDirection |
GradientDirection |
Gradient direction for border |
BorderWidth |
float |
Border width in pixels |
Circle Background Properties
| Property | Type | Description |
|---|---|---|
CircleColor |
int |
Solid circle background color |
CircleColorStart |
Java.Lang.Integer? |
Gradient circle start color |
CircleColorEnd |
Java.Lang.Integer? |
Gradient circle end color |
CircleColorDirection |
GradientDirection |
Gradient direction for circle |
Shadow Properties
| Property | Type | Description |
|---|---|---|
ShadowEnable |
bool |
Enable/disable shadow |
ShadowRadius |
float |
Shadow blur radius in pixels |
ShadowColor |
int |
Shadow color (ARGB format) |
ShadowGravity |
ShadowGravity |
Shadow position |
Enums
GradientDirection
LeftToRightRightToLeftTopToBottomBottomToTop
ShadowGravity
CenterTopBottomStartEnd
XML Attributes
| Attribute | Format | Description |
|---|---|---|
civ_border |
boolean |
Enable border |
civ_border_width |
dimension |
Border width |
civ_border_color |
color |
Solid border color |
civ_border_color_start |
color |
Gradient border start color |
civ_border_color_end |
color |
Gradient border end color |
civ_border_color_direction |
enum |
Gradient direction (left_to_right, right_to_left, top_to_bottom, bottom_to_top) |
civ_circle_color |
color |
Solid circle background color |
civ_circle_color_start |
color |
Gradient circle start color |
civ_circle_color_end |
color |
Gradient circle end color |
civ_circle_color_direction |
enum |
Gradient direction |
civ_shadow |
boolean |
Enable shadow |
civ_shadow_color |
color |
Shadow color |
civ_shadow_radius |
dimension |
Shadow blur radius |
civ_shadow_gravity |
enum |
Shadow position (center, top, bottom, start, end) |
Building from Source
Prerequisites
- .NET 10 SDK
- Android SDK
- Xamarin.AndroidX.AppCompat 1.7.0.5
Build Steps
- Clone the repository
- Navigate to the binding project directory
- Build the project:
dotnet build
- The NuGet package will be generated in
bin/Debugorbin/Release
Project Structure
CircularImageView.Binding/
├── Jars/
│ └── circularimageview-4.3.1.aar # Android library
├── Transforms/
│ └── Metadata.xml # Binding metadata (currently empty)
├── Resources/
│ └── layout/
│ └── sample_layout.axml # Sample layout
├── SampleActivity.cs # Sample C# code
├── CircularImageView.Binding.csproj # Project file
└── README.md # This file
Complete Example
See SampleActivity.cs and sample_layout.axml for a complete working example.
Important Notes
Color Format
- Color properties use ARGB integer format (Android color int)
- Use
Color.ParseColor("#RRGGBB")orColor.Argb(a, r, g, b)to create colors - For gradient colors, wrap in
Java.Lang.Integer:new Java.Lang.Integer(Color.Red)
Namespace Collision
If you have a namespace collision (e.g., Com.Mikhaellopez.CircularImageView.Sample), use an alias:
using CircularImageViewControl = Com.Mikhaellopez.Circularimageview.CircularImageView;
var imageView = FindViewById<CircularImageViewControl>(Resource.Id.circularImageView);
Package Name
- Java Package:
com.mikhaellopez.circularimageview - C# Namespace:
Com.Mikhaellopez.Circularimageview - Class Name:
CircularImageView
Build Status
✅ ZERO Errors
✅ ZERO Warnings
✅ Nullable reference types enabled
✅ All properties properly exposed
License
This binding library is licensed under Apache License 2.0 (same as the original library).
Original library: © 2023 Mikhael LOPEZ
Credits
- Original Library: Mikhael LOPEZ
- Binding: Nkkinsoft
Support
For issues with the binding library, please open an issue on this repository.
For issues with the original library, see the original repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. |
-
net10.0-android36.0
- Xamarin.AndroidX.AppCompat (>= 1.7.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
.Net 10 version