Skip to content

fix(live-tv): cinematic 3D depth transition, smooth mini-player fade, EPG focus & drawer navigation overhaul - #672

Merged
ProdigyV21 merged 11 commits into
ProdigyV21:mainfrom
Himanth-reddy:fix/live-tv-navigation-and-focus
Sep 8, 2026
Merged

fix(live-tv): cinematic 3D depth transition, smooth mini-player fade, EPG focus & drawer navigation overhaul#672
ProdigyV21 merged 11 commits into
ProdigyV21:mainfrom
Himanth-reddy:fix/live-tv-navigation-and-focus

Conversation

@Himanth-reddy

@Himanth-reddy Himanth-reddy commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Comprehensive overhaul of the Live TV experience across 8 files (+814 / -341 lines). This PR replaces the previous jarring zoom/crossfade with a centered 3D cinematic depth-push transition, adds smooth mini-player alpha fade-in, fixes D-pad navigation traps, eliminates focus bounce, resolves drawer collapse jumps, and fixes EPG text clipping.


🎬 Cinematic 3D Depth Transition & Mini-Player Smoothness

  • Centered 3D Depth Push: Replaced asymmetric, jumpy zoom-in / slide transforms with a smooth 3D depth-push animation centered at (0.5f, 0.5f):
    • Enter Fullscreen: Video punches forward from depth (0.92 $\to$ 1.0 scale, with alpha 0f $\to$ 1f).
    • Exit Fullscreen (Back): Video smoothly eases back into depth (1.0 $\to$ 0.92 scale).
    • Consistent & Stable: Anchoring at screen center eliminates letterbox distortion, pivot drifting, and decoder scaling stutters on Android TV.
  • Mini-Player Alpha Fade-In: Added playerAlpha animated state (FastOutSlowInEasing, 280ms) in MiniPlayer.kt to VideoCard and LiveBug. When returning from fullscreen, the mini-player gracefully fades in rather than snapping into view.
  • Surface Lifecycle Safety: miniPlayerActive is only active when completely out of fullscreen (!isFullScreen && fsProgress == 0f), preventing surface stealing or black flicker mid-animation. Focus restoration is deferred until the transition is 100% complete.

🧭 EPG Grid Navigation & Focus Anchoring

  • Natural Context Offset Scrolling: Re-anchors the channel list to (resolvedIdx - 2).coerceAtLeast(0) on launch/return, providing 2 channels of visible context above the selected channel rather than snapping it to the edge.
  • Native 60fps Channel Scrolling: Allowed LazyColumn to handle D-pad vertical movement naturally instead of intercepting every step with synthetic focus updates. This eliminates focus bounce between channels 0 and 1 and restores native smooth scrolling.
  • Smart Row Fallback (hasFocusablePrograms): Moving vertically between EPG program rows checks if the target channel actually has focusable programs (including catchup window validation). If no programs are focusable, focus gracefully drops to the channel header (onExitEpg) instead of getting trapped or dropping to unrelated rows.
  • Prefer-Live Focus Target: When moving horizontally into EPG programs or switching rows, automatically targets the currently airing program (placement.isNow) where applicable.
  • Sticky Program Title Offset: Implemented contentStartOffsetDp calculation in ProgramsRow and ProgramCell so that when scrolling past the start of a long program, the title and synopsis shift into view (scrolledPastPx.coerceAtMost(maxShiftPx)), keeping metadata readable.
  • Row Highlight Decoupling: Separated D-pad cursor focus (visuallyFocused $\to$ LiveColors.PanelRaised) from the playing channel indicator (isActive $\to$ LiveColors.FocusBg with cyan indicator). Fixed the issue where navigating away from a playing channel turned the entire EPG row solid blue.

📂 Category Sidebar & Drawer Robustness

  • Viewport-Aware Drawer Re-entry Focus: Fixed the drawer focus trap where scrolling away from the selected category in the sidebar caused focus loss upon re-entry. Sequential fallback chain:
    1. Last focused category key
    2. Selected category requester
    3. Currently visible items in LazyColumn layout info
    4. Any registered category requester currently composed
    5. First row fallback
  • Prevent ConcurrentModificationException: Captured a snapshot list (categoryFocusRequesters.values.toList()) before iterating over requesters during rapid navigation.
  • Drawer Collapse Jump Elimination: Applied clipToBounds() and width containment to prevent layout jumping when opening/closing the drawer.
  • Category & Playlist State Persistence: Restores expandedPlaylistIds based on the selected category so returning from home or navigating within a playlist does not collapse the section.
  • Empty Favorites Filter: Filtered out fav category when item count is 0 in both CategorySidebar and TouchCategoryRail.

🎨 Typography & Layout Fixes

  • EPG Text Clipping Fix: Adjusted ProgramCell typography (CellTitle to 9.5sp / 12sp line-height, synopsis and timestamps to 8sp / 10sp line-height) and reduced padding (4dp $\to$ 2dp) to prevent timestamp truncation and duration clipping on standard TV DPIs.
  • Channel Name Layout Clipping: Added .clipToBounds() to the channel title column in ChannelRow.kt to prevent text bleed during quick scroll transitions.
  • Session Persistence: Defaulted lastFocusedZone = "GUIDE" and allowed optional parameters in TvViewModel.rememberTvSession for clean partial updates.

Files Changed

