Cheesebaron.SlidingUpPanel.SlidingUpPanelLayout.CanScroll C# (CSharp) Method

CanScroll() protected method

protected CanScroll ( Android.Views.View view, bool checkV, int dx, int x, int y ) : bool
view Android.Views.View
checkV bool
dx int
x int
y int
return bool
        protected bool CanScroll(View view, bool checkV, int dx, int x, int y)
        {
            var viewGroup = view as ViewGroup;
            if (viewGroup == null) return checkV && ViewCompat.CanScrollHorizontally(view, -dx);

            var scrollX = viewGroup.ScrollX;
            var scrollY = viewGroup.ScrollY;
            var count = viewGroup.ChildCount;

            for (var i = count - 1; i >= 0; i--)
            {
                var child = viewGroup.GetChildAt(i);
                if (x + scrollX >= child.Left && x + scrollX < child.Right &&
                    y + scrollY >= child.Top && y + scrollY < child.Bottom &&
                    CanScroll(child, true, dx, x + scrollX - child.Left, y + scrollY - child.Top))
                    return true;
            }
            return checkV && ViewCompat.CanScrollHorizontally(view, -dx);
        }