Repository navigation
Add Android TV support and launcher banner - #10268
Open
AmakerGame wants to merge 1 commit into
Open
AmakerGame wants to merge 1 commit into
AmakerGame wants to merge 1 commit into
Conversation
Add Leanback launcher support and TV banners, detect TV devices, keep content within the safe area, restore D-pad focus, and handle missing document pickers without crashing.
This branch has not been deployed
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
Make the app installable and usable on Android TV: add a launcher
banner and the leanback launcher entry, and fix several places where
D-pad / remote use was broken or crashed.
Changes
Launcher & manifest
LEANBACK_LAUNCHERintent filter toMainActivity, so the appshows up on the Android TV home screen.
android.hardware.touchscreenandandroid.software.leanbackas
required="false". The app stays installable on phones/tablets.ic_banner.png, mdpi to xxhdpi) and setit as
android:banneron the application andMainActivity.TV detection
Info.isTv(UI mode TV,FEATURE_LEANBACK, or no touchscreen).Focus handling
first D-pad press isn't swallowed.
tab. Previously the focused content left composition and focus was
lost.
FocusRequesterper nav item (reusing the existing Modulesand Superuser ones).
File picker crash
ActivityResultContracts.GetContentthrewActivityNotFoundException.Add
launchSafely()and use it inModuleScreenandInstallDialog.It shows the existing
app_not_foundtoast and resetspendingSubmitAfterPickinstead of crashing or waiting forever.Overscan
Modifier.tvSafeArea()(48dp x 27dp, ~5%), applied inMainActivity. No-op on non-TV devices.Notes
app_not_foundis reused.limited to what the system offers (e.g. a third-party file manager).
validity. Please build with
./build.py appand try on an Android TVdevice or emulator, with a remote and with a phone for regression.