Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / library / tv / AGENTS.md

AGENTS.md3.0 KiBRenderedCodeRaw
1# AGENTS.md — library/tv/ (':library:tv')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/tv/` + allowed shared modules. Do not root-scan.
4
5- Gradle: :library:tv / dir: library/tv/
6- Package roots present: (TV Compose components — one package)
7- Entry files: TvAppFrame.kt + TvTheme.kt (no MainActivity/Route — library)
8- Deps: :library, :library:ui
9- Metadata: metadata_data/library-tv.md (absent — libraries have none by design)
10- Rust: no / screenshotTest: no
11
12## Overview
13**Purpose:** Shared ten-foot TV Compose components — always-dark themed app frame with a navigation rail, D-pad-first cards/grids/controls/inputs, states and player transport, built on `androidx.tv.material`.
14**How to use:** Host app wraps screens in `TvAppFrame` (or the route-backed overload with `TvRouteDestination`s), lays bodies out in `TvGrid`, and renders items with `TvCard`/`TvInfoCard`; accent per app via `TvAccent`, spacing via `TvDimens`.
15**Entry points:** `TvAppFrame.kt` → `TvTheme.kt` → `TvGrid.kt` → `TvCards.kt`.
16**Gotchas:**
17- Consumers are TV surfaces in several apps — `cast/tv` (the receiver), plus the TV UIs in `appstore`, `uniflix` and `youpipe` (each declares `implementation(project(":library:tv"))`). Keep components app-agnostic: no app models, routes or stores in here.
18- No INTERNET and no `:library:image` by design: this module must not inherit network/image loading, so the offline cast receiver stays offline. Image-bearing components take a caller-provided image slot/composable instead of a URL — never add `:library:image` or a URL loader here.
19- Icons come only from `:library:ui` (`IconXxx()`); a destination's icon is an `IconXxx()` composable, never a raw resource in this module.
20- D-pad first: focus must always have a starting target (`TvInitialFocus`), focused surfaces flip near-white with dark content, and `TvTextField` raises the IME only on an explicit CENTER press.
21- Draw-only transport: `TvSeekBar` renders progress/markers only — the caller owns LEFT/RIGHT scrubbing and playback state.
22
23## Key files
24- com/vayunmathur/library/tv/TvAppFrame.kt — rail app frame (`TvDestination` / route-backed `TvRouteDestination`)
25- com/vayunmathur/library/tv/TvTheme.kt — always-dark theme, `TvAccent`, `TvDimens`
26- com/vayunmathur/library/tv/TvLayout.kt — content insets/padding for overscan-safe screens
27- com/vayunmathur/library/tv/TvGrid.kt — scrolling screen grid + full-width rows
28- com/vayunmathur/library/tv/TvCards.kt — media/catalog card (`TvAspect` ratios)
29- com/vayunmathur/library/tv/TvInfoCard.kt — full-information list-row card
30- com/vayunmathur/library/tv/TvControls.kt — `TvButton` / `TvIconButton`
31- com/vayunmathur/library/tv/TvInput.kt — D-pad text field (IME on CENTER only)
32- com/vayunmathur/library/tv/TvStates.kt — initial-focus helper + empty/error states
33- com/vayunmathur/library/tv/TvTransport.kt — draw-only player seek bar
34
35## Verify (this module only)
36```
37./gradlew :library:tv:compileDevKotlin
38./gradlew :library:tv:lint
39```