-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Add support for Android TV devices #16500
Changes from 44 commits
0e40e4f
6dc6bb5
8a71318
7788de1
29eb058
bf86743
2eac232
b961f2d
51df826
d8c0f64
4a75d81
5e7a6cd
c4218f6
a5a7b3b
beb738f
ac9d584
318218f
2c37223
4aeca35
9e04243
1a68b10
8ea9950
db8cf86
ee5455f
c763506
fb628ab
083c1b4
6b2a82c
a7397bf
9404bff
baaaf5a
4e4d603
a41b70d
acf321d
d2177d5
a087d05
5dc25ab
3b709d2
5897b0e
0894fdb
d6b1231
61ff2ce
8fc9b65
dcb6ef7
1eccd4f
3c4a8eb
15bf287
e79041a
9a6be6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,6 +127,14 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { | |
} | ||
} | ||
|
||
public boolean onKeyDown(int keyCode, KeyEvent event) { | ||
if (keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD) { | ||
event.startTracking(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we only do this when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm, this check is currently done in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add it in both, we don't need to |
||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
public boolean onKeyUp(int keyCode, KeyEvent event) { | ||
if (getReactNativeHost().hasInstance() && getReactNativeHost().getUseDeveloperSupport()) { | ||
if (keyCode == KeyEvent.KEYCODE_MENU) { | ||
|
@@ -143,6 +151,16 @@ public boolean onKeyUp(int keyCode, KeyEvent event) { | |
return false; | ||
} | ||
|
||
public boolean onKeyLongPress(int keyCode, KeyEvent event) { | ||
if (getReactNativeHost().hasInstance() | ||
&& getReactNativeHost().getUseDeveloperSupport() | ||
&& keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD) { | ||
getReactNativeHost().getReactInstanceManager().showDevOptionsDialog(); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
public boolean onBackPressed() { | ||
if (getReactNativeHost().hasInstance()) { | ||
getReactNativeHost().getReactInstanceManager().onBackPressed(); | ||
|
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.
Can we add a comment to isTVOS describing that it is deprecated and it will be replaced by isTV().
Also can you move its implementation to isTV(), that way it is easier to deprecate in the future