mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
autohide part 2 fuck android tv
This commit is contained in:
parent
dba8e7e70a
commit
ef91102daf
1 changed files with 26 additions and 24 deletions
|
@ -1073,30 +1073,6 @@ class PlayerFragment : Fragment() {
|
||||||
|
|
||||||
private fun handleKeyEvent(event: KeyEvent): Boolean {
|
private fun handleKeyEvent(event: KeyEvent): Boolean {
|
||||||
event.keyCode.let { keyCode ->
|
event.keyCode.let { keyCode ->
|
||||||
when (keyCode) {
|
|
||||||
// don't allow dpad move when hidden
|
|
||||||
KeyEvent.KEYCODE_DPAD_LEFT,
|
|
||||||
KeyEvent.KEYCODE_DPAD_DOWN,
|
|
||||||
KeyEvent.KEYCODE_DPAD_UP,
|
|
||||||
KeyEvent.KEYCODE_DPAD_RIGHT,
|
|
||||||
KeyEvent.KEYCODE_DPAD_DOWN_LEFT,
|
|
||||||
KeyEvent.KEYCODE_DPAD_DOWN_RIGHT,
|
|
||||||
KeyEvent.KEYCODE_DPAD_UP_LEFT,
|
|
||||||
KeyEvent.KEYCODE_DPAD_UP_RIGHT -> {
|
|
||||||
if (!isShowing) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// netflix capture back and hide ~monke
|
|
||||||
KeyEvent.KEYCODE_BACK -> {
|
|
||||||
if (isShowing) {
|
|
||||||
onClickChange()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
when (event.action) {
|
when (event.action) {
|
||||||
KeyEvent.ACTION_DOWN -> {
|
KeyEvent.ACTION_DOWN -> {
|
||||||
when (keyCode) {
|
when (keyCode) {
|
||||||
|
@ -1116,6 +1092,32 @@ class PlayerFragment : Fragment() {
|
||||||
//)
|
//)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
when (keyCode) {
|
||||||
|
// don't allow dpad move when hidden
|
||||||
|
KeyEvent.KEYCODE_DPAD_LEFT,
|
||||||
|
KeyEvent.KEYCODE_DPAD_DOWN,
|
||||||
|
KeyEvent.KEYCODE_DPAD_UP,
|
||||||
|
KeyEvent.KEYCODE_DPAD_RIGHT,
|
||||||
|
KeyEvent.KEYCODE_DPAD_DOWN_LEFT,
|
||||||
|
KeyEvent.KEYCODE_DPAD_DOWN_RIGHT,
|
||||||
|
KeyEvent.KEYCODE_DPAD_UP_LEFT,
|
||||||
|
KeyEvent.KEYCODE_DPAD_UP_RIGHT -> {
|
||||||
|
if (!isShowing) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
autoHide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// netflix capture back and hide ~monke
|
||||||
|
KeyEvent.KEYCODE_BACK -> {
|
||||||
|
if (isShowing) {
|
||||||
|
onClickChange()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue