I've searched the internet and found out that if we want to change the text color of paint I must use setColor()
.
It also works for the set background too.
I want to change both text color and background when the user selects a special cell in my application.
setColor()
is use for both?
this my code:
Paint p = new Paint();
case Connected:
p.setColor(Color.WHITE);
p.setColor(getResources().getColor(R.color.intro_txt_cell_color)); // here I change background
if (mGameCell.isFixed()) {
p.setAlpha(140);
} else {
p.setAlpha(90);
}
drawBackground(canvas, 3, 3, mWidth - 3, mHeight - 3, p);
break;
When I add set color again, it changes my background. How can I change both text color and background?