# Gesture Navigation: Handling visual overlaps (II)

DevFeed: [Gesture Navigation: Handling visual overlaps (II)](<https://devfeed.tech/articles/gesture-navigation-handling-visual-overlaps-ii-24924.md>)

Original publisher: [Read original article](<https://medium.com/androiddevelopers/gesture-navigation-handling-visual-overlaps-4aed565c134c?source=rss-9303277cb6db------2>)

Author: Chris Banes

Published: 2019-08-07T22:58:22Z

Content type: tutorial

Language: en

Sources: [Chris Banes on Medium](<https://devfeed.tech/sources/chris-banes-on-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [navigation](<https://devfeed.tech/topics/navigation.md>), [ui](<https://devfeed.tech/topics/ui.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [gesture-navigation](<https://devfeed.tech/tags/gesture-navigation.md>), [gestures](<https://devfeed.tech/tags/gestures.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

This tutorial explains how Android developers can use insets to prevent app views from being obscured by system UI when using edge-to-edge layouts. It introduces system UI and inset types, including system window insets, and describes how they help resolve visual conflicts with navigation bars, status bars, and the on-screen keyboard.

## Source excerpt

Cover image by Virginia PoltrackGesture Navigation: handling visual overlaps (II) This is the second post in our series on Gesture Navigation. If you want to skip to another post, you can find them listed below: Gesture Navigation: Going edge-to-edge (I) Gesture Navigation: Handling gesture conflicts (III) Gesture Navigation: Immersive Modes (IV) In part 1 of this series, we explored how you can make your app go 'edge-to-edge'. Unfortunately this can result in some of your views being drawn behind the system bars, obscuring them from the user. This post explores how we can inset those views, moving them away from the system bars. For the rest of this post I'll be referring to something called the 'system UI'. This is what we call any of the system provided UI on screen, such as the navigation bar and status bar. It also includes things like the notifications panel. Insets The term insets tends to strike fear into Android developers, usually from their experience trying to draw behind the status bar in the days of Android Lollipop. For example, this very old StackOverflow question on the topic has a lot of views 😲. Insets tell you which parts of the screen intersect with the system UI, like the navigation or status bar. Intersecting could mean simply being displayed above your content, but it can also tell you about system gestures too. We can use the insets to try and remove any conflicts, for example by moving a view in from the edges. On Android, insets are represented by the WindowInsets class, and WindowInsetsCompat in AndroidX. With Android Q, we have 5 types of insets to consider when laying out your app. Which inset type you use depends on the situation you're in, so let's go through each type and look... System window insets Method: getSystemWindowInsets() System window insets are the most common type of insets in use today. They have been around since API 1 in various forms, and are dispatched to the view hierarchy whenever the system UI is displayed above yo