private void drawItem(Canvas canvas, PieItem item, float alpha) { if (mState == STATE_PIE) { if (item.getPath() != null) { if (item.isSelected()) { Paint p = mSelectedPaint; int state = canvas.save(); float r = getDegrees(item.getStartAngle()); canvas.rotate(r, mCenter.x, mCenter.y); canvas.drawPath(item.getPath(), p); canvas.restoreToCount(state); } alpha = alpha * (item.isEnabled() ? 1 : 0.3f); // draw the item view item.setAlpha(alpha); item.draw(canvas); } } }