Example usage for android.graphics.drawable Drawable setBounds

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

Introduction

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

Prototype

public void setBounds(@NonNull Rect bounds) 

Source Link

Document

Specify a bounding rectangle for the Drawable.

Usage

From source file:com.lovely3x.eavlibrary.EasyAdapterView.java

void drawDivider(Canvas canvas, Rect bounds) {
    // This widget draws the same divider for all children
    final Drawable divider = mDivider;
    divider.setBounds(bounds);
    divider.draw(canvas);/*  w  ww  .j  av  a 2  s. c o  m*/
}

From source file:com.aliasapps.seq.scroller.TwoWayView.java

private void drawSelector(Canvas canvas) {
    if (!mSelectorRect.isEmpty()) {
        final Drawable selector = mSelector;
        selector.setBounds(mSelectorRect);
        selector.draw(canvas);//from  ww w .j  a v  a  2  s  .c  o  m
    }
}