ImmersionBar icon indicating copy to clipboard operation
ImmersionBar copied to clipboard

Pixel 5 沉浸式的兼容有问题

Open silentpride opened this issue 3 years ago • 8 comments

lADPJv8gTTYneNLNC9DND8A_4032_3024

lADPJxDjxm55AfLNC9DND8A_4032_3024

如图,Demo跑起来之后顶部的bar适配有问题。 我们的项目用的ViewPager2+Fragment的方式写的主页,顶部的沉浸式在 Pixel 5 上适配也有问题。 通过各种api获取的高度也不准。 换成在布局里写 fitsSystemWindows=true 则会遇到第一tab有沉浸式,后面几个tab不会触发fitsSystemWindows的问题。

很奇怪的是,我们有3部同一型号的 Pixel 5 手机,最新版系统的两个都有这个问题,剩下一台root后的手机没这个问题。

silentpride avatar Apr 25 '22 08:04 silentpride

use ImmersionBar.with(this).fitsSystemWindows(true) . Mi 10 Android 12 work fine : "notchHeight":90 , "statusBarHeight":90
pixel 5 Android12 has issue : "notchHeight":136, "statusBarHeight":77

luffyjet avatar Apr 25 '22 12:04 luffyjet

我也遇到这个问题了,机型是pixel 4a,系统是android12,好像只有开孔屏会出现 微信图片_20220502203543 微信图片_20220502204646

tiewantn avatar May 02 '22 12:05 tiewantn

use ImmersionBar.with(this).fitsSystemWindows(true) . Mi 10 Android 12 work fine : "notchHeight":90 , "statusBarHeight":90 pixel 5 Android12 has issue : "notchHeight":136, "statusBarHeight":77

You can try my solution : https://github.com/luffyjet/ImmersionBar I also published it to JITPACK : https://jitpack.io/#luffyjet/ImmersionBar

luffyjet avatar May 02 '22 13:05 luffyjet

https://www.androidpolice.com/stable-android-12l-exhibits-a-status-bar-glitch-that-wasnt-caught-in-months-of-beta-testing/

some android users hava reported this problem,on androidpolice website

tiewantn avatar May 18 '22 06:05 tiewantn

刚才更新android12最新补丁,google好像从系统层面修复了这个问题

tiewantn avatar Jun 08 '22 01:06 tiewantn

真的吗,晚点更新下系统试试

silentpride avatar Jun 09 '22 03:06 silentpride

请问解决了吗这个问题,我是用的模拟器还是存在这个问题

lchang70163 avatar Jul 14 '22 02:07 lchang70163

请问解决了吗这个问题,我是用的模拟器还是存在这个问题

没有哦。 如果是Activity,要手动在XML里设置fitSystomWindow;Fragment比较难搞了。 暂时没有完美的解决方案。

silentpride avatar Jul 21 '22 07:07 silentpride