public void drawHeader ( RecyclerView recyclerView , Canvas canvas , View header , Rect offset ) { canvas . save ( ) ; if ( recyclerView . getLayoutManager ( ) . getClipToPadding ( ) ) { // Clip drawing of headers to the padding of the RecyclerView. Avoids drawing in the padding initClipRectForHeader ( mTempRect , recyclerView , header ) ; canvas . clipRect ( mTempRect ) ; } canvas . translate ( offset . left , offset . top ) ; header . draw ( canvas ) ; canvas . restore ( ) ; }
Draws a header to a canvas offsetting by some x and y amount