myPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
myPaint.setARGB(alpha, red, green, blue);
myPaint.setAntiAlias(true);
textPaint = new Paint(Paint.LINEAR_TEXT_FLAG);
textPaint.setColor(textColor);
textPaint.setTextSize(textSize);
textPaint.setAntiAlias(true);
public void onDraw(Canvas c) {
left_value = x - x_length;
right_value = x + x_length;
top_value = y - y_length;
bottom_value = y + y_length;
c.drawRoundRect(new RectF(left_value, top_value, right_value,
bottom_value), 4.0f, 3.0f, myPaint);
textPaint.setTextAlign(Align.CENTER);
c.drawText(msg.getAuthor(), x, top_value + 5.0f, textPaint);
textPaint.setTextAlign(Align.LEFT);
c.drawText(msg.getSubject(), left_value + 2.0f, y, textPaint);
textPaint.setTextAlign(Align.CENTER);
c.drawText("Click to read message", x, bottom_value - 5.0f, textPaint);