GithubHelp home page GithubHelp logo

Not getting Thumb with Genres about uamp HOT 3 CLOSED

android avatar android commented on June 27, 2024
Not getting Thumb with Genres

from uamp.

Comments (3)

ganesh2shiv avatar ganesh2shiv commented on June 27, 2024

Are you saying you want to show some thumbnail before the genre title in the list?

Something like this?
screenshot

If yes, you can put this code in the MediaItemViewHolder.java file

default:
    holder.mImageView.setVisibility(View.GONE);
    if (description.getTitle().toString().equalsIgnoreCase("Rock")) {
        holder.mImageView.setImageDrawable(
                activity.getDrawable(R.drawable.ic_rock_genre));
        holder.mImageView.setVisibility(View.VISIBLE);
    } else if (description.getTitle().toString().equalsIgnoreCase("Cinematic")) {
        holder.mImageView.setImageDrawable(
                activity.getDrawable(R.drawable.ic_cinematic_genre));
        holder.mImageView.setVisibility(View.VISIBLE);
    } else if (description.getTitle().toString().equalsIgnoreCase("Jazz & Blues")) {
        holder.mImageView.setImageDrawable(
                activity.getDrawable(R.drawable.ic_jazz_genre));
        holder.mImageView.setVisibility(View.VISIBLE);
    }

and put the icons ic_rock_genre, ic_cinematic_genre, and ic_jazz_genre in the drawables folder.

Or you can load the icons from the network using some third party library like Picasso.

default:
    holder.mImageView.setVisibility(View.GONE);
    if (description.getTitle().toString().equalsIgnoreCase("Rock")) {
        Picasso.with(activity).load("https://raw.githubusercontent.com/google/material-design-icons/master/av/drawable-hdpi/ic_surround_sound_black_36dp.png").into(holder.mImageView);
        holder.mImageView.setVisibility(View.VISIBLE);
    } else if (description.getTitle().toString().equalsIgnoreCase("Cinematic")) {
        Picasso.with(activity).load("https://raw.githubusercontent.com/google/material-design-icons/master/av/drawable-hdpi/ic_web_black_36dp.png").into(holder.mImageView);
        holder.mImageView.setVisibility(View.VISIBLE);
    } else if (description.getTitle().toString().equalsIgnoreCase("Jazz & Blues")) {
        Picasso.with(activity).load("https://raw.githubusercontent.com/google/material-design-icons/master/av/drawable-hdpi/ic_movie_black_36dp.png").into(holder.mImageView);
        holder.mImageView.setVisibility(View.VISIBLE);
    }

Hope it helps.

from uamp.

SopMar avatar SopMar commented on June 27, 2024

@ganesh2shiv Thank you so much for this incredible work :)

from uamp.

devshisiyani avatar devshisiyani commented on June 27, 2024

the code you have pasted above does not compile at the latest code in MediaItemViewHolder.java
The lastest java code uses class Drawable
any chance of providing snippet code for put the icons ic_rock_genre, ic_cinematic_genre, and ic_jazz_genre in the drawables folder
thank

from uamp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.