1

这是交易....我正在研究android tv的leanback,我需要在我的卡片左侧放置一个图标问题是应用程序只使用leanback主题的样式,xml只接受16 dp,如果我尝试更改文件自动删除,那么我的问题是,有没有办法对这些文件进行更改?因为我需要这样的东西:

图片

这是我的代码:

public void onBindViewHolder(ViewHolder viewHolder, Object item) {

    LiveTv card = (LiveTv) item;

    final ImageCardView cardView = (ImageCardView) viewHolder.view;


    if (card.getCardImageURI() != null) {
        if(card.getTipo()==0){
            cardView.setMainImageDimensions(CARD_WIDTH,CARD_HEIGHT);
            cardView.setTitleText(card.getNombre());
            Glide.with(viewHolder.view.getContext()).load(card.getCardImageUrl()).error(mDefaultCardImage).into(cardView.getMainImageView());


        }else {
            Glide.with(viewHolder.view.getContext()).load(card.getLogo()).asBitmap().into(new SimpleTarget<Bitmap>(CARD_WIDTH,CARD_HEIGHT) {
                @Override
                public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
                    Drawable drawable = new BitmapDrawable(resource);

                    cardView.setBadgeImage(drawable);

                }
            });

            cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT);
            cardView.setTitleText(card.getChannel() + "   " + card.getNombre());
            cardView.setContentText(card.getTsStart() + " " + card.getTsEnded());
            Glide.with(viewHolder.view.getContext()).load(card.getCardImageUrl()).centerCrop().error(mDefaultCardImage).into(cardView.getMainImageView());
        }
    }
}
4

0 回答 0