Add Already playing in background toast
This commit is contained in:
parent
19dd9d266a
commit
989bcbf895
2 changed files with 10 additions and 3 deletions
|
@ -168,10 +168,16 @@ public final class NavigationHelper {
|
||||||
public static void playOnBackgroundPlayer(final Context context,
|
public static void playOnBackgroundPlayer(final Context context,
|
||||||
final PlayQueue queue,
|
final PlayQueue queue,
|
||||||
final boolean resumePlayback) {
|
final boolean resumePlayback) {
|
||||||
if (PlayerHolder.getInstance().getType() != MainPlayer.PlayerType.AUDIO) {
|
final int toastText;
|
||||||
Toast.makeText(context, R.string.background_player_playing_toast, Toast.LENGTH_SHORT)
|
if (PlayerHolder.getInstance().getType() == MainPlayer.PlayerType.AUDIO) {
|
||||||
.show();
|
toastText = R.string.background_player_already_playing_toast;
|
||||||
|
} else {
|
||||||
|
toastText = R.string.background_player_playing_toast;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Toast.makeText(context, toastText, Toast.LENGTH_SHORT)
|
||||||
|
.show();
|
||||||
|
|
||||||
final Intent intent = getPlayerIntent(context, MainPlayer.class, queue, resumePlayback);
|
final Intent intent = getPlayerIntent(context, MainPlayer.class, queue, resumePlayback);
|
||||||
intent.putExtra(Player.PLAYER_TYPE, MainPlayer.PlayerType.AUDIO.ordinal());
|
intent.putExtra(Player.PLAYER_TYPE, MainPlayer.PlayerType.AUDIO.ordinal());
|
||||||
ContextCompat.startForegroundService(context, intent);
|
ContextCompat.startForegroundService(context, intent);
|
||||||
|
|
|
@ -147,6 +147,7 @@
|
||||||
<string name="settings_category_updates_title">Updates</string>
|
<string name="settings_category_updates_title">Updates</string>
|
||||||
<string name="settings_category_notification_title">Notification</string>
|
<string name="settings_category_notification_title">Notification</string>
|
||||||
<string name="background_player_playing_toast">Playing in background</string>
|
<string name="background_player_playing_toast">Playing in background</string>
|
||||||
|
<string name="background_player_already_playing_toast">Already playing in background</string>
|
||||||
<string name="popup_playing_toast">Playing in popup mode</string>
|
<string name="popup_playing_toast">Playing in popup mode</string>
|
||||||
<string name="content">Content</string>
|
<string name="content">Content</string>
|
||||||
<string name="show_age_restricted_content_title">Show age restricted content</string>
|
<string name="show_age_restricted_content_title">Show age restricted content</string>
|
||||||
|
|
Loading…
Reference in a new issue