wear/src/main/java/androidx/wear/widget/SwipeDismissLayout.java
protected boolean canScroll(View v, boolean checkV, float dx, float x, float y) {
        if (v instanceof ViewGroup) {
            final ViewGroup group = (ViewGroup) v;
            final int scrollX = v.getScrollX();
            final int scrollY = v.getScrollY();
            final int count = group.getChildCount();
            for (int i = count - 1; i >= 0; i--) {
                final View child = group.getChildAt(i);
                if (x + scrollX >= child.getLeft()
                        && x + scrollX < child.getRight()
                        && y + scrollY >= child.getTop()
                        && y + scrollY < child.getBottom()
                        && canScroll(
                        child, true, dx, x + scrollX - child.getLeft(),
                        y + scrollY - child.getTop())) {
                    return true;
                }
            }
        }

        return checkV && v.canScrollHorizontally((int) -dx);
    }
/**
     * Tests scrollability within child views of v in the direction of dx.
     *
     * @param v      view to test for horizontal scrollability
     * @param checkV whether the view v passed should itself be checked for scrollability
     *               ({@code true}), or just its children ({@code false})
     * @param dx     delta scrolled in pixels. Only the sign of this is used
     * @param x      x coordinate of the active touch point
     * @param y      y coordinate of the active touch point
     * @return {@code true} if child views of v can be scrolled by delta of dx
     */
Tests scrollability within child views of v in the direction of dx.
@param v      view to test for horizontal scrollability
@param checkV whether the view v passed should itself be checked for scrollability
( true), or just its children ( false)
@param dx     delta scrolled in pixels. Only the sign of this is used
@param x      x coordinate of the active touch point
@param y      y coordinate of the active touch point
@return  true if child views of v can be scrolled by delta of dx
Tests scrollability within child views of v in the direction of dx . @param v view to test for horizontal scrollability @param checkV whether the view v passed should itself be checked for scrollability ( true ) or just its children ( false ) @param dx delta scrolled in pixels . Only the sign of this is used @param x x coordinate of the active touch point @param y y coordinate of the active touch point @return true if child views of v can be scrolled by delta of dx
protected boolean canScroll(View v, boolean checkV, float dx, float x, float y) {
        if (v instanceof ViewGroup) {
            final ViewGroup group = (ViewGroup) v;
            final int scrollX = v.getScrollX();
            final int scrollY = v.getScrollY();
            final int count = group.getChildCount();
            for (int i = count - 1; i >= 0; i--) {
                final View child = group.getChildAt(i);
                if (x + scrollX >= child.getLeft()
                        && x + scrollX < child.getRight()
                        && y + scrollY >= child.getTop()
                        && y + scrollY < child.getBottom()
                        && canScroll(
                        child, true, dx, x + scrollX - child.getLeft(),
                        y + scrollY - child.getTop())) {
                    return true;
                }
            }
        }
        return checkV && v.canScrollHorizontally((int) -dx);
    }
protected boolean canScroll ( View v , boolean checkV , float dx , float x , float y ) { if ( v instanceof ViewGroup ) { final ViewGroup group = ( ViewGroup ) v ; final int scrollX = v . getScrollX ( ) ; final int scrollY = v . getScrollY ( ) ; final int count = group . getChildCount ( ) ; for ( int i = count - 1 ; i >= 0 ; i -- ) { final View child = group . getChildAt ( i ) ; if ( x + scrollX >= child . getLeft ( ) && x + scrollX < child . getRight ( ) && y + scrollY >= child . getTop ( ) && y + scrollY < child . getBottom ( ) && canScroll ( child , true , dx , x + scrollX - child . getLeft ( ) , y + scrollY - child . getTop ( ) ) ) { return true ; } } } return checkV && v . canScrollHorizontally ( ( int ) - dx ) ; }
Tests scrollability within child views of v in the direction of dx.
Tests scrollability within child views of v in the direction of dx .