[TV] Hide the top bar on nested detail screens - #5700
Conversation
Generated by 🚫 Danger |
|
Claude finished @sztomek's task in 6m 12s —— View job Review: [TV] Hide the top bar on nested detail screens
Overall this is a clean, well-scoped change and the approach (state holder + A few things I'd want addressed or at least verified on a device before merge — all of them are about focus, which is the part of this change with real user impact on TV. 1.
|
e0eb07a to
b4343cf
Compare
b4343cf to
c127887
Compare
|
Claude finished @sztomek's task in 7m 21s —— View job Review: [TV] Hide the top bar on nested detail screens
The shape of this is right: a The concerns below are almost all about focus and the cost of the new animations — the two things that actually bite on TV hardware. 1. Disposing the top bar throws away
|
Description
On Android TV the top bar (profile + tab row + logo) was shown on every screen, including nested detail screens. On the Apple TV app the tab bar is hidden on pushed detail screens (
.toolbar(.hidden, for: .tabBar)on each detail view, plus the profile/logo accessory hidden via a navigation-depth flag). This brings Android TV to parity: the top bar is now hidden on the nested detail screens so they use the full height, and it reappears when you back out.Detail screens that now hide the top bar:
How it works
TvTopBarVisibilitystate holder (counter-based) is provided through aCompositionLocal(LocalTvTopBarVisibility) inTvScaffold, mirroring the existingTvToast/LocalTvToastHostStatepattern in the module.TvHomeScreen,TvYourPodcastsScreen, andTvPlaylistsScreencalls a declarativeHideTvTopBar()effect (aDisposableEffectthat increments/decrements the counter), so visibility is driven at the navigation layer and the detail composables stay unchanged and reusable — analogous to iOS driving it from the navigation stack rather than from inside the detail views.Animations (matching Apple TV)
The Apple TV app keeps this deliberately subtle: the tab bar/accessory just fades away and the detail is a separate full-screen layer (the content underneath never reflows), and tab switches are a simple
.easeInOutcrossfade (MainTabView.swift:93). Matched on Android by:TvTopBaras a top overlay inside aBox(not aColumnrow), so the detail screen fills the whole area. The bar fades in/out (AnimatedVisibilitywithfadeIn/fadeOut, easeInOut ~300ms) instead of the earlier vertical expand/shrink that squished the bar and shoved the content.Crossfadewith an easeInOut curve, mirroring iOS.TvTabBarpreviously requested focus on the selected tab on every composition-entry. Because the bar is disposed/re-created as it hides and shows, that would steal focus back to the tab bar every time you backed out of a detail. The initial-focus request is now driven once, via a flag owned by the never-disposedTvScaffold.Layout tweak
While in here, evened out the horizontal padding on the two-pane detail screens (podcast + playlist details): they were
start = 32.dp, end = 56.dp(right edge 24dp wider than the left); both are now32.dp, matching the app's horizontal rhythm.Fixes POC-792 https://linear.app/a8c/issue/POC-792/hide-top-bar-on-nested-destinations-like-playlist-details-and-podcast
Testing Instructions
Screenshots or Screencast
Checklist
./gradlew spotlessApplyto automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xmlI have tested any UI changes...