Custom your ImageCardView style ( not the content )
Asked Answered
A

1

7

How can I custom the ImageCardView to be circular in Leanback?

Antonioantonius answered 14/3, 2017 at 15:12 Comment(2)
Do you mean circular? So instead of a square the ImageCardView would be a circle?Movie
Yes that is what I am trying to doAntonioantonius
M
7

There are few ways you could do this. I think the cleaner approach would be creating your own custom CardView which extends BaseCardView. Then you could create your own CardPresenter which is capable of presenting that circular card type.

The leanback showcase sample app goes into great detail about customizing cards. I'd suggest looking at all of it but the relevant part would be their custom CharacterCardView. Which has it's entirely own custom layout. And then it has it's own CharacterCardPresenter. I'd copy the code right into here but those classes links will do much better justice.

The alternative is to override lb_image_card_view.xml and replace it with your own circular view. As long as you keep the resource ids and the view types the same, you could maybe get away with styling it how you like. ImageCardView is also highly styleable which you can read about in the ImageCardView docs.

Movie answered 14/3, 2017 at 22:39 Comment(1)
Thank you very much ! that is what I am looking for.Antonioantonius

© 2022 - 2024 — McMap. All rights reserved.