26 lines
4.6 KiB
Markdown
26 lines
4.6 KiB
Markdown
# TV interface and controls
|
||
|
||
The first build uses an ink / warm-white / soft-pink palette: background `#0C1017`, panel `#181F29`, text `#F5F1ED`, secondary text `#9DAAB9`, accent `#FFA5B9`. Pink marks selection and focus; normal cards use dark surfaces. All shapes are authored in Compose and no marketing artwork is bundled.
|
||
|
||
At a typical 960 × 540 dp TV viewport, the home screen has 38 dp horizontal and 24 dp vertical safe insets, a 44 dp tab/action row, a 21 sp section heading, and a four-column recommendation grid and five-column portrait grid with 18 dp gaps. Recommendation thumbnails are 16:9; movie/bangumi covers use a 0.72 portrait ratio. Focused cards gain a 3 dp border and a 1.025 scale. Buttons and episode items have at least 44 dp height. Account status stays in a top-right capsule. Loading, empty, error and pagination states use the same layout and do not insert a fake catalogue.
|
||
|
||
## Remote
|
||
|
||
- Home: direction keys move among tabs, cards, refresh, account and load more. Confirm selects a tab or opens video details. Back from the grid returns focus to the selected tab. Android's normal back handling applies from the header.
|
||
- Search: the header entry opens a separate screen while preserving Home. Confirm on the text field opens the system IME; its Search action, Enter, or the explicit search button submits. Typing alone never requests results. Down moves to the selected video/movie/bangumi filter, then into the four/five-column result grid. Results use the existing details/episode/player flow. Back first hides the keyboard, then returns from the grid to the selected filter, then closes search. Clear returns to the input. Closing clears the transient query and results; there is no search history.
|
||
- Details: first episode receives focus after loading. Confirm starts playback. Multi-part videos and series have an episode grid. Back closes the dialog.
|
||
- Login: QR code is generated locally with ZXing, not uploaded to a QR service. Refresh and close are D-pad targets. Closing cancels the parent-owned poll task. No password input is present.
|
||
- Player: confirm or play/pause toggles playback; left/right seek ten seconds, with long press throttled to one step per 250 ms. Up reveals controls and focuses the top-right quality action; confirm opens its menu. Down returns focus to the video. Back exits playback directly. Both key-down and key-up are consumed so Android PlayerView cannot apply the same event twice. Controls remain visible when paused/end/error, while the quality action is focused or while its menu is open, and otherwise hide after four seconds during playback.
|
||
- Quality menu: the current option is marked and receives focus, scrolling into view if necessary. Up/down navigate and confirm selects. Back/Close returns focus to the quality action. Only actual compatible tracks are shown; a single available option is explained. Changes briefly rebuffer at the same position and retain pause/play intent. An in-flight change disables duplicate selection; failure attempts the original quality once and reports recovery after it is ready. Choosing the current option closes without reloading. This is manual selection; each new video starts at the default quality and there is no automatic bitrate adaptation.
|
||
- App backgrounding pauses the player; foregrounding resumes only if it was previously playing. Leaving the player releases Media3 and screen-on state.
|
||
|
||
Search remains composed beneath details and playback, with focus/clicks disabled while inactive. Returning restores the selected result and scroll position. Load more retains its focus during the request, then moves focus to the first appended result. If the final page adds no items, focus returns to the last result. Empty, error, risk-control and loading states do not use placeholder search results.
|
||
|
||
The player requests signed CDN URLs with a Bilibili Referer and browser User-Agent, without account cookies. It merges separate AVC/AAC fMP4 tracks through Media3, can use official backup CDN URLs after connection failure, and hides raw decoder/network exceptions that might include signed URLs. Actual decoder/remote behavior still needs testing on the target TV.
|
||
|
||
## Visual review
|
||
|
||
Prefer an emulator screenshot of the real Compose UI. If an HTML preview is used before an emulator is available, label it as a layout preview, use the dimensions/palette above and real fetched API data, and do not treat it as runtime verification. Community screenshots from unrelated clients are not assets for this app.
|
||
|
||
Current search runtime screenshots: [video results](screenshots/search.png) and [bangumi results](screenshots/search-bangumi.png).
|