Мне нужно изменить цвет текста при изменении состояния (нажатие, фокус) ...
Как установить цвет текста для TextView
с использованием ColorsStateList
?
редактировать, решено:
textView.setTextColor(new ColorStateList(
new int [] [] {
new int [] {android.R.attr.state_pressed},
new int [] {android.R.attr.state_focused},
new int [] {}
},
new int [] {
Color.rgb (255, 128, 192),
Color.rgb (100, 200, 192),
Color.White
}
));
решение 2
textView.setTextColor(getResources().getColorStateList(R.color.your_colors))