Cover the entire screen

Alright, I added Samsung Galaxy A6, running Android 9, to the list of my test devices.

Using roaminggamer’s apk, I got the following results:

By adding the suggested function to my test, I got the following (I changed the grey rect into a circle and added another one to the centre to monitor for distortions):

So, the function did seem to address the issue in that the background was clearly wider (I’d wager wide enough to cover the screen, as expected), so safeActualContentWidth/Height do seem to provide the coordinates to the actual required coordinates. However, the amount of offset seems to be wrong.

I also didn’t seem to get the “if ( fixScale ) then” to fire, it always went for else. Another thing that is worrying me a bit is that while safeActualContentWidth/Height do seem to work for now, they should stop working once AndroidX support is added, i.e. when these APIs should return the display area not affected by the rounded corners.

Sorry for the fast and scatter brain responses, I’m trying to juggle several projects at the moment and trying to finish them before the weekend.

It looks like there may be a sub-pixel rounding error for that last screenshot.

You might edit the code I gave you and print out the values for fixScale and fixOffset after they get set, then get the values from log cat.

If the offset value is odd you  may need to add a pixel to the offset before using it.

Note: The ‘if ( fixScale ) then’ part of the code had to run once (and only once) or the other part of the code would have crashed with a nil reference error.

I’d add print statements throughout the code to see what it is doing and when.  I usually add my initials when debugging to make it super easy to find these messages. 

Note 2:  In case there were any question, I suspect this code won’t run at all in the simulator so you can only test it on device.