How can I get the Safe Area insets?

94 views
Skip to first unread message

Ferhat

unread,
Aug 1, 2026, 3:33:48 PMAug 1
to DroidScript
Hi. Is there any way in DroidScript to get the Android safe area (WindowInsets), including the top and bottom insets in pixels?
app.GetNavBarHeight() exists, but I couldn't find a way to get the safe area or the status bar inset.
On gesture navigation devices, my WebView content extends underneath the system navigation area, so some UI elements end up being covered by the gesture/navigation bar.
Is there a built-in API for retrieving the safe area insets, or is there another recommended way to handle this?

Alan Hendry

unread,
Aug 6, 2026, 3:07:08 PMAug 6
to DroidScript
HI,
If this an html project it may well be worth looking at the html
    <meta name="viewport" content="width=device-width">
Regards, ah

Ferhat

unread,
Aug 8, 2026, 1:22:33 PMAug 8
to DroidScript

Thanks for the suggestion. I already have the viewport meta tag set, but unfortunately it doesn't provide the Android WindowInsets or the actual status/navigation bar inset values.

The issue specifically occurs with gesture navigation, where the WebView content can extend into the system gesture area. I'm looking for a way in DroidScript to get the top/bottom safe-area insets in pixels, or another recommended way to prevent WebView content from being covered.


6 Ağustos 2026 Perşembe tarihinde saat 22:07:08 UTC+3 itibarıyla hendr...@gmail.com şunları yazdı:

Dave

unread,
Aug 30, 2026, 11:17:20 AM (5 days ago) Aug 30
to DroidScript
Are you using the cfg.EdgeToEdge option?  Why don't you just remove that if you are and DS will keep everything outside of the navigation areas.

Ferhat

unread,
Sep 2, 2026, 1:36:51 AM (3 days ago) Sep 2
to DroidScript

I’m not using cfg.EdgeToEdge. I don’t experience any issues on phones, but on the Samsung Galaxy Tab A7, when the app is used in landscape mode, the system navigation bar can overlap some of the buttons in the app. This issue does not occur in portrait mode.


30 Ağustos 2026 Pazar tarihinde saat 18:17:20 UTC+3 itibarıyla Dave şunları yazdı:

Dave

unread,
Sep 3, 2026, 12:36:35 PM (yesterday) Sep 3
to DroidScript
Try the new 2.80 version, it has app.GetSafeArea()

https://droidscript.org/download/v2.80/

You can use 'cutout' and 'system' options to filter for one thing, otherwise it returns the union of both
Reply all
Reply to author
Forward
0 new messages