1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-25 12:32:31 +01:00

Simplified toast showing behavior

after feedback from the review
This commit is contained in:
litetex 2022-01-23 15:33:59 +01:00
parent 49b1649348
commit e127db6fa6

View File

@ -157,9 +157,8 @@ public final class NavigationHelper {
return; return;
} }
if (PlayerHolder.getInstance().getType() != PlayerType.POPUP) { Toast.makeText(context, R.string.popup_playing_toast, Toast.LENGTH_SHORT).show();
Toast.makeText(context, R.string.popup_playing_toast, 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.POPUP.ordinal()); intent.putExtra(Player.PLAYER_TYPE, MainPlayer.PlayerType.POPUP.ordinal());
ContextCompat.startForegroundService(context, intent); ContextCompat.startForegroundService(context, intent);
@ -168,10 +167,9 @@ 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) { Toast.makeText(context, R.string.background_player_playing_toast, Toast.LENGTH_SHORT)
Toast.makeText(context, R.string.background_player_playing_toast, Toast.LENGTH_SHORT) .show();
.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);