How can I custom the ImageCardView
to be circular in Leanback
?
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.
© 2022 - 2024 — McMap. All rights reserved.