Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not Getting Thumb with Genres - Universal Music Player

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'

like image 901
Sophie Avatar asked Jan 05 '16 09:01

Sophie


1 Answers

  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.

like image 180
Nagesh Susarla Avatar answered Oct 20 '22 15:10

Nagesh Susarla