Code example for Drawable

Methods: drawsetAlphasetBounds

0
            final float aspect = (float)mGlowWidth / mGlowHeight;
            final int drawW = (int)(h*aspect);
            final int drawH = h;
            final int margin = (drawW-w)/2;
            canvas.scale(mGlowScale, mGlowScale, w*0.5f, h*0.5f);
            mGlowBG.setBounds(-margin, 0, drawW-margin, drawH);
            mGlowBG.setAlpha((int)(mDrawingAlpha * mGlowAlpha * 255));
            mGlowBG.draw(canvas);
            canvas.restore();
            mRect.right = w;
            mRect.bottom = h;
        } 
        super.onDraw(canvas);
    } 
 
    public float getDrawingAlpha() { 
        if (mGlowBG == null) return 0;
        return mDrawingAlpha;
    } 
 
    public void setDrawingAlpha(float x) {