Show replay icon in notification when player state is completed
This commit is contained in:
parent
814efbf8df
commit
b4e073cde7
6 changed files with 10 additions and 13 deletions
|
@ -257,18 +257,6 @@ public final class NotificationUtil {
|
||||||
R.string.exo_controls_fastforward_description, ACTION_FAST_FORWARD);
|
R.string.exo_controls_fastforward_description, ACTION_FAST_FORWARD);
|
||||||
}
|
}
|
||||||
|
|
||||||
case NotificationConstants.PLAY_PAUSE:
|
|
||||||
if (player.isPlaying()
|
|
||||||
|| player.getCurrentState() == BasePlayer.STATE_PREFLIGHT
|
|
||||||
|| player.getCurrentState() == BasePlayer.STATE_BLOCKED
|
|
||||||
|| player.getCurrentState() == BasePlayer.STATE_BUFFERING) {
|
|
||||||
return getAction(player, R.drawable.exo_notification_pause,
|
|
||||||
R.string.exo_controls_pause_description, ACTION_PLAY_PAUSE);
|
|
||||||
} else {
|
|
||||||
return getAction(player, R.drawable.exo_notification_play,
|
|
||||||
R.string.exo_controls_play_description, ACTION_PLAY_PAUSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
case NotificationConstants.PLAY_PAUSE_BUFFERING:
|
case NotificationConstants.PLAY_PAUSE_BUFFERING:
|
||||||
if (player.getCurrentState() == BasePlayer.STATE_PREFLIGHT
|
if (player.getCurrentState() == BasePlayer.STATE_PREFLIGHT
|
||||||
|| player.getCurrentState() == BasePlayer.STATE_BLOCKED
|
|| player.getCurrentState() == BasePlayer.STATE_BLOCKED
|
||||||
|
@ -277,7 +265,16 @@ public final class NotificationUtil {
|
||||||
return new NotificationCompat.Action(R.drawable.ic_hourglass_top_white_24dp_png,
|
return new NotificationCompat.Action(R.drawable.ic_hourglass_top_white_24dp_png,
|
||||||
player.context.getString(R.string.notification_action_buffering),
|
player.context.getString(R.string.notification_action_buffering),
|
||||||
null);
|
null);
|
||||||
} else if (player.isPlaying()) {
|
}
|
||||||
|
|
||||||
|
case NotificationConstants.PLAY_PAUSE:
|
||||||
|
if (player.getCurrentState() == BasePlayer.STATE_COMPLETED) {
|
||||||
|
return getAction(player, R.drawable.ic_replay_white_24dp_png,
|
||||||
|
R.string.exo_controls_pause_description, ACTION_PLAY_PAUSE);
|
||||||
|
} else if (player.isPlaying()
|
||||||
|
|| player.getCurrentState() == BasePlayer.STATE_PREFLIGHT
|
||||||
|
|| player.getCurrentState() == BasePlayer.STATE_BLOCKED
|
||||||
|
|| player.getCurrentState() == BasePlayer.STATE_BUFFERING) {
|
||||||
return getAction(player, R.drawable.exo_notification_pause,
|
return getAction(player, R.drawable.exo_notification_pause,
|
||||||
R.string.exo_controls_pause_description, ACTION_PLAY_PAUSE);
|
R.string.exo_controls_pause_description, ACTION_PLAY_PAUSE);
|
||||||
} else {
|
} else {
|
||||||
|
|
BIN
app/src/main/res/drawable-hdpi/ic_replay_white_24dp_png.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_replay_white_24dp_png.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 621 B |
BIN
app/src/main/res/drawable-mdpi/ic_replay_white_24dp_png.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_replay_white_24dp_png.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 411 B |
BIN
app/src/main/res/drawable-xhdpi/ic_replay_white_24dp_png.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_replay_white_24dp_png.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 837 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_replay_white_24dp_png.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_replay_white_24dp_png.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/ic_replay_white_24dp_png.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/ic_replay_white_24dp_png.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
Loading…
Reference in a new issue