Added ability to navigate songs by moving left and right on the dpad
when play controls are focused. Preference to come later.
This commit is contained in:
parent
df570d507c
commit
a2d8710ae8
@ -245,6 +245,28 @@ public class FullPlaybackActivity extends PlaybackActivity implements SeekBar.On
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean onKeyDown(int keyCode, KeyEvent event)
|
||||||
|
{
|
||||||
|
switch (keyCode) {
|
||||||
|
case KeyEvent.KEYCODE_DPAD_RIGHT: {
|
||||||
|
View button = findViewById(R.id.next);
|
||||||
|
if (button != null)
|
||||||
|
button.requestFocus();
|
||||||
|
mHandler.sendMessage(mHandler.obtainMessage(PlaybackActivity.MSG_SET_SONG, 1, 0));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case KeyEvent.KEYCODE_DPAD_LEFT: {
|
||||||
|
View button = findViewById(R.id.previous);
|
||||||
|
if (button != null)
|
||||||
|
button.requestFocus();
|
||||||
|
mHandler.sendMessage(mHandler.obtainMessage(PlaybackActivity.MSG_SET_SONG, -1, 0));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyUp(int keyCode, KeyEvent event)
|
public boolean onKeyUp(int keyCode, KeyEvent event)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user