Split the shared code into a core module

The Yandex Music client, the player, the app state and the stores move from the
TV app to :core (it.panov.musyx.*), so a phone app can build on them. The TV app
becomes :tv with the same application id. CoverHues, SessionPlayer and the
strings the state layer shows move with them; LRCLIB's user agent is set by
each app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Yuriy PanovandClaude Opus 5.5 committed 2026-10-23 10:07:21 +06:00
1 parent 90ac73facc
commit 4c978efa80
121 files changed
+464 -397

No files matched your search

+10 -6
View File
@@ -46,16 +46,16 @@ writes it) or `ANDROID_HOME`. The Gradle wrapper fetches everything else.
./gradlew assembleDebug
```
The APK lands in `app/build/outputs/apk/debug/app-debug.apk`. `./gradlew testDebugUnitTest`
The APK lands in `tv/build/outputs/apk/debug/tv-debug.apk`. `./gradlew testDebugUnitTest`
runs the JVM tests (the queue and player rules, API parsing and request signing, lyrics,
decryption and theme parity, mostly ported from the desktop tests), and `./gradlew lint` runs Android
Lint, with the report in `app/build/reports/lint-results-debug.html`.
Lint, with a report in each module's `build/reports/lint-results-debug.html`.
To run it, start an Android TV or Google TV emulator (Device Manager in Android Studio, TV
category) or connect a TV with ADB debugging on, then:
```bash
./gradlew installDebug
./gradlew :tv:installDebug
```
```bash
@@ -67,7 +67,7 @@ tablets, since neither Leanback nor a touchscreen is required.
### Generated resources
The icons, banner and fonts in `app/src/main/res` come from `assets/`. Regenerate them after
The icons, banner and fonts in `tv/src/main/res` come from `assets/`. Regenerate them after
changing the sources:
- `python3 tool/svg_to_vector.py` turns `assets/icons/*.svg` into `res/drawable/ic_<name>.xml`.
@@ -79,15 +79,19 @@ changing the sources:
## Layout
- `app/`: the Android TV app (`it.panov.musyx.tv`), under `app/src/main/java/it/panov/musyx/tv`:
- `core/`: what the apps share (`it.panov.musyx`), under `core/src/main/java/it/panov/musyx`:
- `api/`: the Yandex Music client, ported from `reference/ym-api` with the `yamuse` wire
details inlined (`Transport.kt` headers and errors, `Auth.kt` device flow, `Signing.kt`).
- `player/`: `PlayerCore` (queue, repeat, waves, reports; a pure port of the desktop
player), `ExoEngine` (one ExoPlayer, with `AesCtrDataSource` for encrypted FLAC),
`PlaybackController` (runs the core's effects) and `PlaybackService` (the media session).
`PlaybackController` (runs the core's effects) and `SessionPlayer` (the player the media
session wraps).
- `state/`: `AppState`, the port of the desktop `app.rs` and `app/edit.rs`, plus search,
sign-in and navigation state.
- `data/`: settings and the Keystore-encrypted credentials.
- `res/`: the strings the state layer shows (toasts, sign-in errors, quality names).
- `tv/`: the Android TV app (`it.panov.musyx.tv`), under `tv/src/main/java/it/panov/musyx/tv`:
- `player/PlaybackService.kt`: the media session.
- `ui/`: the shell (drawer, mini player, dialogs, toasts), `screens/` and `components/`.
The theme is `ui/theme/Theme.kt`, a 1:1 port of `DESIGN.md`.
- `gradle/libs.versions.toml`: dependency versions.