feat: Add Android TV D-pad navigation support with tvOptions - #2173
Open
TheNoumanDev wants to merge 156 commits into
Open
TheNoumanDev wants to merge 156 commits into
TheNoumanDev wants to merge 156 commits into
Conversation
- ensemble@1.2.35-beta.1
- ensemble@1.2.38-beta.1
- ensemble@1.2.38-beta.2
TheNoumanDev
force-pushed
the
android_TV_implementation
branch
from
April 6, 2026 08:46
0ec7c68 to
30b28fa
Compare
TheNoumanDev
force-pushed
the
android_TV_implementation
branch
from
April 6, 2026 09:35
9761dfb to
59a05bc
Compare
TheNoumanDev
force-pushed
the
android_TV_implementation
branch
from
April 6, 2026 09:43
93bef64 to
7fd5f77
Compare
- ensemble@1.2.38-beta.3
- ensemble@1.2.38-beta.4
- ensemble@1.2.38-beta.5
- ensemble@1.2.38-beta.6
- ensemble@1.2.38-beta.7
…inputs, and menus
The focus-state copy in view_util carries hasFocus onto a rebuilt
controller, but it is one-directional: when the rebuild produces a new
element whose FocusNode is not actually focused, nothing clears the
copied true and the ${id.hasFocus} binding stays true permanently.
Re-assert the controller against the live focus node in both TV focus
wrapper states (initState post-frame for inherited state, didUpdateWidget
on controller swap), deferring the ModelChangeEvent dispatch to post-frame.
Also scope the view_util copy to ids registered in the current scope so
an ancestor-scope hit with the same id (a collision, not the widget being
rebuilt) cannot transfer focus onto the rebuilt widget.
Fix/id focus state
feat(border): support decimal border widths and radii
feat(tab-bar): add overlay indicator option
…nctionality - Introduced TVTooltipPopover for displaying tooltips on TV devices, allowing for focusable content. - Implemented TVPopoverRegistry to manage open tooltip popovers and enable programmatic dismissal. - Enhanced EnsembleUtils with dismissPopover method to close the top-most tooltip. - Updated TooltipData to support new options for tooltip positioning, alignment, and animations. - Added tests for tooltip behavior, including focus management, dismissal, and content rendering.
…TV tooltip popover
…Popover - Updated EnsembleUtils to dismiss TV tooltips instead of popovers. - Renamed TooltipPopoverOptions to TooltipOptions and adjusted related code. - Introduced TVTooltip widget for TV-specific tooltip functionality. - Modified tests to reflect changes from popover to tooltip terminology and functionality. - Ensured tooltip animations and positioning are correctly handled in the new implementation.
Feat/popover tooltip
… add default trigger support
… scrolling behavior
… stretched layouts
Feat/tv header
Fixes/tabbar focus shifting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add D-pad focus navigation system for Android TV with coordinate-based
tvOptionsin YAML. All TV code gated behindDevice().isTVcheck.Key Changes
Core TV Framework
row,order,isRowEntryPoint)Widget Support
TVOptionsCompositewith focus stylingLayout Support
scrollbarOptions) with fallback (direct) focus when the list has no focusable itemsdelegateHorizontalNavigation,interceptHorizontalNavtabWidgetsupport, plusfocusIndicatorColor/focusTabColor/tvRowTheme Integration
Tokens.TV.*for focus stylingisTVgetter for Android TV detectionFocus Styling Properties under
tvOptionsrow,order,isRowEntryPoint,rememberRowPosition,focusGroup,edges,focusBorderColor,focusBorderWidth,focusBorderRadius,scale,elevation,opacityExample
Developer docs
Comprehensive developer guide:
modules/ensemble/doc/tv_developer_guide.mdNon-TV Changes (this branch)
Cross-platform changes not behind the TV flag:
New properties:
allowRedirectto block HTTP redirects (newRedirectBlockingHttpClient, redirect-keyed cache)indicatorLeadingWidget/indicatorTrailingWidgetautofocus+${widget.hasFocus}getterscalelayout knob, opt-in tab borders (borderColor/borderWidth/selectedBorderColor/selectedBorderWidth),roundIndex/matchIndextemplate bindingsImprovements & fixes:
shouldRepaintreturns real conditions, crash guards (_scrollToSelectedTab,_onPageChanged), default match scope-name typomarch→matchtokensOverrides), controlleridpropagation, external-navigation themingDemo
Video: https://drive.google.com/file/d/1mZfg8hNFv9m0QkUy0S3P1C4Xkt287tfc/view?usp=sharing
To test the KPN Android TV app, download this APK and install on the Tv emulator or real device: https://dev.azure.com/kpn/_apis/resources/Containers/28001799/android_apk?itemPath=android_apk%2Fapp-kpnandroidtvstaging-release.apk