public static OrientationHelperEx createVerticalHelper ( ExposeLinearLayoutManagerEx layoutManager ) { return new OrientationHelperEx ( layoutManager ) { @ Override public int getEndAfterPadding ( ) { return mLayoutManager . getHeight ( ) - mLayoutManager . getPaddingBottom ( ) ; } @ Override public int getEnd ( ) { return mLayoutManager . getHeight ( ) ; } @ Override public void offsetChildren ( int amount ) { mLayoutManager . offsetChildrenVertical ( amount ) ; } @ Override public int getStartAfterPadding ( ) { return mLayoutManager . getPaddingTop ( ) ; } @ Override public int getDecoratedMeasurement ( View view ) { final RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; return ! mLayoutManager . isEnableMarginOverLap ( ) ? mLayoutManager . getDecoratedMeasuredHeight ( view ) + params . topMargin + params . bottomMargin : mLayoutManager . getDecoratedMeasuredHeight ( view ) ; } @ Override public int getDecoratedMeasurementInOther ( View view ) { final RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; return mLayoutManager . getDecoratedMeasuredWidth ( view ) + params . leftMargin + params . rightMargin ; } @ Override public int getDecoratedEnd ( View view ) { final RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; return ! mLayoutManager . isEnableMarginOverLap ( ) ? mLayoutManager . getDecoratedBottom ( view ) + params . bottomMargin : mLayoutManager . getDecoratedBottom ( view ) ; } @ Override public int getDecoratedStart ( View view ) { final RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; return ! mLayoutManager . isEnableMarginOverLap ( ) ? mLayoutManager . getDecoratedTop ( view ) - params . topMargin : mLayoutManager . getDecoratedTop ( view ) ; } @ Override public int getTotalSpace ( ) { return mLayoutManager . getHeight ( ) - mLayoutManager . getPaddingTop ( ) - mLayoutManager . getPaddingBottom ( ) ; } @ Override public void offsetChild ( View view , int offset ) { view . offsetTopAndBottom ( offset ) ; } @ Override public int getEndPadding ( ) { return mLayoutManager . getPaddingBottom ( ) ; } } ; }
Creates a vertical OrientationHelper for the given LayoutManager .