mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Less ifs when handling volume key
This commit is contained in:
parent
459b31d897
commit
dc17fe30c1
1 changed files with 5 additions and 12 deletions
|
@ -741,18 +741,11 @@ public abstract class Reading extends NbActivity implements OnPageChangeListener
|
|||
}
|
||||
|
||||
private void processVolumeKeyNavigationEvent(int keyCode) {
|
||||
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
|
||||
if (volumeKeyNavigation == VolumeKeyNavigation.DOWN_NEXT) {
|
||||
overlayRight(overlayRight);
|
||||
} else {
|
||||
overlayLeft(overlayLeft);
|
||||
}
|
||||
} else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
|
||||
if (volumeKeyNavigation == VolumeKeyNavigation.UP_NEXT) {
|
||||
overlayRight(overlayRight);
|
||||
} else {
|
||||
overlayLeft(overlayLeft);
|
||||
}
|
||||
if ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN && volumeKeyNavigation == VolumeKeyNavigation.DOWN_NEXT) ||
|
||||
(keyCode == KeyEvent.KEYCODE_VOLUME_UP && volumeKeyNavigation == VolumeKeyNavigation.UP_NEXT)) {
|
||||
overlayRight(overlayRight);
|
||||
} else {
|
||||
overlayLeft(overlayLeft);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue