I have been using view.rootWindowInsets.stableInsetTop and bottom to get the height of the status and navigation bars, however this is now deprecated and the d
view.rootWindowInsets.stableInsetTop