1.7 KiB
1.7 KiB
Tabbed Station Libraries
Task
Replace the single station list with a tabbed interface where every playlist gets its own tab, SomaFM is a built-in tab with listener-count sorting, and imported playlists become their own tabs automatically.
Changes Made
Data Model
- Station.kt -- Added
listenerCount: Int = 0field for sort-by-listeners feature - Playlist.kt -- Added
isBuiltIn: Boolean = falseto protect built-in playlists (SomaFM) from deletion
Database
- RadioDatabase.kt -- Bumped to version 2, added
MIGRATION_1_2that adds the new columns and seeds SomaFM data for existing installs - SomaFmSeedData.kt -- Added listener counts to all 44 stations, set
isBuiltIn = trueon SomaFM playlist, extracted sharedseedStations()function used by bothonCreateand the migration - RadioApplication.kt -- Registered
MIGRATION_1_2
UI
- StationListScreen.kt -- Complete restructure:
ScrollableTabRowfor tabs,SortChipRowwith FilterChips (Default, A-Z, Z-A, Listeners), per-tab station list. Built-in tabs hide add/import/delete actions. Listener count shown inline on SomaFM stations. Long-press edit/delete disabled on built-in tab stations. - StationListViewModel.kt -- New state model with
TabInfo,SortMode, tab selection, and in-memory sorting. Import now creates a new playlist (tab) from the file name and assigns all parsed stations to it, then switches to the new tab. - AddStationDialog.kt -- Simplified: removed playlist picker (stations go to current tab's playlist automatically)
- EditStationDialog.kt -- Simplified: removed playlist picker
Follow-up Items
- Drag-and-drop reordering within tabs
- Tab reordering
- Renaming tabs/playlists