Overview
Track list components render audio tracks in various contexts including local music libraries, albums, playlists, and search results. Each component includes artwork, metadata, and contextual actions.LocalTracksList
Scrollable list of local music tracks with alphabetical fast scrolling. Location:ui/screens/LocalMusicScreen.kt:479
Parameters
List of local tracks to display
Scroll state for the lazy list (supports state restoration)
Callback when track is clicked. Receives the track and full track list for queue context.
Callback to share a track file
Callback to delete a track from device
Callback to edit track metadata
Callback to add track to a playlist
Total device storage in bytes for progress calculation
Bottom padding for dynamic navigation bar spacing
Features
- Statistics bar: Shows track count, storage usage bar, and total size in GB
- Alphabetical indexing: Fast scroll bar with A-Z letters for quick navigation
- Auto-sync scrolling: Current letter indicator updates based on scroll position
- Format badges: Visual indicators for FLAC, WAV, MP3, AAC formats
- File size display: Compact size display per track
- Context menu: Share, add to playlist, details, edit, delete options
Usage Example
LocalTrackItem
Individual track list item with album art, metadata, format badge, and context menu. Location:ui/screens/LocalMusicScreen.kt:737
Parameters
Track data to display
Callback to share the track
Callback to delete the track
Callback to edit track metadata
Optional callback to add track to playlist
Callback when track row is clicked
Custom label for delete menu item
Layout Structure
- Album artwork: 48x48dp rounded square
- Track title: Bold, 16sp, marquee scrolling for overflow
- Artist name: 12sp, gray color
- Format badge: FLAC (blue), WAV (amber), MP3/AAC (gray)
- File size: Compact format (e.g., “3.2MB”)
- Menu button: Three-dot icon for context actions
Context Menu Actions
- Share: Opens system share sheet for the audio file
- Add to Playlist: Shows playlist picker (if callback provided)
- Details: Opens
TrackDetailsDialogwith file information - Edit: Opens
EditTrackDialogfor metadata editing - Delete: Deletes the track from device (red text)
Format Badges
Visual indicators based on MIME type:| Format | Color | Background |
|---|---|---|
| FLAC | Blue (#00A2E8) | Blue at 20% opacity |
| WAV | Amber (#FFC107) | Amber at 20% opacity |
| MP3 | Gray | Surface dark |
| AAC | Gray | Surface dark |
AlbumGridItem
Grid item for displaying album with artwork and metadata. Location:ui/screens/LocalMusicScreen.kt:634
Parameters
Album data to display
Callback when album is clicked
Layout
- Artwork: Square aspect ratio (1:1) with 8dp rounded corners
- Title: 14sp, medium weight, marquee scrolling
- Artist: 12sp, gray color, marquee scrolling
- Alignment: Center-aligned in column
Usage Example
ArtistGridItem
Grid item for displaying artist with circular avatar and track count. Location:ui/screens/LocalMusicScreen.kt:694
Parameters
Artist data to display
Callback when artist is clicked
Layout
- Avatar: 96dp circular shape with person icon placeholder
- Name: 14sp, medium weight, marquee scrolling
- Track count: “X songs” in gray, 12sp
- Alignment: Center-aligned in column
Usage Example
TrackListItem (Deezer)
Track list item for online Deezer tracks with download functionality. Location:ui/screens/AlbumScreen.kt:279
Parameters
Deezer track data to display
Track number in the list
Whether track is already downloaded
Whether track is currently downloading
Callback to initiate download
Layout Structure
- Track number: Left-aligned, 32dp width
- Track title: Bold, 14sp, white
- Artist name: 12sp, gray (hidden if same as album)
- Duration: Formatted time (mm:ss)
- Preview button: 30-second preview playback
- Download button: States: download icon, progress spinner, or checkmark
Download States
| State | Icon | Color | Enabled |
|---|---|---|---|
| Not downloaded | Download icon | Primary | Yes |
| Downloading | Circular progress | Primary | No |
| Downloaded | Checkmark | Green | No |
Usage Example
PlaylistTrackItem
Track item variant for playlist screens (similar toTrackListItem but with album art).
Location: ui/screens/PlaylistScreen.kt:285
Key Differences from TrackListItem
- Shows album artwork (48x48dp) instead of track number
- Includes artist name even if it matches album
- Used in playlist detail views
Parameters
Identical toTrackListItem, except:
- No
indexparameter - Album artwork displayed from
track.album?.coverSmall
FormatBadge
Compact format indicator for audio file types. Location:ui/screens/LocalMusicScreen.kt:880
Parameter
MIME type of the audio file (e.g., “audio/flac”, “audio/mpeg”)
Format Detection
Styling
- Padding: 4dp horizontal, 2dp vertical
- Font: 10sp, bold
- Corner radius: 4dp
- High-quality formats (FLAC, WAV): Colored background and text
- Standard formats (MP3, AAC): Gray text on dark background
Related Components
- Music Player - Full-screen and mini player
- Dialogs - Track details and editing dialogs