Commit Graph

39 Commits

Author SHA1 Message Date
TobiGr bc4f0c699f Ignore false positive inspection 2023-08-02 20:44:30 +02:00
Jared Fantaye 5b3f8a3d30 Replaced the equals method 2023-01-21 14:56:55 +01:00
Jared Fantaye ddda80a577 Fixed the bug 2023-01-17 22:31:22 +01:00
Isira Seneviratne 8b400b48f7 Refactor notifying method in PlayQueue. 2022-07-21 08:02:23 +05:30
Isira Seneviratne ca26fcb0eb Use List.of(). 2022-07-20 04:39:11 +05:30
Avently 01e0dd50ad Added serviceId check while comparing PlayQueues 2022-02-23 00:53:39 +03:00
Avently 835c5e9d43 Better equals check
It ensures that queues are not the same. Without this check when you have multiple videos in the backstack and navigating back via Back button you'll get duplicated videos
2022-02-19 22:12:31 +03:00
litetex ecac897e7b
Fixed typo 2021-11-03 17:30:30 +01:00
litetex af936bc646 Always create a backup list when shuffling
The backup-list has to be created at all cost (even when current list size <= 2). Otherwise it's not possible to enter shuffle-mode (as ``isShuffled()`` always returns false)!
2021-10-23 17:35:42 +02:00
Zhiheng Xu 2e161a1f45 Change shuffle() guard to check for size <= 2
After testing the app, I realized that shuffling a queue with size 2
does nothing
2021-05-24 12:20:19 -04:00
Zhiheng Xu 5ab6e84044 Remove redundant clearing of list 2021-05-24 12:20:19 -04:00
Zhiheng Xu e1a6347c4e Refactor shuffle and update documentation
- Add early return for invalid sizes to shuffle

 - Rename variables to be more descriptive

 - Refactor moving list element, removing unnecessary operations

 - Unwrap if clause for adding to history because the condition is
   guaranteed by the guard clause

 - Inline the value 0 for the ReorderEvent

 - Update documentation to reflect new changes
2021-05-24 12:20:19 -04:00
Eric Xu 92a67bb8cb Rearrange fields
Final fields should be arranged first
2021-05-24 12:20:19 -04:00
Eric Xu e8eeac6735 Resolve TODO in indexOf(...)
PlayQueueItem overrides equals and hashCode, so using indexOf is
perfectly fine.
2021-05-24 12:20:19 -04:00
Eric Xu 775fbc9a75 Rewrite setIndex(int) to pass unit tests
Original did not cover the case of when streams is empty and
documentation does not specify any input restrictions.

There's an ambiguity with broadcasting an event between the
documentation and the actual code (see TODO).
2021-05-24 12:20:19 -04:00
Eric Xu 8efe2859b8 Refactor assignments to field declaration
Assignments that don't require the constructor can be moved out.
2021-05-24 12:20:19 -04:00
Eric Xu 441c68ead2 Add hashCode() to match equals(other) 2021-05-24 12:20:19 -04:00
Eric Xu 4cd1f201f5 Refactor streams to initialize with values 2021-05-24 12:20:19 -04:00
Eric Xu 013c59f904 Refactor ArrayList fields to List 2021-05-24 12:20:19 -04:00
Eric Xu 57474e2dab Refactor and optimize equals
- Remove multiple casts of obj

 - Simply use object equals on the streams because PlayQueueItem’s
   equals already compares urls
2021-05-24 12:20:19 -04:00
TiA4f8R 79e98db3bd
Apply the requested changes and little improvements
Apply the requested changes, use ShareUtils.shareText to share an stream in the play queue and optimize imports for Java files, using Android Studio functionality.

Apply the requested changes and do little improvements
Apply the requested changes, use ShareUtils.shareText to share an stream in the play queue and optimize imports for Java files, using Android Studio functionality.
2021-01-16 13:23:42 +01:00
Stypox f0ca916432
Update most dependencies 2020-11-22 14:03:10 +01:00
Stypox 1d42e45d78
Unify all ways of opening VideoDetailFragment 2020-11-08 10:00:27 +01:00
Stypox e406b6f780
Fix NullPointerException in queue handling 2020-10-26 18:15:59 +01:00
TobiGr c66c81294e Remove unused and redundant code. 2020-09-01 17:39:06 +02:00
Avently d8f7db4715 Made checkStyle happy 2020-07-14 20:21:32 +03:00
Avently d2aaa6f691 Merged the latest changes 2020-07-13 04:17:21 +03:00
Avently b2164ce5fc Marked many (too many) variables as final 2020-07-12 03:59:47 +03:00
Stypox b3db8c9549
Do not remove items generating errors form queue 2020-05-31 14:06:22 +02:00
wb9688 63bcc04eff Move things back to its original place 2020-04-02 15:57:50 +02:00
wb9688 fda5405e48 Improve code style to be more consistent 2020-04-02 15:57:50 +02:00
Avently f334a2740f Mini player, ExpandableSurfaceView with ZOOM support, popup
- mini player's title, image and author information will be updated in many situations but the main idea is that the info will be the same as currently playing stream. If nothing played then you'll see the info about currently opened stream in fragment. When MainPlayer service stops the info updates too
- made ExpandableSurfaceView to replace AspectRatioFrameLayout. The reason for that is to make possible to use aspect ratio mode ZOOM. It's impossible to show a stream inside AspectRatioFrameLayout with ZOOM mode and to fit the video view to a screen space at the same time. Now the new view able to do that and to show vertical videos in a slightly wide space for them
- refactored some methods to make the code more understandable
- made fixes for player view for landscape-to-landscape orientation change
- added Java docs
- adapted swipe tracking inside bottom sheet
- fixed PlayQueue crashes on clearing
- paddings for popup player now as small as possible
2020-02-05 08:59:30 +03:00
Avently a2d5314cf7 Fourth block of fixes for review
- wrote more methods to PlayQueue. Now it supports internal history of played items with ability to play previous() item. Also it has equals() to check whether queues has the same content or not
- backstack in fragment is more powerful now with help of PlayQueue's history and able to work great with playlists' PlayQueue and SinglePlayQueue at the same time
- simplified logic inside fragment. Easy to understand. New PlayQueue will be added in backstack from only one place; less number of setInitialData() calls
- BasePlayer now able to check PlayQueue and compare it with currently playing. And if it is the same queue it tries to not init() it twice. It gives possibility to have a great backstack in fragment since the same queue will not be played from two different instances and will not be added to backstack twice  with duplicated history inside
- better support of Player.STATE_IDLE
- worked with layouts of player and made them better and more universal
- service will be stopped when activity finishes by a user decision
- fixed a problem related to ChannelPlayQueue and PlaylistPlayQueue in initial start of fragment
- fixed crash in popup
2020-01-06 13:39:01 +03:00
Robin bf2a3ca043 Migrate to AndroidX 2019-10-04 14:59:08 +02:00
shivanju 5bbb0cd666 issue:1336 Remove auto queued stream if a new stream gets appended 2018-11-24 17:35:17 +05:30
shivanju 47c3da131c issue:1336 Fix for inserting new streams when auto queuing is enabled 2018-11-11 16:24:49 +05:30
Christian Schabesberger 2003f51d49 fix thumbnail not shown in background player 2018-08-27 16:37:21 +02:00
Christian Schabesberger a099fe35d2 reorder playqueue/localPlaylist classes 2018-04-29 12:51:57 +02:00
Christian Schabesberger bcfd8a2450 rename playlist to player.playqueue 2018-04-29 12:49:52 +02:00