本文介绍了没有得到大拇指流派 - 环球音乐播放器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用谷歌提供 UMP 例如,我没有做我的code的任何变化,连我都没有尝试过任何东西开箱,我刚刚导入您的项目到我的工作空间,并检查了我的设备上,并且发现我是没有得到与流派拇指(歌曲流派)和流派的名单..

而我应该从我们的JSON得到大拇指,这里是我试图(但没有成功) -

  holder.mImageView.setImageBitmap(description.getIconBitmap());

更新#1 按建议的@NageshSusarla

  holder.mTitleView.setText(description.getTitle());
      holder.mDescriptionView.setText(description.getSubtitle());        AlbumArtCache缓存= AlbumArtCache.getInstance();
        位图艺术= cache.getIconImage(URL);
        如果(艺术== NULL){
            cache.fetch(网址,新AlbumArtCache.FetchListener(){
                @覆盖
                公共无效onFetched(字符串artUrl,位图的位图,位图图标){
                    如果(artUrl.equals(URL)){
                        holder.mImageView.setImageBitmap(图标);
                    }
                }
            });
        }其他{
            holder.mImageView.setImageBitmap(位图);
        }     holder.mImageView.setImageBitmap(description.getIconBitmap());

和获得无法解析符号URL


解决方案

  1. 的图标的位图可能没有被设置。这是最好使用AlbumartCache获取的图标,然后将其设置在ImageView的。该URL将被传递给 AlbumArtCache.getInstance()获取(URL,..) description.getIconUri()。的toString()

  2. 您可能没有看到它在uAmp的原因是因为色调的被应用到它。您可以从media_list_item.xml删除色调尝试改变。

除了:这的确是通过设计和图标仅在当用户选择要播放的项目底部所示

I am using UMP example provided by Google, I have not made any change in my code, even I have not tried anything out of the box, I just imported your project into my work-space and checked it on my device, and found that I am not getting Thumb with Genres (Songs by genre) and List of Genres...

Whereas I supposed to get Thumb from our JSON, here is what I have tried (but no success) -

holder.mImageView.setImageBitmap(description.getIconBitmap());

UPDATE # 1 AS PER SUGGESTED BY @NageshSusarla here

      holder.mTitleView.setText(description.getTitle());
      holder.mDescriptionView.setText(description.getSubtitle());

        AlbumArtCache cache = AlbumArtCache.getInstance();
        Bitmap art = cache.getIconImage(url);
        if (art == null) {
            cache.fetch(url, new AlbumArtCache.FetchListener() {
                @Override
                public void onFetched(String artUrl, Bitmap bitmap, Bitmap icon) {
                    if (artUrl.equals(url)) {
                        holder.mImageView.setImageBitmap(icon);
                    }
                }
            });
        } else {
            holder.mImageView.setImageBitmap(bitmap);
        }

     holder.mImageView.setImageBitmap(description.getIconBitmap());

and getting Cannot resolve symbol 'url'

解决方案
  1. The icon bitmap may not have been set. It's best to use the AlbumartCache to fetch the icon and then set it on the imageView. The url to be passed to AlbumArtCache.getInstance().fetch(url,..) is description.getIconUri().toString()
  2. The reason you may not be seeing it in uAmp is because of the tint being applied to it. You can remove the tint from media_list_item.xml to try out the changes.

Aside: This is indeed by design and the icon is only shown at the bottom when a user selects the item to be played.

这篇关于没有得到大拇指流派 - 环球音乐播放器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 14:37