Android TV Leanback Text Color
3 answers
You can change the text color of the ImageCardView like this:
// I'm assuming you're creating your ImageCardView within a Presenter
@Override
public ViewHolder onCreateViewHolder(ViewGroup viewGroup) {
final Context context = viewGroup.getContext();
final ImageCardView imageCardView = new ImageCardView(context);
imageCardView.setFocusable(true);
imageCardView.setFocusableInTouchMode(true);
((TextView) imageCardView.findViewById(R.id.title_text)).setTextColor(TITLE_COLOR); // Title text
((TextView) imageCardView.findViewById(R.id.content_text)).setTextColor(DESCRIPTION_COLOR); // Description text
return new ViewHolder(imageCardView);
}
+3
source to share
Look for the correct id in lb_image_card_view.xml, for example here: https://github.com/kingargyle/adt-leanback-support/blob/master/leanback-v17/res/layout/lb_image_card_view.xml
+2
source to share