SLVZ.Android.EdgeToEdge 1.1.5

dotnet add package SLVZ.Android.EdgeToEdge --version 1.1.5
                    
NuGet\Install-Package SLVZ.Android.EdgeToEdge -Version 1.1.5
                    
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="SLVZ.Android.EdgeToEdge" Version="1.1.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SLVZ.Android.EdgeToEdge" Version="1.1.5" />
                    
Directory.Packages.props
<PackageReference Include="SLVZ.Android.EdgeToEdge" />
                    
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 SLVZ.Android.EdgeToEdge --version 1.1.5
                    
#r "nuget: SLVZ.Android.EdgeToEdge, 1.1.5"
                    
#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 SLVZ.Android.EdgeToEdge@1.1.5
                    
#: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=SLVZ.Android.EdgeToEdge&version=1.1.5
                    
Install as a Cake Addin
#tool nuget:?package=SLVZ.Android.EdgeToEdge&version=1.1.5
                    
Install as a Cake Tool

Edge-to-Edge Handler

A lightweight Android-only helper library for handling Edge-to-Edge layouts in .NET MAUI applications.

This library must be initialized once, to correctly calculate system insets and apply Edge-to-Edge behavior.


⚠️ Requirements & Constraints

  • Android only
  • .NET MAUI
  • Must be executed only once
  • Requires access to both MainActivity and MainPage

This library intentionally avoids automatic lifecycle hooks to keep behavior predictable and explicit.


1. MainActivity Setup

You can provide the Activity to the handler in two ways

✅ Direct Injection

Set the activity directly in MainActivity.cs inside OnCreate:

protected override void OnCreate(Bundle savedInstanceState)
{
    WindowCompat.SetDecorFitsSystemWindows(Window, false);

    base.OnCreate(savedInstanceState);

    SLVZ.Android.EdgeToEdge.Handler.SetActivity(this);
}

2. MainPage Setup

You need to provide the ContentPage in MainPage

✅ Direct Injection

Set the page directly inside the constructor:

public MainPage()
{
    InitializeComponent();
    SLVZ.Android.EdgeToEdge.Handler.SetPage(this);
}

Done 😍

3. Initialize the Handler

After you provid ContentPage and Activity it will automaticly initialize and fix edge-to-edge screen

Design Philosophy

This library prioritizes:

  • Predictability over automation
  • Explicit control over hidden behavior
  • Stability across different Android versions

Automatic initialization was intentionally avoided to prevent fragile implementations.


License

MIT

👨‍💻 Author: SLVZ

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
1.1.5 133 1/5/2026