Reputation: 11
To ensure the modern look for my application, I want to make it goes edge-to-edge. Through some research I know that we can achieve it in 3 steps:
The problem is, before I came up with the summary, I get some tips and tricks to use
window.setFlags(
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
)
It works all the time! even with older API version, I think. And I don't even have to change the theme file. And in all the cases, I don't even have to change the translucent. So...why do we need to use many other methods while window.setFlags for FLAG_LAYOUT_NO_LIMITS works all the time?
I tried to make my app goes edge-to-edge using methods mentioned in Android API version 29 and 30. I tried the same with window.setFlags FLAG_LAYOUT_NO_LIMITS.
I expect a unified method that align with Android official site's documentation.
Upvotes: 1
Views: 254
Reputation: 580
In case someone is still searching for this, using the:
window.setFlags(
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
)
Results in problem to detect keyboard on Android 10 and below, meaning that the system can not detect that there is a keyboard open and that results in content of modal for example be below the keyboard when it is open, and whatever you do will not fix this until you remove the window flags.
Upvotes: 0