ScrollBoundaryUtil.java 文件源码

java
阅读 73 收藏 0 点赞 0 评论 0

项目:Rxjava2.0Demo 作者:
public static boolean canLoadmore(View targetView, MotionEvent event) {
    if (!canScrollDown(targetView) && canScrollUp(targetView) && targetView.getVisibility() == View.VISIBLE) {
        return true;
    }
    if (targetView instanceof ViewGroup && event != null) {
        ViewGroup viewGroup = (ViewGroup) targetView;
        final int childCount = viewGroup.getChildCount();
        PointF point = new PointF();
        for (int i = 0; i < childCount; i++) {
            View child = viewGroup.getChildAt(i);
            if (isTransformedTouchPointInView(viewGroup, child, event.getX(), event.getY(), point)) {
                event = MotionEvent.obtain(event);
                event.offsetLocation(point.x, point.y);
                return canLoadmore(child, event);
            }
        }
    }
    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号