Amri.CircularImageView.Binding 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Amri.CircularImageView.Binding --version 1.0.0
                    
NuGet\Install-Package Amri.CircularImageView.Binding -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Amri.CircularImageView.Binding" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Amri.CircularImageView.Binding" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Amri.CircularImageView.Binding" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Amri.CircularImageView.Binding --version 1.0.0
                    
#r "nuget: Amri.CircularImageView.Binding, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Amri.CircularImageView.Binding@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Amri.CircularImageView.Binding&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Amri.CircularImageView.Binding&version=1.0.0
                    
Install as a Cake Tool

CircularImageView .NET Android Binding

NuGet License: MIT

A modern .NET 10 Android binding library for CircularImageView with full XML attribute support, clean API, and AndroidX compatibility. Perfect for .NET Android and .NET MAUI applications.

Features

Circular ImageView - Display images in perfect circles ✅ Customizable Borders - Set border width and color with full control
Shadow Support - Add shadows with configurable radius and color
Background Color - Set circle background color independently
AndroidX Compatible - Fully compatible with modern AndroidX libraries
MAUI Ready - Works seamlessly in .NET MAUI projects
Strongly-Typed API - Clean, idiomatic .NET API with full IntelliSense support
Extension Methods - Convenient helpers for common operations

Installation

NuGet Package Manager

Install-Package Amri.CircularImageView.Binding

.NET CLI

dotnet add package Amri.CircularImageView.Binding

PackageReference

<PackageReference Include="Amri.CircularImageView.Binding" Version="1.0.0" />

Usage

XML Layout

Add the CircularImageView to your Android XML layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="center">

    
    <com.amri.circularimageview.CircularImageView
        android:id="@+id/profileImage"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:src="@drawable/profile_photo"
        app:civ_border_width="4dp"
        app:civ_border_color="#FFFFFF"
        app:civ_shadow_radius="4"
        app:civ_circle_background_color="#FF0000" />



</LinearLayout>

C# Code

Use the CircularImageView in your C# code:

using Com.Amri.CircularImageView;
using Com.Amri.CircularImageView.Extensions;
using Android.Graphics;

// Find the view
var circularImageView = FindViewById<CircularImageView>(Resource.Id.profileImage);

// Set properties programmatically
circularImageView.BorderWidth = 8f;
circularImageView.BorderColor = Color.White.ToArgb();
circularImageView.ShadowRadius = 10f;
circularImageView.CircleBackgroundColor = Color.ParseColor("#FF5722").ToArgb();

// Or use extension methods for convenience
circularImageView.SetBorderColor(Color.Blue);
circularImageView.SetBorderWidthDp(4f); // Automatically converts dp to pixels
circularImageView.SetShadowRadiusDp(6f);
circularImageView.SetCircleBackgroundColor(Color.Transparent);

// Load image from URL (using your preferred image loading library)
// Example with Glide or similar:
// Glide.With(this).Load(imageUrl).Into(circularImageView);

.NET MAUI Integration

In your .NET MAUI Android project:

using Com.Amri.CircularImageView;
using Microsoft.Maui.Platform;

// In your handler or platform-specific code
var circularImageView = new CircularImageView(context);
circularImageView.SetBorderWidthDp(3f);
circularImageView.SetBorderColor(Android.Graphics.Color.White);

Available XML Attributes

Attribute Type Description
app:civ_border_width dimension Border width in dp/px
app:civ_border_color color Border color
app:civ_circle_background_color color Background color of the circle
app:civ_shadow_radius float Shadow blur radius
app:civ_shadow_color color Shadow color

Available Properties

Property Type Description
BorderWidth float Gets/sets the border width in pixels
BorderColor int/Color Gets/sets the border color
CircleBackgroundColor int/Color Gets/sets the circle background color
ShadowRadius float Gets/sets the shadow radius
ShadowColor int/Color Gets/sets the shadow color

Extension Methods

The library includes helpful extension methods in Com.Amri.CircularImageView.Extensions:

  • SetBorderColor(Color color) - Set border color using Color object
  • SetBorderColorArgb(int argb) - Set border color using ARGB int
  • SetCircleBackgroundColor(Color color) - Set background color
  • SetBorderWidthDp(float widthDp) - Set border width in dp (auto-converts to px)
  • SetShadowRadiusDp(float radiusDp) - Set shadow radius in dp (auto-converts to px)

Requirements

  • .NET 10 or later
  • Android API 21+ (Android 5.0 Lollipop)
  • AndroidX libraries

Migration from Xamarin

If you're migrating from Xamarin.Android:

  1. Update to .NET 10: <TargetFramework>net10.0-android</TargetFramework>
  2. Replace old package references with this binding
  3. Update namespace imports to Com.Amri.CircularImageView
  4. No code changes needed - API is fully compatible!

Performance Tips

  • Reuse CircularImageView instances when possible
  • Use appropriate image sizes to avoid unnecessary scaling
  • Consider using image loading libraries (Glide, Coil) for better performance
  • The view properly implements disposal patterns for native resources

Troubleshooting

Border not showing

Ensure you've set both BorderWidth and BorderColor:

circularImageView.BorderWidth = 4f;
circularImageView.BorderColor = Color.White;

Image appears stretched

Make sure layout_width and layout_height are equal for perfect circles:

android:layout_width="100dp"
android:layout_height="100dp"

Shadow not visible

Shadows require sufficient padding around the view:

android:layout_margin="8dp"

License

This binding library is released under the MIT License. See LICENSE for details.

The original CircularImageView library may have its own license. Please refer to the original library's documentation.

Support

Changelog

Version 1.0.0

  • Initial release
  • .NET 10 Android binding
  • Full XML attribute support
  • Extension methods for idiomatic .NET API
  • AndroidX compatibility
  • Complete documentation

Made with ❤️ for the .NET Android and MAUI community

Product Compatible and additional computed target framework versions.
.NET net10.0-android36.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated