예제 #1
0
  @Override
  protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);

    // Draw the shadow
    canvas.drawOval(mShadowBounds, mShadowPaint);

    // TODO 0 Slices
    String label = "";
    //        if(mData.size() > 0)
    label = mData.get(mCurrentItem).mLabel;
    //        else
    //        	label = NO_DATA_SLICE;

    // Draw the label text
    if (getShowText()) {
      canvas.drawText(label, mTextX, mTextY, mTextPaint);
    }

    // If the API level is less than 11, we can't rely on the view animation system to
    // do the scrolling animation. Need to tick it here and call postInvalidate() until the
    // scrolling is done.
    if (Build.VERSION.SDK_INT < 11) {
      tickScrollAnimation();
      if (!mScroller.isFinished()) {
        postInvalidate();
      }
    }
  }