I am trying to change the background color of the infoArea on an ImageCardView in the Android Leanback Library when the card is selected. Currently what I have tried is changing the background in the OnItemViewSelectedListener. This changes the background, but then doesn't clear the previously selected item.
private final class ItemViewSelectedListener implements OnItemViewSelectedListener {
@Override
public void onItemSelected(Presenter.ViewHolder itemViewHolder, Object item,
RowPresenter.ViewHolder rowViewHolder, Row row) {
if (item instanceof Video) {
mBackgroundURI = ((Video) item).getBackgroundImageURI();
startBackgroundTimer();
((ImageCardView) itemViewHolder.view)
.setInfoAreaBackgroundColor(getResources().getColor(R.color.dark_blue_grey));
}
}
}
I would like to achieve something like this:
Any ideas? Thanks.