Example usage for android.graphics.drawable ColorDrawable setBounds

List of usage examples for android.graphics.drawable ColorDrawable setBounds

Introduction

In this page you can find the example usage for android.graphics.drawable ColorDrawable setBounds.

Prototype

public void setBounds(@NonNull Rect bounds) 

Source Link

Document

Specify a bounding rectangle for the Drawable.

Usage

From source file:com.ecom.consumer.customviews.HorizontalListView.java

@Override
protected void dispatchDraw(Canvas canvas) {
    canvas.save();// www. j a  v a  2s  .co  m
    super.dispatchDraw(canvas);

    if (outRect != null && !mIsBeingDragged) {
        ColorDrawable drawable = new ColorDrawable(0x884193C9);// 77318fd5new
        // ColorDrawable(0x440000ff
        // &
        // Color.BLUE);
        drawable.setBounds(outRect);
        drawable.draw(canvas);
    }
    outRect = null;
    drawEdgeGlow(canvas);
    canvas.restore();
}