1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00
k-9/src/com/fsck/k9/view/ColorChip.java

34 lines
619 B
Java
Raw Normal View History

package com.fsck.k9.view;
import android.graphics.Path;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.PathShape;
public class ColorChip {
private static final Path CHIP_PATH = new Path();
static {
CHIP_PATH.addCircle(8,8,8f,Path.Direction.CW);
CHIP_PATH.close();
}
private ShapeDrawable mDrawable;
public ColorChip(int color) {
2011-01-06 11:55:08 -05:00
mDrawable = new ShapeDrawable(new PathShape(CHIP_PATH, 16f, 16f));
2011-01-06 11:55:08 -05:00
mDrawable.getPaint().setColor(color);
}
2011-01-06 11:55:08 -05:00
public ShapeDrawable drawable() {
return mDrawable;
}
}