Closed mahyarmirrashed closed 7 months ago
I'm using the Pixel phone emulations using the Android Device Manager. I find that the safe areas are inconsistent with what I would expect.
I am using a combination of the safe area and a padding of 16 pixels. So basically, I adjust the container of the top controls down with
absolute
and addtop: var(--safe-area-inset-top)
. The variable is set withinsets.top
from this plugin.Here are the results on different devices:
Pixel 6a:
Pixel 6 Pro:
Pixel 7 Pro:
The most correct one is the 6 Pro. The rest definitely have incorrect calculations for the top padding. Is there any way that we can fix this?
The Density value of each Android device is not always the same. The obtained top value will eventually be divided by density to get the final pixel value.
@AlwaysLoveme Can you explain that once for me? I'm sorry, I didn't really understand it. Is the density a value that is provided and something that I should currently be doing or is it something that you plan to add in the future?
Following up on my previous comment @AlwaysLoveme .
--safe-area-inset-top
Following up on my previous comment @AlwaysLoveme .
"--safe-area-inset-top" obtains the height of the status bar on Android phones, but the height of the status bar of each mobile phone is not always the same, so the values obtained between each mobile phone are also different. within reason
I'm using the Pixel phone emulations using the Android Device Manager. I find that the safe areas are inconsistent with what I would expect.
I am using a combination of the safe area and a padding of 16 pixels. So basically, I adjust the container of the top controls down with
absolute
and addtop: var(--safe-area-inset-top)
. The variable is set withinsets.top
from this plugin.Here are the results on different devices:
Pixel 6a:
Pixel 6 Pro:
Pixel 7 Pro:
The most correct one is the 6 Pro. The rest definitely have incorrect calculations for the top padding. Is there any way that we can fix this?