I want to achieve behaviour similar to video attached below from the WEBTOONS app, where content is in full screen and they hide and show status bar
I want to achieve this behaviour in API Level 23..to..31
What is the correct way to achieve this behaviour without using deprecated code ?
Thanks
I have tried multiple solutions as mentioned below but none of the gives the required behaviour and also few methods below are deprecated.
WindowManager.LayoutParams.FLAG_FULLSCREEN)
-> requireActivity().window.setFlags(LayoutParams.FLAG_LAYOUT_NO_LIMITS, LayoutParams.FLAG_LAYOUT_NO_LIMITS)
-> windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
-> requireActivity().window.setDecorFitsSystemWindows(false)
-> requireActivity().window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
UPDATE
I am able achieve the required behaviour only on Devices without notch using this code function
but fails for the devices with notch ,content wont get covered under status bar in full screen mode gives a black space in the status bar region
tried
tried method
but didn’t help
And also content resizes as I exit full screen mode content goes under visible status bar
Above code is deprecate in API level 30 appreciate if could share exact non-deprecated alternative code
UPDATE2
was able to find the solution for all android versionas mentioned here
for more details refer this answer