Code example for Canvas

Methods: getHeight, getWidth

0
 
    @Override 
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        if (stateList != null) {
            stateList.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
            stateList.draw(canvas);
        } 
    } 
 
    /**************************/ 
    /** Checkable **/ 
    /**************************/ 
 
    @Override 
    public boolean isChecked() { 
        return mChecked;
    } 
 
    @Override 
    public void setChecked(boolean checked) {