Code example for BitmapDrawable

Methods: drawgetIntrinsicHeightgetIntrinsicWidthsetAlpha

0
            return; 
        canvas.save(Canvas.MATRIX_SAVE_FLAG);
        canvas.translate(mX, mY);
        canvas.scale(mScaleX, mScaleY);
        canvas.translate(-0.5f*getWidth(), -0.5f*getHeight());
        mDrawable.setAlpha((int) Math.round(mAlpha * 255f));
        mDrawable.draw(canvas);
        canvas.restore();
    } 
 
    /** 
     * Starts all animations added since the last call to this function.  Used to synchronize 
     * animations. 
     * 
     * @param listener an optional listener to add to the animations. Typically used to know when 
     * to invalidate the surface these are being drawn to. 
     */ 
    public void startAnimations(ValueAnimator.AnimatorUpdateListener listener) {
        for (int i = 0; i < mNeedToStart.size(); i++) {
            ObjectAnimator anim = mNeedToStart.get(i);
            anim.addUpdateListener(listener);
            anim.addListener(this);
            anim.start();
        } 
        mNeedToStart.clear();
    } 
 
 
    public void setX(float value) {
        mX = value;
    } 
 
    public void setY(float value) {
        mY = value;
    } 
 
    public void setScaleX(float value) {
        mScaleX = value;
    } 
 
    public void setScaleY(float value) {
        mScaleY = value;
    } 
 
    public void setAlpha(float alpha) {
        mAlpha = alpha;
    } 
 
    public float getX() { 
        return mX;
    } 
 
    public float getY() { 
        return mY;
    } 
 
    public float getScaleX() { 
        return mScaleX;
    } 
 
    public float getScaleY() { 
        return mScaleY;
    } 
 
    public float getAlpha() { 
        return mAlpha;
    } 
 
    public BitmapDrawable getDrawable() {
        return mDrawable;
    } 
 
    public int getWidth() { 
        return mDrawable.getIntrinsicWidth();
    } 
 
    public int getHeight() { 
        return mDrawable.getIntrinsicHeight();
    } 
 
    public void onAnimationCancel(Animator animation) {
 
    } 
Connect your IDE to all the code out there  Get Codota for Java