Merge pull request #4888 from ByteHamster/fix-extended-widget-actions
Fix extended widget buttons
This commit is contained in:
commit
86bf6a50f3
|
@ -107,7 +107,6 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
|
||||||
RemoteViews views;
|
RemoteViews views;
|
||||||
views = new RemoteViews(getPackageName(), R.layout.player_widget);
|
views = new RemoteViews(getPackageName(), R.layout.player_widget);
|
||||||
|
|
||||||
boolean nothingPlaying = false;
|
|
||||||
Playable media;
|
Playable media;
|
||||||
PlayerStatus status;
|
PlayerStatus status;
|
||||||
if (playbackService != null) {
|
if (playbackService != null) {
|
||||||
|
@ -169,11 +168,13 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
|
||||||
createMediaButtonIntent(KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE));
|
createMediaButtonIntent(KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE));
|
||||||
views.setOnClickPendingIntent(R.id.butPlayExtended,
|
views.setOnClickPendingIntent(R.id.butPlayExtended,
|
||||||
createMediaButtonIntent(KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE));
|
createMediaButtonIntent(KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE));
|
||||||
|
views.setOnClickPendingIntent(R.id.butRew,
|
||||||
|
createMediaButtonIntent(KeyEvent.KEYCODE_MEDIA_REWIND));
|
||||||
|
views.setOnClickPendingIntent(R.id.butFastForward,
|
||||||
|
createMediaButtonIntent(KeyEvent.KEYCODE_MEDIA_FAST_FORWARD));
|
||||||
|
views.setOnClickPendingIntent(R.id.butSkip,
|
||||||
|
createMediaButtonIntent(KeyEvent.KEYCODE_MEDIA_NEXT));
|
||||||
} else {
|
} else {
|
||||||
nothingPlaying = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nothingPlaying) {
|
|
||||||
// start the app if they click anything
|
// start the app if they click anything
|
||||||
views.setOnClickPendingIntent(R.id.layout_left, startMediaPlayer);
|
views.setOnClickPendingIntent(R.id.layout_left, startMediaPlayer);
|
||||||
views.setOnClickPendingIntent(R.id.butPlay, startMediaPlayer);
|
views.setOnClickPendingIntent(R.id.butPlay, startMediaPlayer);
|
||||||
|
|
Loading…
Reference in New Issue