Fix TV D-pad navigation in multi-select action mode toolbar#1550
Open
ihx-rainbow wants to merge 1 commit intozhanghai:masterfrom
Open
Fix TV D-pad navigation in multi-select action mode toolbar#1550ihx-rainbow wants to merge 1 commit intozhanghai:masterfrom
ihx-rainbow wants to merge 1 commit intozhanghai:masterfrom
Conversation
…vigation 修复:多选模式覆盖工具栏激活时阻止底层工具栏获取焦点,以修复 TV 遥控器导航问题
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.
Problem / 问题描述
On TV devices, when using the D-pad to navigate the multi-select action
mode toolbar, pressing Right from
action_cutdoes not move focus toaction_copy. Navigation between toolbar action buttons is broken.Root Cause / 根本原因
overlayToolbarand the regulartoolbarare stacked in the sameFrameLayout. When the overlay action mode is active, the regulartoolbaris only hidden visually (isVisible = false) but its childviews remain focusable.
FocusFindersearches all focusable views bygeometry and finds the regular toolbar's menu buttons (search, sort,
etc.), which overlap with the overlay toolbar's buttons and interrupt
the focus chain.
Fix / 修复方案
Pass the regular
toolbaras asiblingViewtoOverlayToolbarActionMode.When the overlay is shown, set
siblingView.descendantFocusabilitytoFOCUS_BLOCK_DESCENDANTSto exclude all its children from focus search.Restore it to
FOCUS_BEFORE_DESCENDANTSwhen the overlay is hidden.这个项目很不错,美观又好用,我装到 tv 设备上之后,只能用遥控器操作,发现往右选不到删除按钮,需要优化下。
我写后端的,前端不是很熟,这个 pr 可以不用 merge,希望作者可以帮忙改下发个版本十分感谢!