recent界面上滑进allapps响应区域问题

时间:2020/12/14
之前公司不允许csdn,笔记写在其它地方。最近整理过来

recent界面上滑进allapps响应区域问题

问题背景:

  • 有recentView时,recent下方一点点就可以上滑进allapps
  • 没有recentView时,,只有在搜索栏或者hotseat才能滑进allapps

问题分析:

所有界面的滑动分析根,从draglayer出发
1、baseDraglayer:

onInterceptTouchEvent--》findActiveController--》findControllerToHandleTouch

2、findControllerToHandleTouch中循环所有mControllers(DragController、AbstractStateChangeTouchController、TaskViewTouchController),看看是哪个部分处理这个滑动的动作。

3、对于allapps界面,处理在AbstractStateChangeTouchController的onControllerInterceptTouchEvent中
//canInterceptTouch 判断是否拦截触摸事件,如果不拦截,直接返回false
//如果拦截,则自己消费触摸事件,滑出allapps界面

4、PortraitStatesTouchController.canInterceptTouch:
这个方法中,判断:1、当前是否正在做动画 2、allapps主界面3、overview界面、4其它界面(比如launcher主界面)
每个模式下有不同的判断条件判断。

5、此次我们分析的问题点在于,overview界面,走PortraitOverviewStateTouchHelper.Java:
从以下逻辑可以看出,当recentsView没有时,只有当用户触摸在hotseat才能滑动
当recentsView有时,触摸区域的判断在recentview往下所有范围

boolean canInterceptTouch(MotionEvent ev) {
    if (mRecentsView.getChildCount() > 0) {
        // Allow swiping up in the gap between the hotseat and overview.
        return ev.getY() >= mRecentsView.getChildAt(0).getBottom();
    } else {
        // If there are no tasks, we only intercept if we're below the hotseat height.
        return isTouchOverHotseat(mLauncher, ev);
    }
}

以上是上滑坐标判断部分。

================================================

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值