@ SuppressLint ( "NewApi" ) private void setHeaderOffet ( int offset ) { if ( mHeaderOffset == null || mHeaderOffset != offset ) { mHeaderOffset = offset ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . HONEYCOMB ) { mHeader . setTranslationY ( mHeaderOffset ) ; } else { MarginLayoutParams params = ( MarginLayoutParams ) mHeader . getLayoutParams ( ) ; params . topMargin = mHeaderOffset ; mHeader . setLayoutParams ( params ) ; } if ( mOnStickyHeaderOffsetChangedListener != null ) { mOnStickyHeaderOffsetChangedListener . onStickyHeaderOffsetChanged ( this , mHeader , - mHeaderOffset ) ; } } }
the API version