I am trying to set safe inset in the activity as below:
@RequiresApi(Build.VERSION_CODES.Q)
override fun onAttachedToWindow() {
super.onAttachedToWindow()
val cutout = window.decorView.rootWindowInsets?.displayCutout
cutout?.safeInsetTop
cutout?.safeInsetBottom
cutout?.safeInsetLeft
cutout?.safeInsetRight
}
However I seem not to see any effect, meaning am implementing safe inset wrongly. I have not been able to come across a proper documentation on how to implement safe inset. Any help on how to do it on android is highly appreciated.
You can set the cutout mode by setting a style in your project & there by survive the notch hell,
for more information, read here