GradientDrawable background = (GradientDrawable) viewHolder.color_tv.getBackground();
//随机设置小圆点设置颜色
Random random = new Random();
int ranColor = 0xff000000 | random.nextInt(0x00ffffff);
background.setColor(ranColor);
GradientDrawable shape = new GradientDrawable();
int type = SettingXml.getShape(mInstance, DEFAULT_SHAPE);
//设置形状
if (type == SettingShapeActivity.CIRCLE) {
shape.setShape(GradientDrawable.OVAL);
} else if (type == SettingShapeActivity.RECTANGLE) {
shape.setShape(GradientDrawable.RECTANGLE);
}
//设置颜色
shape.setColor(SettingXml.getColor(mInstance, DEFAULT_COLOR));
//设置大小
shape.setSize(SettingXml.getSizeWidth(mInstance, DEFAULT_SIZE_W), SettingXml.getSizeHeight(mInstance, DEFAULT_SIZE_H));
mFloatView.setBackground(shape);