Don't break navigation if player Views other than controls are focused
This commit is contained in:
parent
6bfd0bc144
commit
4cfeff6cbd
1 changed files with 7 additions and 0 deletions
|
|
@ -234,6 +234,13 @@ public final class MainVideoPlayer extends AppCompatActivity
|
||||||
case KeyEvent.KEYCODE_DPAD_DOWN:
|
case KeyEvent.KEYCODE_DPAD_DOWN:
|
||||||
case KeyEvent.KEYCODE_DPAD_RIGHT:
|
case KeyEvent.KEYCODE_DPAD_RIGHT:
|
||||||
case KeyEvent.KEYCODE_DPAD_CENTER:
|
case KeyEvent.KEYCODE_DPAD_CENTER:
|
||||||
|
View playerRoot = playerImpl.getRootView();
|
||||||
|
View controls = playerImpl.getControlsRoot();
|
||||||
|
if (playerRoot.hasFocus() && !controls.hasFocus()) {
|
||||||
|
// do not interfere with focus in playlist etc.
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
if (playerImpl.getCurrentState() == BasePlayer.STATE_BLOCKED) {
|
if (playerImpl.getCurrentState() == BasePlayer.STATE_BLOCKED) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue