I have four TextViews in my activity. Based on an incoming message, I want to change the format of these four TextViews so that one is larger and bold while the rest are smaller and regularly styled. To do this, I create two methods, setTextNormal and setTextBig. In order to change the numbers I am using this bit of code:
if (tokens[2].equals("0")) {
setTextBig(text1);
setTextNormal(text2);
setTextNormal(text3);
setTextNormal(text4);
}
if (tokens[2].equals("1")) {
setTextBig(text2);
setTextNormal(text1);
setTextNormal(text3);
setTextNormal(text4);
}
if (tokens[2].equals("2")) {
setTextBig(text3);
setTextNormal(text2);
setTextNormal(text1);
setTextNormal(text4);
}
if (tokens[2].equals("3")) {
setTextBig(text4);
setTextNormal(text2);
setTextNormal(text3);
setTextNormal(text1);
}
Notice that for each if statement, one of the TextViews are being set to big and the rest to normal. It works, but is there a more efficient way for me to set these TextViews?