Comments (3)
Are you saying you want to show some thumbnail before the genre title in the list?
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.
@ganesh2shiv Thank you so much for this incredible work :)
from uamp.
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)
- Android auto does not play whole album songs list
- Use API 28 signature retrieval APIs for the allowlisting logic
- How can i set a drawable file in MediaItem in automotive app? HOT 1
- List of songs on main activity HOT 1
- Wanna remove seekbar in android auto for some songs
- Media resources referenced via https://android-tv-classics.firebaseapp.com/* are not accessible
- when invoke service.startforegorund method i got error
- Different build variants with android auto
- Stop MediaSessionService when the notification is deleted
- After several quick calls to mediassion.setMetada ,No callback for MediaControllerCompat.Callback().onMetadataChanged
- No NPL on automotive (branch media3)
- KotlinJvmAndroidCompilation with name 'debugAndroidTest' not found HOT 1
- Migrate to media3 HOT 2
- No cached version of com.google.dagger:hilt-android:2.44 available for offline mode.
- Android Automotive icons
- Automotive Play buttons HOT 4
- Is there a demo for instant messaging classes that support Android Auto
- Superace88
- Update to jetpack compose version HOT 1
- Crash on MediaLibraryService when swiping up app (media3 branch)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uamp.