public static boolean isEdgeListItem ( Context context , AccessibilityNodeInfoCompat node , int direction , NodeFilter filter ) { if ( node == null ) { return false ; } if ( ( direction <= 0 ) && isMatchingEdgeListItem ( context , node , NodeFocusFinder . SEARCH_BACKWARD , FILTER_SCROLL_BACKWARD . and ( filter ) ) ) { return true ; } if ( ( direction >= 0 ) && isMatchingEdgeListItem ( context , node , NodeFocusFinder . SEARCH_FORWARD , FILTER_SCROLL_FORWARD . and ( filter ) ) ) { return true ; } return false ; }
Determines if the current item is at the edge of a list by checking the scrollable predecessors of the items on either or both sides .