4

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!!!

Kabuki
  • 147
  • 4
  • 10

3 Answers3

7

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);
}
Tomap
  • 638
  • 1
  • 8
  • 21
3

Look for the right 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

orbitbot
  • 728
  • 6
  • 18
1

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

Evan Ngo
  • 254
  • 4
  • 15