private int getListLeft(RecyclerView view) { if (view.getLayoutManager().getClipToPadding()) { return view.getPaddingLeft(); } else { return 0; } } }
private int getListTop(RecyclerView view) { if (view.getLayoutManager().getClipToPadding()) { return view.getPaddingTop(); } else { return 0; } }
/** * Draws a header to a canvas, offsetting by some x and y amount * * @param recyclerView the parent recycler view for drawing the header into * @param canvas the canvas on which to draw the header * @param header the view to draw as the header * @param offset a Rect used to define the x/y offset of the header. Specify x/y offset by setting * the {@link Rect#left} and {@link Rect#top} properties, respectively. */ 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(); }
if (layoutManager.getClipToPadding()) { center = helper.getStartAfterPadding() + helper.getTotalSpace() / 2; } else {
/** * Draws a header to a canvas, offsetting by some x and y amount * * @param recyclerView the parent recycler view for drawing the header into * @param canvas the canvas on which to draw the header * @param header the view to draw as the header * @param offset a Rect used to define the x/y offset of the header. Specify x/y offset by setting * the {@link Rect#left} and {@link Rect#top} properties, respectively. */ 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 * * @param recyclerView the parent recycler view for drawing the header into * @param canvas the canvas on which to draw the header * @param header the view to draw as the header * @param offset a Rect used to define the x/y offset of the header. Specify x/y offset by setting * the {@link Rect#left} and {@link Rect#top} properties, respectively. */ 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 * * @param recyclerView the parent recycler view for drawing the header into * @param canvas the canvas on which to draw the header * @param header the view to draw as the header * @param offset a Rect used to define the x/y offset of the header. Specify x/y offset by setting * the {@link Rect#left} and {@link Rect#top} properties, respectively. */ 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(); }
private int getListLeft(RecyclerView view) { if (view.getLayoutManager() .getClipToPadding()) { return view.getPaddingLeft(); } else { return 0; } } }
private int getListTop(RecyclerView view) { if (view.getLayoutManager() .getClipToPadding()) { return view.getPaddingTop(); } else { return 0; } }
private int getListTop(RecyclerView view) { if (view.getLayoutManager().getClipToPadding()) { return view.getPaddingTop(); } else { return 0; } }
private int getListLeft(RecyclerView view) { if (view.getLayoutManager().getClipToPadding()) { return view.getPaddingLeft(); } else { return 0; } } }
private int getListTop(RecyclerView view) { if (view.getLayoutManager().getClipToPadding()) { return view.getPaddingTop(); } else { return 0; } }
private int getListLeft(RecyclerView view) { if (view.getLayoutManager().getClipToPadding()) { return view.getPaddingLeft(); } else { return 0; } } }
/** * Draws a header to a canvas, offsetting by some x and y amount * * @param recyclerView the parent recycler view for drawing the header into * @param canvas the canvas on which to draw the header * @param header the view to draw as the header * @param offset a Rect used to define the x/y offset of the header. Specify x/y offset by setting * the {@link Rect#left} and {@link Rect#top} properties, respectively. */ 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(); }
private int getListLeft(RecyclerView view) { if (view.getLayoutManager().getClipToPadding()) { return view.getPaddingLeft(); } else { return 0; } } }
private int getListTop(RecyclerView view) { if (view.getLayoutManager().getClipToPadding()) { return view.getPaddingTop(); } else { return 0; } }