1

So i was watching this tutorial by google today here https://youtu.be/jal0l48OTxk and i figured that doing

        myCanvasView.systemUiVisibility = SYSTEM_UI_FLAG_FULLSCREEN

is now deprecated and i need to use windowInsetsController instead. First off, I am new to android and i don't know how to use this new thing which clearly doesn't work in the exact same way as the old API so it's not a direct replacement but rather more nuanced one. Seondly, I noticed that windowInsetsController is not backwards compatible and there is something like windowInsetsControllerCompat that exists out there. However, I am not able to access it like this:

        myCanvasView.windowInsetsControllerCompat

but

        myCanvasView.windowInsetsController

works fine. Can someone here help me out?

Sbeve
  • 91
  • 2
  • 16

2 Answers2

0

WindowCompat.setDecorFitsSystemWindows(window, false)

0

You can use

WindowCompat.getInsetsController(getWindow(), myCanvasView);

instead of:

myCanvasView.windowInsetsController

See https://developer.android.com/reference/androidx/core/view/WindowCompat#WindowCompat(), and https://developer.android.com/develop/ui/views/layout/immersive

user3615737
  • 104
  • 4