cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.25k stars 7.06k forks source link

Add Android P cutout area support #19285

Open formatCvt opened 5 years ago

formatCvt commented 5 years ago

Despite this https://github.com/cocos2d/cocos2d-x/issues/18810 issue, however cutout still is not supported by cocos (incl 3.17.1)

If we are rendering into the cutout area, we should use WindowInsets.getDisplayCutout() to retrieve a DisplayCutout object that contains the safe insets and bounding box for each cutout https://developer.android.com/reference/android/view/DisplayCutout

PR is coming.

AIGRIND-LLC commented 5 years ago

Hi @formatCvt , Tried to use new getSafeAreaRect implementation that supports cutouts. It seems that cutout insets are cached and won't be recalculated after device becomes rotated. insets Did you test that case?

formatCvt commented 5 years ago

Hey @AIGRIND-LLC, unfortunately i don't test this case