npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@squareetlabs/cordova-plugin-android-edge-to-edge

v1.1.3

Published

Edge-to-edge support for Android 15 (API 35) in Cordova and Ionic 3 apps. Handles system bars transparency, WindowInsets, and safe areas to avoid toolbar overlap.

Downloads

71

Readme

Android Edge to Edge

Edge-to-edge support for Android 15 (API 35) in Cordova (Cordova Android 10+). Prevents overlaps with status/toolbar by exposing WindowInsets and making bars transparent.

Installation

cordova plugin add @squareetlabs/cordova-plugin-android-edge-to-edge

Usage in Cordova applications

document.addEventListener('deviceready', async () => {
  await AndroidEdgeToEdge.enable({ 
    lightStatusBar: true, 
    lightNavigationBar: true,
    backgroundColor: '#FFFFFF',
    // Optional: packages to ignore (prevents issues with plugins like camera)
    ignoredPackages: [
      'org.apache.cordova.camera',
      'org.apache.cordova.file'
    ]
  });
  
  AndroidEdgeToEdge.subscribeInsets(({ top, bottom, left, right }) => {
    const toolbar = document.querySelector('.app-toolbar');
    const bottomBar = document.querySelector('.app-bottom-bar');
    if (toolbar) toolbar.style.paddingTop = `calc(var(--toolbar, 0px) + ${top}px)`;
    if (bottomBar) bottomBar.style.paddingBottom = `calc(var(--bottombar, 0px) + ${bottom}px)`;
    
    // You can also access insets via CSS variables:
    // --cordova-safe-area-inset-top
    // --cordova-safe-area-inset-bottom
    // --cordova-safe-area-inset-left
    // --cordova-safe-area-inset-right
  });
  
  // When you need to disable edge-to-edge mode:
  // await AndroidEdgeToEdge.disable();
  
  // If you need to change the background color dynamically:
  // await AndroidEdgeToEdge.setBackgroundColor('#000000');
});

Key Features

  • Automatic Margin Handling: Automatically applies margins to WebView based on system insets
  • Full Edge-to-Edge Support: Makes status and navigation bars transparent
  • Keyboard Support: Handles virtual keyboard appearance and disappearance
  • CSS Variables: Exposes insets as CSS variables for easy styling
  • Cutout Support: Handles display cutouts (notches) properly
  • Callback API: Notifies your app when insets change
  • Plugin Compatibility: Option to ignore specific packages that might conflict

API Reference

Methods

enable(options)

Enables edge-to-edge mode in the Android application.

Parameters:

  • options (Object): Configuration options (see Options table below)

Returns: Promise that resolves when edge-to-edge mode is enabled

disable()

Disables edge-to-edge mode and restores default system bars.

Returns: Promise that resolves when edge-to-edge mode is disabled

getInsets()

Gets the current system insets values.

Returns: Promise that resolves with an object containing top, bottom, left, and right inset values in pixels

subscribeInsets(callback)

Subscribes to system insets changes.

Parameters:

  • callback (Function): Function that will be called when insets change, with an object containing top, bottom, left, and right values in pixels

checkInsets()

Checks and updates the system insets. Useful when UI elements change and you need to recalculate insets.

Returns: Promise that resolves with the current inset values

setBackgroundColor(color)

Changes the background color of the WebView container.

Parameters:

  • color (string): Color in CSS format (#RRGGBB or #AARRGGBB)

Returns: Promise that resolves when the background color has been changed

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | lightStatusBar | boolean | true | If true, uses light icons in the status bar | | lightNavigationBar | boolean | true | If true, uses light icons in the navigation bar | | backgroundColor | string | #FFFFFF | Background color for the WebView container | | ignoredPackages | string/array | null | Packages to ignore when sending insets events. Useful to prevent issues with plugins that launch their own activities like org.apache.cordova.camera.CameraLauncher. Can be a single string or an array of strings. |

CSS Variables

The plugin automatically sets the following CSS variables that you can use in your stylesheets:

:root {
  --cordova-safe-area-inset-top: 0px;
  --cordova-safe-area-inset-bottom: 0px;
  --cordova-safe-area-inset-left: 0px;
  --cordova-safe-area-inset-right: 0px;
}

Troubleshooting

If you experience issues with the plugin:

  1. Make sure you're using Cordova Android 10 or higher
  2. Try calling checkInsets() after UI changes or orientation changes
  3. For plugins that launch their own activities (like camera), add them to the ignoredPackages option
  4. If you're using a custom WebView implementation, make sure it's compatible with WindowInsets API