Android TV Leanback imagecardview text color

2.9k views Asked by At

Anybody knows how can i change title textcolor from Leanback ImageCardView ???

I have tried to override leanback style but maybe I haven't found the correct attribute.

Thank you so much!!!

3

There are 3 answers

0
Tomap On BEST ANSWER

You can change the text colour of the ImageCardView as following:

// 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);
}
0
Evan Ngo On

you can custom ImageCardView for what do you want with CustomImageCardView extends BaseCardView

0
orbitbot On