I have a TextView
, what I want is to make the TextView
shape circle and then set different background colors based on different conditions I have used. I am able to set Background color based on different conditions but not able to make the TextView
shape circle. So how that can be done. Please help me to solve this out.
Code I have used:
TextView txt_stage_display = (TextView)findViewById(R.id.txt_stage_display);
if(m_enStage[position] == enSTAGE_START)
{
txt_stage_display.setBackgroundColor(Color.parseColor("#D48393"));
}
else if(m_enStage[position] == enSTAGE_FLOW)
{
txt_stage_display.setBackgroundColor(Color.parseColor("#D48393"));
}
else if(m_enStage[position] == enSTAGE_SAFE)
{
txt_stage_display.setBackgroundColor(Color.parseColor("#66B0CC"));
}
else if(m_enStage[position] == enSTAGE_UNSAFE)
{
txt_stage_display.setBackgroundColor(Color.parseColor("#D8C627"));
}
else if(m_enStage[position] == enSTAGE_FERTILE)
{
txt_stage_display.setBackgroundColor(Color.parseColor("#67A05E"));
}
else
{
txt_stage_display.setBackgroundColor(Color.parseColor("#808080"));
}