Capacitor plugin for retrieving proper top offset of Android status bar.
This repo is published version with changed name of https://github.com/jorisbertomeu/capacitor-insets-v2, which was based on archived https://github.com/igorcd/capacitor-insets-plugin/. It should work perfectly fine in Capacitor@4
.
# with npm
npm install --save @emmaus/capacitor-plugin-android-insets
# with yarn
yarn add @emmaus/capacitor-plugin-android-insets
# after any install
npx cap sync
This plugin is required only on Android when using StatusBar.setOverlaysWebView({ overlay: true })
. There is a problem with top offset counting, when status bar is transparent. Related issue: ionic-team/capacitor#2840.
import { AndroidInsets } from '@emmaus/capacitor-plugin-android-insets';
const { value } = await AndroidInsets.top();
getDisplayInfo() => Promise<GetDisplayInfoReturn>
Returns: Promise<GetDisplayInfoReturn>
setNavbarBackgroundColor(options: { r: number; g: number; b: number; a: number; }) => Promise<void>
Param | Type |
---|---|
options |
{ r: number; g: number; b: number; a: number; } |
Prop | Type |
---|---|
isGestureMode |
boolean |
rotation |
'portrait' | 'landscape-left' | 'landscape-right' | 'unknown' |
statusbarHeight |
number |
navbarPosition |
'BOTTOM' | 'RIGHT' | 'LEFT' | 'UNKNOWN' |
navbarSize |
number |
insetTop |
number |
insetRight |
number |
insetBottom |
number |
insetLeft |
number |