leanback/src/main/java/androidx/leanback/graphics/ColorOverlayDimmer.java
public void drawColorOverlay(Canvas c, View v, boolean includePadding) {
        c.save();
        float dx = v.getLeft() + v.getTranslationX();
        float dy = v.getTop() + v.getTranslationY();
        c.translate(dx, dy);
        c.concat(v.getMatrix());
        c.translate(-dx, -dy);
        if (includePadding) {
            c.drawRect(v.getLeft(), v.getTop(), v.getRight(), v.getBottom(), mPaint);
        } else {
            c.drawRect(v.getLeft() + v.getPaddingLeft(),
                    v.getTop() + v.getPaddingTop(),
                    v.getRight() - v.getPaddingRight(),
                    v.getBottom() - v.getPaddingBottom(), mPaint);
        }
        c.restore();
    }
/**
     * Draw a dim color overlay on top of a child View inside the canvas of
     * the parent View.
     *
     * @param c Canvas of the parent View.
     * @param v A child of the parent View.
     * @param includePadding Set to true to draw overlay on padding area of the
     *        View.
     */
Draw a dim color overlay on top of a child View inside the canvas of
the parent View.

@param c Canvas of the parent View.
@param v A child of the parent View.
@param includePadding Set to true to draw overlay on padding area of the
View.
Draw a dim color overlay on top of a child View inside the canvas of the parent View . @param c Canvas of the parent View . @param v A child of the parent View . @param includePadding Set to true to draw overlay on padding area of the View .
public void drawColorOverlay(Canvas c, View v, boolean includePadding) {
        c.save();
        float dx = v.getLeft() + v.getTranslationX();
        float dy = v.getTop() + v.getTranslationY();
        c.translate(dx, dy);
        c.concat(v.getMatrix());
        c.translate(-dx, -dy);
        if (includePadding) {
            c.drawRect(v.getLeft(), v.getTop(), v.getRight(), v.getBottom(), mPaint);
        } else {
            c.drawRect(v.getLeft() + v.getPaddingLeft(),
                    v.getTop() + v.getPaddingTop(),
                    v.getRight() - v.getPaddingRight(),
                    v.getBottom() - v.getPaddingBottom(), mPaint);
        }
        c.restore();
    }
public void drawColorOverlay ( Canvas c , View v , boolean includePadding ) { c . save ( ) ; float dx = v . getLeft ( ) + v . getTranslationX ( ) ; float dy = v . getTop ( ) + v . getTranslationY ( ) ; c . translate ( dx , dy ) ; c . concat ( v . getMatrix ( ) ) ; c . translate ( - dx , - dy ) ; if ( includePadding ) { c . drawRect ( v . getLeft ( ) , v . getTop ( ) , v . getRight ( ) , v . getBottom ( ) , mPaint ) ; } else { c . drawRect ( v . getLeft ( ) + v . getPaddingLeft ( ) , v . getTop ( ) + v . getPaddingTop ( ) , v . getRight ( ) - v . getPaddingRight ( ) , v . getBottom ( ) - v . getPaddingBottom ( ) , mPaint ) ; } c . restore ( ) ; }
Draw a dim color overlay on top of a child View inside the canvas of
 the parent View.
Draw a dim color overlay on top of a child View inside the canvas of the parent View .