Open MAJigsaw77 opened 1 year ago
Adobe AIR 50 has a new safeArea
API in flash.display.Screen
https://airsdk.dev/reference/actionscript/3.0/flash/display/Screen.html#safeArea
It would be useful to expose this information in Lime so that OpenFL can implement the same API.
I wonder if any newer versions of SDL expose the safe area?
In the meantime, this extension may be useful:
👍
Based on some quick research, SDL does not seem to have an API for notch/safearea yet.
Here's their open issue: libsdl-org/SDL#3243
By modifying GameActivity from the android template i could get a some results but the offsets doesn't seem so accurate.
This is the code i used in any case.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
{
getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}
This might be useful in games for example.