I believe this is not possible from XML right now. I know that on the Android platform only support for theme attributes in resources with the ability to draw in Lollipop has been added, and it does not work below API 21. I believe that color resources have never received support.
!
final TypedArray attributes =
itemView.getContext().obtainStyledAttributes(R.styleable.WowSdkSongViewHolder);
try {
int colorAccent =
attributes.getColor(R.styleable.WowSdkSongViewHolder_colorAccent, 0);
final int textColorPrimary = attributes.getColor(
R.styleable.WowSdkSongViewHolder_android_textColorPrimary, 0);
title.setTextColor(new ColorStateList(
new int[][] { ThemeUtils.ACTIVATED_STATE_SET, ThemeUtils.EMPTY_STATE_SET },
new int[] { colorAccent, textColorPrimary }));
} finally {
attributes.recycle();
}
, . ColorStateList. ( , , int[][]) . ColorStateList TextView setTextColor.
AppCompat , ThemeUtils. , , , ThemeUtils.