Code example for NinePatch

Methods: draw

0
    public void draw(Canvas canvas) {
        super.draw(canvas);
 
        // draw progress bars 
       // canvas.drawBitmap(mProgressBarBg, null, mProgressBar, null); 
        mprogressbgninepatch.draw(canvas, mProgressBar);
        //canvas.drawBitmap(mPlayedBarBg, null, mPlayedBar, null); 
        mplayedninepatch.draw(canvas, mPlayedBar);
        // draw scrubber and timers 
 
        if (mShowScrubber) {
            canvas.drawBitmap(mScrubber, mScrubberLeft, mScrubberTop, null);
        } 
 
        if (mShowTimes) {
            canvas.drawText(stringForTime((int)mCurrentTime), mTimeBounds.width() / 2 + getPaddingLeft(), mTimeBounds.height()
                    + mPaddingInPx / 2 + mScrubberPadding + 1, mTimeTextPaint);
            canvas.drawText(stringForTime(mTotalTime), getWidth() - getPaddingRight() - mTimeBounds.width() / 2,
                    mTimeBounds.height() + mPaddingInPx / 2 + mScrubberPadding + 1, mTimeTextPaint);
        } 
    }