File Changes
LiveTvScreen.kt 3D depth transition, fullscreen exit timing, playlist category persistence, focus routing
MiniPlayer.kt Smooth playerAlpha fade-in, bounds reporting, conditional player attachment
EpgGrid.kt Focus anchoring with offset, native D-pad scrolling, sticky program title shift, prefer-live focus
CategorySidebar.kt Viewport-aware focus fallback, CME prevention snapshot, drawer jump fix, playlist persistence
ChannelRow.kt Decoupled focus vs playing background color, text bounds clipping
ProgramCell.kt Font size & line height adjustments to fix text clipping, contentStartOffsetDp support
TouchCategoryRail.kt Filter out empty favorites category
TvViewModel.kt Optional parameters & default zone in rememberTvSession

Verification & Testing

  • Tested on Android TV Emulator (1080p, API 31):
    • Verified 3D depth push transition on enter & exit (60fps, no letterbox distortion or freeze).
    • Verified mini-player fade-in on fullscreen exit (no sudden snap or flicker).
    • Verified channel list D-pad navigation from item 0 to bottom without bounce.
    • Verified opening drawer, scrolling away from active playlist, and navigating back into the drawer retains focus correctly.
    • Verified EPG program cells render full title, synopsis, time, and duration badges without text clipping.

…ation

- Decouple focus outline from active channel state so navigating channels preserves the playing channel background and cyan indicator.
- Prevent DPAD Right on channels without EPG programs from dropping focus to the row below.
- Fix drawer re-entry focus trap when scrolling away from the selected playlist by implementing viewport-aware focus requester fallback in CategorySidebar.
… channel 0/1 focus bounce, and program time clipping
@github-actions github-actions Bot added the area: android Changes to the Android app or Gradle build label Sep 7, 2026
@Himanth-reddy Himanth-reddy changed the title fix(live-tv): Apple TV 3D cinematic depth transition, smooth mini-player fade & EPG focus fixes fix(live-tv): Overhaul Live TV navigation, focus handling, transitions & EPG stability Sep 7, 2026
@Himanth-reddy Himanth-reddy changed the title fix(live-tv): Overhaul Live TV navigation, focus handling, transitions & EPG stability fix(live-tv): Apple TV 3D depth transition, smooth mini-player fade, EPG focus & drawer navigation overhaul Sep 7, 2026
…r fade

- Replace slide/crossfade fullscreen transition with centered 3D depth-push
  (0.92 → 1.0 scale) for a premium cinematic feel
- Add consistent enter/exit animation using graphicsLayer with centered pivot
- Implement smooth alpha fade-in on VideoCard when returning to mini-player
- Fix EPG focus anchoring to last-played channel with (resolvedIdx - 2) offset
- Enable native 60fps channel list scrolling via LazyColumn D-pad handling
@Himanth-reddy
Himanth-reddy force-pushed the fix/live-tv-navigation-and-focus branch from 0be6384 to 8abb061 Compare September 7, 2026 17:27
@Himanth-reddy Himanth-reddy changed the title fix(live-tv): Apple TV 3D depth transition, smooth mini-player fade, EPG focus & drawer navigation overhaul fix(live-tv): cinematic 3D depth transition, smooth mini-player fade, EPG focus & drawer navigation overhaul Sep 7, 2026
@ProdigyV21

Copy link
Copy Markdown
Owner

Added 49f241f on top of this PR: compact 16:9 mini-player, unframed programme information, unified column backgrounds with focus tint transitions, inset channel outlines without focus scaling, narrower channel spacing, less clutter in short EPG cells, and a viewport-clamped NOW label. Programme cells cannot steal vertical focus in channel mode; sticky text reads horizontal scroll during measurement instead of row composition. Added a vertical channel navigation regression test. Verification: signed sideload release builds successfully; all 3 GuideRenderingDeviceTest instrumentation tests passed on Android 12 emulator, including large-list rendering and offscreen EPG navigation. Installed on TCL with matching existing certificate and no data clear. Drawer open/close and 12-down/6-up channel navigation checked on TV. Caveats: a mixed TV measurement recorded 17.21% janky frames, so this is not a 60fps guarantee. NPO playback failed with PARSING_CONTAINER_UNSUPPORTED on both the previously installed build and this build; playback is not validated by this change. PR remains open for review.

@ProdigyV21

Copy link
Copy Markdown
Owner

Follow-up 933c535: focus colours now invalidate drawing rather than row composition; removed redundant programme scale/border animations; cached the full startup channel-ID set instead of rebuilding it during screen recomposition. Focused programmes now show readable title/time/description beside the mini-player. Diagnostic banners expire after 8 seconds. Unsupported live containers get one explicit format probe rather than 3 identical retries; error/HTML redirects are not cached as valid media targets. Verification: 6 resolver unit tests passed; 4 guide instrumentation tests passed on a 2GB Android 12 emulator configuration, including 60 down / 40 up and programme focus reporting. Final release build succeeded and installed on TCL using the existing signing certificate. Visually verified NPO 1 HD and NPO 3 HD playback, fullscreen return, drawer/category changes, and first-click Add to Favorites (test change restored). IMPORTANT: performance acceptance is still FAILED. Short rapid-key stress runs with live playback measured 55-59% janky frames on final build, versus 29% on an earlier non-playing run; these are not controlled like-for-like benchmarks and do not establish a speed improvement. Do not merge on a claim of smoothness. Remaining work is profiling the live-playback/guide CPU contention and sustained real-device navigation before release.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 8, 2026
@ProdigyV21
ProdigyV21 merged commit 51c761f into ProdigyV21:main Sep 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: android Changes to the Android app or Gradle build documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants