ImmersionBar
ImmersionBar copied to clipboard
Bug 提醒:对预测性返回手势会造成 Bug 【耗费两天才排除出来】
表现形式是:
第一次右滑时无法返回到桌面,需要连续右滑两次才能返回桌面。
【因为测试设备有限,且是 ipad 应用,导致排查两天才定位到问题,大家引以为戒】
运行 Log 排查如下: 会有事件,但是一直是 rootView 拦截,且 Activity 的 返回事件(及适配手势返回回调)都不会响应。
title = com.vivaia.pos/com.app.template.LaunchActivity enqueue motion: MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=0.0, y[0]=1082.041, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=2345127342, downTime=2345127342, deviceId=6, source=0x1002, displayId=0, eventId=835972846 }
title = com.vivaia.pos/com.app.template.LaunchActivity enqueue motion: MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=448.28516, y[0]=1271.5312, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=2345127492, downTime=2345127342, deviceId=6, source=0x1002, displayId=0, eventId=290760247 }
on fling
大佬如何解决的
如果是最新的项目,或者项目采用的 Compose 开发,建议使用 edgeToedge 的官方方案; 如果是老项目,可以尝试下我 fork 的用来兼容 15、16 的库 https://github.com/OCNYang/ImmersionBar ;
我 fork 的库主要是对 15、16 的 Bar 的显示进行兼容,我也不确认手势问题,如果你尝试后不行,还是用官方方案吧。