Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/src/main/java/org/schabi/newpipe/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public class MainActivity extends AppCompatActivity {
private static final int ITEM_ID_BOOKMARKS = -3;
private static final int ITEM_ID_DOWNLOADS = -4;
private static final int ITEM_ID_HISTORY = -5;
private static final int ITEM_ID_PLAY_QUEUE = -6;
private static final int ITEM_ID_SETTINGS = 0;
private static final int ITEM_ID_ABOUT = 1;

Expand Down Expand Up @@ -249,6 +250,10 @@ private void addDrawerMenuForCurrentService() throws ExtractionException {
drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history)
.setIcon(R.drawable.ic_history);
drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_PLAY_QUEUE, ORDER,
R.string.title_activity_play_queue)
.setIcon(R.drawable.ic_play_queue);

//Settings and About
drawerLayoutBinding.navigation.getMenu()
Expand Down Expand Up @@ -309,6 +314,9 @@ private void tabSelected(final MenuItem item) throws ExtractionException {
case ITEM_ID_HISTORY:
NavigationHelper.openStatisticFragment(getSupportFragmentManager());
break;
case ITEM_ID_PLAY_QUEUE:
NavigationHelper.openPlayQueue(this);
break;
default:
final int currentServiceId = ServiceHelper.getSelectedServiceId(this);
final StreamingService service = NewPipe.getService(currentServiceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ public void onServiceConnected(final ComponentName name, final IBinder service)
if (player == null || player.getPlayQueue() == null
|| player.getPlayQueueAdapter() == null || player.exoPlayerIsNull()) {
unbind();
finish();
} else {
buildComponents();
if (player != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,11 @@ public static void openDownloads(final Activity activity) {
}
}

public static void openPlayQueue(final Context context) {
final Intent intent = new Intent(context, PlayQueueActivity.class);
context.startActivity(intent);
}

public static Intent getPlayQueueActivityIntent(final Context context) {
final Intent intent = new Intent(context, PlayQueueActivity.class);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/res/drawable/ic_play_queue.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000000"
android:pathData="M2.223,4.8474L4.7722,4.8474L11.1453,12 4.7722,19.1526L2.223,19.1526L8.5961,12Z" />
<path
android:fillColor="#000000"
android:pathData="m7.5388,4.8474l2.5492,0L16.4612,12 10.0881,19.1526L7.5388,19.1526L13.9119,12Z" />
<path
android:fillColor="#000000"
android:pathData="m12.8547,4.8474l2.5492,0L21.777,12 15.4039,19.1526L12.8547,19.1526L19.2278,12Z" />
</vector>