@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  if (mShader == null)   return;
  float radius=mCenterX <= mCenterY ? mCenterX - 75.0f : mCenterY - 75.0f;
  canvas.rotate(mRotateDegrees,mCenterX,mCenterY);
  canvas.drawCircle(mCenterX,mCenterY,radius,mPaintCover);
  canvas.rotate(-mRotateDegrees,mCenterX,mCenterY);
  canvas.drawCircle(mCenterX,mCenterY,mButtonRadius,mPaintButton);
  if (mProgressVisibility) {
    canvas.drawArc(rectF,145,250,false,mPaintProgressEmpty);
    canvas.drawArc(rectF,145,calculatePastProgressDegree(),false,mPaintProgressLoaded);
    String leftTime=secondsToTime(calculateLeftSeconds());
    mPaintTime.getTextBounds(leftTime,0,leftTime.length(),mRectText);
    canvas.drawText(leftTime,(float)(mCenterX * Math.cos(Math.toRadians(35.0))) + mWidth / 2.0f - mRectText.width() / 1.5f,(float)(mCenterX * Math.sin(Math.toRadians(35.0))) + mHeight / 2.0f + mRectText.height() + 15.0f,mPaintTime);
    String passedTime=secondsToTime(calculatePassedSeconds());
    mPaintTime.getTextBounds(passedTime,0,passedTime.length(),mRectText);
    canvas.drawText(passedTime,(float)(mCenterX * -Math.cos(Math.toRadians(35.0))) + mWidth / 2.0f - mRectText.width() / 3.0f,(float)(mCenterX * Math.sin(Math.toRadians(35.0))) + mHeight / 2.0f + mRectText.height() + 15.0f,mPaintTime);
  }
  if (mFirstDraw) {
    toggle();
    mFirstDraw=false;
  }
  mPlayPauseDrawable.draw(canvas);
}

@ Override protected void onDraw ( Canvas canvas ) { super . onDraw ( canvas ) ; if ( mShader == null ) return ; float radius = mCenterX <= mCenterY ? mCenterX - 75.0f : mCenterY - 75.0f ; canvas . rotate ( mRotateDegrees , mCenterX , mCenterY ) ; canvas . drawCircle ( mCenterX , mCenterY , radius , mPaintCover ) ; canvas . rotate ( - mRotateDegrees , mCenterX , mCenterY ) ; canvas . drawCircle ( mCenterX , mCenterY , mButtonRadius , mPaintButton ) ; if ( mProgressVisibility ) { canvas . drawArc ( rectF , 145 , 250 , false , mPaintProgressEmpty ) ; canvas . drawArc ( rectF , 145 , calculatePastProgressDegree ( ) , false , mPaintProgressLoaded ) ; String leftTime = secondsToTime ( calculateLeftSeconds ( ) ) ; mPaintTime . getTextBounds ( leftTime , 0 , leftTime . length ( ) , mRectText ) ; canvas . drawText ( leftTime , ( float ) ( mCenterX * Math . cos ( Math . toRadians ( 35.0 ) ) ) + mWidth / 2.0f - mRectText . width ( ) / 1.5f , ( float ) ( mCenterX * Math . sin ( Math . toRadians ( 35.0 ) ) ) + mHeight / 2.0f + mRectText . height ( ) + 15.0f , mPaintTime ) ; String passedTime = secondsToTime ( calculatePassedSeconds ( ) ) ; mPaintTime . getTextBounds ( passedTime , 0 , passedTime . length ( ) , mRectText ) ; canvas . drawText ( passedTime , ( float ) ( mCenterX * - Math . cos ( Math . toRadians ( 35.0 ) ) ) + mWidth / 2.0f - mRectText . width ( ) / 3.0f , ( float ) ( mCenterX * Math . sin ( Math . toRadians ( 35.0 ) ) ) + mHeight / 2.0f + mRectText . height ( ) + 15.0f , mPaintTime ) ; } if ( mFirstDraw ) { toggle ( ) ; mFirstDraw = false ; } mPlayPauseDrawable . draw ( canvas ) ; }
this is where magic happens as you know .
