Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

AndroidApplication.currentWindowInsets

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static Android.AndroidWindowInsets currentWindowInsets;

Description

Provides current window insets for the application.

The window insets represent the system UI elements, such as the status and navigation bars.

Note: The insets are relative to the activity's frame layout. Querying insets manually through this property is a slow operation

Additional resources: AndroidApplication.onWindowInsetsChanged.

using UnityEngine;
using UnityEngine.Android;

public class Controller : MonoBehaviour { public void Start() { var insets = AndroidApplication.currentWindowInsets; Debug.Log($"NavigationBars visible " + insets.IsVisible(AndroidWindowInsets.Type.NavigationBars)); Debug.Log($"StatusBars visible " + insets.IsVisible(AndroidWindowInsets.Type.StatusBars)); } }