Lines Matching defs:Slice
48 private ArrayList<Slice> mSlices = Lists.newArrayList();
62 public class Slice {
71 public Slice(long value, int color) {
118 mSlices.add(new Slice(value, color));
141 for (Slice slice : mSlices) {
142 slice.path.reset();
143 slice.pathSide.reset();
144 slice.pathOutline.reset();
145 total += slice.value;
171 for (Slice slice : mSlices) {
172 final int sweepAngle = (int) (slice.value * 360 / total);
180 // draw slice
181 slice.path.moveTo(rect.centerX(), rect.centerY());
182 slice.path.arcTo(rect, startAngle, sweepAngle);
183 slice.path.lineTo(rect.centerX(), rect.centerY());
192 // draw slice side
193 slice.pathSide.moveTo(rect.centerX(), rect.centerY());
194 slice.pathSide.arcTo(rect, startAngleSide, 0);
195 slice.pathSide.rLineTo(-mSideWidth, 0);
196 slice.pathSide.arcTo(rectSide, startAngleSide, sweepAngleSide);
197 slice.pathSide.rLineTo(mSideWidth, 0);
198 slice.pathSide.arcTo(rect, endAngleSide, -sweepAngleSide);
201 // draw slice outline
202 slice.pathOutline.moveTo(rect.centerX(), rect.centerY());
203 slice.pathOutline.arcTo(rect, startAngle, 0);
205 slice.pathOutline.rLineTo(-mSideWidth, 0);
207 slice.pathOutline.moveTo(rect.centerX(), rect.centerY());
208 slice.pathOutline.arcTo(rect, startAngle + sweepAngle, 0);
210 slice.pathOutline.rLineTo(-mSideWidth, 0);
224 for (Slice slice : mSlices) {
225 canvas.drawPath(slice.pathSide, slice.paint);
229 for (Slice slice : mSlices) {
230 canvas.drawPath(slice.path, slice.paint);
231 canvas.drawPath(slice.pathOutline, mPaintOutline);