Commit cae708d
committed
Android Auto: Add shuffle and play button for the playlist
Background:
- While testing the Android Auto app, I missed having a quick way to shuffle and play the playlist.
- This adds support to shuffle and play the playlist directly from the Android Auto app.
Changes:
- Added a "Shuffle and play" button as the first item in the playlist view.
- The button is only displayed for non-empty playlists to prevent confusion.
PlayQueue refactor:
- Refactored the `PlayQueue.shuffle()` method to support different shuffling modes
- Add optional `shuffleAll` parameter to `PlayQueue.shuffle()` method with default value false
- When shuffleAll=false (default): preserves currently playing item at the head of the queue (existing behavior)
- When shuffleAll=true: shuffles all items without preserving the current item position
- Update documentation to clearly explain both modes of operation1 parent 6e0b7be commit cae708d
7 files changed
Lines changed: 87 additions & 10 deletions
File tree
- app/src/main
- java/org/schabi/newpipe/player
- mediabrowser
- playqueue
- res
- drawable
- values
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1298 | 1298 | | |
1299 | 1299 | | |
1300 | 1300 | | |
1301 | | - | |
| 1301 | + | |
1302 | 1302 | | |
1303 | 1303 | | |
1304 | 1304 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
260 | 285 | | |
261 | 286 | | |
262 | 287 | | |
| |||
301 | 326 | | |
302 | 327 | | |
303 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
304 | 338 | | |
305 | 339 | | |
306 | 340 | | |
| |||
346 | 380 | | |
347 | 381 | | |
348 | 382 | | |
349 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
350 | 387 | | |
351 | 388 | | |
352 | 389 | | |
| |||
356 | 393 | | |
357 | 394 | | |
358 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
359 | 399 | | |
360 | 400 | | |
361 | | - | |
| 401 | + | |
362 | 402 | | |
363 | 403 | | |
364 | 404 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
141 | 152 | | |
142 | 153 | | |
143 | 154 | | |
| |||
184 | 195 | | |
185 | 196 | | |
186 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
187 | 202 | | |
188 | 203 | | |
189 | 204 | | |
| |||
Lines changed: 16 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
403 | | - | |
404 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
405 | 406 | | |
406 | | - | |
| 407 | + | |
| 408 | + | |
407 | 409 | | |
| 410 | + | |
| 411 | + | |
408 | 412 | | |
409 | 413 | | |
410 | 414 | | |
411 | 415 | | |
412 | | - | |
| 416 | + | |
413 | 417 | | |
414 | 418 | | |
415 | 419 | | |
| |||
421 | 425 | | |
422 | 426 | | |
423 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
424 | 433 | | |
425 | | - | |
| 434 | + | |
426 | 435 | | |
427 | 436 | | |
428 | 437 | | |
429 | 438 | | |
430 | | - | |
| 439 | + | |
431 | 440 | | |
432 | 441 | | |
433 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| 669 | + | |
669 | 670 | | |
670 | 671 | | |
671 | 672 | | |
| |||
0 commit comments