Skip to content

Commit

Permalink
restore background player original behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
ShareASmile committed Dec 27, 2023
1 parent cca41d9 commit 334281c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
3 changes: 0 additions & 3 deletions app/src/main/java/org/schabi/newpipelegacy/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,6 @@ private void showTabs() throws ExtractionException {
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_history));
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_BG_PLAYER, ORDER, R.string.background_player)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_play_arrow));

//Settings and About
drawerItems.getMenu()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.schabi.newpipelegacy.player;

import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import org.schabi.newpipelegacy.R;
Expand All @@ -12,7 +12,6 @@
public final class BackgroundPlayerActivity extends ServicePlayerActivity {

private static final String TAG = "BackgroundPlayerActivity";
private static final boolean DEBUG = BasePlayer.DEBUG;

@Override
public String getTag() {
Expand Down Expand Up @@ -73,19 +72,8 @@ public Intent getPlayerShutdownIntent() {
return new Intent(ACTION_CLOSE);
}

@Override
protected void onDestroy() {
super.onDestroy();
if (DEBUG) {
Log.d(TAG, "destroy() called");
}
/*
* Not until we are sure the application main window is actually closed
* For further ref:
* https://developer.android.com/reference/android/
* app/activityManager.RunningAppProcessInfo
*
* getApplicationContext().sendBroadcast(getPlayerShutdownIntent());
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
return super.onCreateOptionsMenu(menu);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,8 @@ public static void playOnPopupPlayer(final Context context,
public static void playOnBackgroundPlayer(final Context context,
final PlayQueue queue,
final boolean resumePlayback) {
//Toast.makeText(context, R.string.background_player_playing_toast, Toast.LENGTH_SHORT)
// .show();
final Intent playerIntent
= getPlayerIntent(context, BackgroundPlayerActivity.class, queue, resumePlayback);
playerIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(playerIntent);

Toast.makeText(context, R.string.background_player_playing_toast, Toast.LENGTH_SHORT)
.show();
startService(context,
getPlayerIntent(context, BackgroundPlayer.class, queue, resumePlayback));
}
Expand Down

0 comments on commit 334281c

Please sign in to comment.