-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix event handlers for DPad arrows on Android TV #21143
Fix event handlers for DPad arrows on Android TV #21143
Conversation
Thanks for this :) I tried to fix this myself a while ago but for some reason I couldn't get my RN changes to reflect in my app... Was going to try again but there you've already done it! With this change it will be possible to manually navigate lists and items (as the built-in touchable navigation behavior is kind of broken), so thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me, but I would keep using the MapBuilder and we can avoid the static block. What do you think?
KeyEvent.KEYCODE_MEDIA_FAST_FORWARD, | ||
"fastForward" | ||
); | ||
private static final Map<Integer, String> KEY_EVENTS_ACTIONS = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can keep using MapBuilder here:
private static final Map<Integer, String> KEY_EVENTS_ACTIONS = MapBuilder.of()
.put(KeyEvent.KEYCODE_DPAD_CENTER, "select")
....
.build();
@mdvacca Updated. Note that I had to use an explicit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mdvacca has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@krzysztofciombor merged commit 4d71b15 into Once this commit is added to a release, you will see the corresponding version tag below the description at 4d71b15. If the commit has a single |
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. --> Fixes #20924 DPad arrow events were missing from `KEY_EVENTS_ACTIONS` which meant that they were not broadcasted by `TVEventHandler`. Pull Request resolved: #21143 Differential Revision: D10007851 Pulled By: mdvacca fbshipit-source-id: 9a03cad249a4a1917975d1de10b6112e69d32a72
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. --> Fixes facebook#20924 DPad arrow events were missing from `KEY_EVENTS_ACTIONS` which meant that they were not broadcasted by `TVEventHandler`. Pull Request resolved: facebook#21143 Differential Revision: D10007851 Pulled By: mdvacca fbshipit-source-id: 9a03cad249a4a1917975d1de10b6112e69d32a72
Fixes #20924
DPad arrow events were missing from
KEY_EVENTS_ACTIONS
which meant that they were not broadcasted byTVEventHandler
.Test Plan:
DPad arrow events are correctly send to JS and are received by
TVEventHandler
All other events ("select", "playPause", etc.) are still sent correctly
Navigating between selectable components still works correctly
Release Notes:
[ANDROID] [BUGFIX] [AndroidTV] - Fixed missing DPad arrow event handlers