Code example for Drawable

Methods: setLevel

0
			if (level > 6000 && mDelta >= 0) {
//				Log.d(TAG, "onLevelChange scheduleSelf --"); 
				mDelta = -0.05f;
				scheduleSelf(this, SystemClock.uptimeMillis() + DELAY);
			} 
			return mProgress.setLevel(level);
		} 
 
		@Override 
		public void draw(Canvas canvas) {
			mProgress.draw(canvas);
			Rect bounds = getBounds();
 
			float x = 6 + mTextX * (bounds.width() - mTextWidth - 6 - 6);
			float y = (bounds.height() + mPaint.getTextSize()) / 2;
			mOutlinePaint.setAlpha(mActive? 255 : 255 / 2);
			mPaint.setAlpha(mActive? 255 : 255 / 2);
			canvas.drawText(mText, x, y, mOutlinePaint);
			canvas.drawText(mText, x, y, mPaint);
		}