Understanding WindowInsets
summary
Going full screen with setDecorFitsSystemWindows(false) pushes UI under the navigation bar so measure the navigation inset with getInsets(Type.navigationBars()) and apply bottom margin or padding; getInsets is API 29+ so use WindowInsetsCompat/WindowCompat for backward compatibility (works on ~API 21+). Use Insetter to replace verbose boilerplate with builder calls like marginBottom(type = navigationBars). Use WindowInsetsController to set status bar appearance and show/hide IME; Android 12 adds rounded corners and privacy indicator bounds to avoid clipped icons.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:10Understanding window insets
- 3:40Implementing full screen
- 7:31Managing insets programmatically
- 12:13Simplifying with Insetter
- 13:42Handling display cutouts
- 17:04Advanced window appearance
- 19:15Keyboard visibility control
- 21:37Android 12 features
- 25:55Q&A and closing
related talks
28mBecoming a master window fitter�
07mInsets: Compose edition
07mInsets: Compose edition
37mGoing edge-to-edge with Gesture Navigation
21mPractical edge-to-edge: A Complete Walkthrough
38mCutting-Edge-to-Edge in Android 15
44mAndroid Insets and Keyboard Animation
28mBuilding Robust Screens That Handle Window Size Changes
