question: private void addCustomViewsWithGravity ( List < View > views , int gravity ) { final boolean isRtl = isRtl ( ) ; final int childCount = getChildCount ( ) ; final int absGrav = GravityCompat . getAbsoluteGravity ( gravity , getDirectionLayout ( ) ) ; views . clear ( ) ; if ( isRtl ) { for ( int i = childCount - 1 ; i >= 0 ; i -- ) { final View child = getChildAt ( i ) ; final LayoutParams lp = ( LayoutParams ) child . getLayoutParams ( ) ; if ( lp . mViewType == LayoutParams . CUSTOM && shouldLayout ( child ) && getChildHorizontalGravity ( lp . gravity ) == absGrav ) { views . add ( child ) ; } } } else { for ( int i = 0 ; i < childCount ; i ++ ) { final View child = getChildAt ( i ) ; final LayoutParams lp = ( LayoutParams ) child . getLayoutParams ( ) ; if ( lp . mViewType == LayoutParams . CUSTOM && shouldLayout ( child ) && getChildHorizontalGravity ( lp . gravity ) == absGrav ) { views . add ( child ) ; } } } }
target:  Prepare a list of non-SYSTEM child views. If the layout direction is RTL this will be in reverse child order.