Commit Graph

112 Commits

Author SHA1 Message Date
Yingwei Zheng 1cf670dad9 Fix inconsistency between user interaction and database commit order when re-adding videos to the playlist 2023-10-02 02:56:30 +02:00
Siddhesh Naik e80b6b3057
Add playlist name and video name to playlist sharing content (#10427)
- Currently, only a list of videos separated by newline are added in
  the share content.
- This makes it difficult to identify a specific video in a list of
  Urls.
- Used string resources for the sharing content formats.
- Added a confirmation dialog for users to choose between sharing
  playlist formats.
- Added Playlist name as the header and corresponding video name for
  each video url in following format.

Playlist
- Music1: https://media-url1
- Music2: https://media-url2
- Music3: https://media-url3


Co-authored-by: TobiGr <tobigr@users.noreply.github.com>
2023-09-26 11:11:33 +02:00
TobiGr 109d06b4bb
Deduplicate code to initialize ClickListeners on playlist controls
Add the separate utility class PlayButtonHelper to handle the initialization of the listeners.
The ClickListeners on playlist controls had different behaviours. This commit fixes that.

The commit also refactors the way how the app determines whether it is started for the first time. The previous version was not clean and recent in this PR caused it to fail.
2023-09-18 23:22:32 +02:00
TacoTheDank c1f0a945c0 Clean up AlertDialogs 2023-07-11 21:54:10 -04:00
Stypox 23a20712da
Merge pull request #9707 from Jared234/1473_remove_duplicates_from_playlist
Remove duplicates from playlist feature
2023-02-28 22:14:01 +01:00
Stypox 43f46e29ad
Update app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java 2023-02-28 21:40:11 +01:00
Stypox 7617f8cdc7
Update app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java 2023-02-28 21:35:57 +01:00
Jared Fantaye 265de55a07 Merge remote-tracking branch 'origin/1473_remove_duplicates_from_playlist' into 1473_remove_duplicates_from_playlist 2023-02-28 16:44:13 +01:00
Jared Fantaye d8ed2c8503 Refactoring removeDuplicates function and preventing concurrent calls. 2023-02-28 16:43:58 +01:00
Jared Fantaye 68ea99d6e6 Made some small code improvements 2023-02-09 23:17:36 +01:00
Jared234 42fb13f17a
Merge branch 'dev' into 1473_remove_duplicates_from_playlist 2023-02-09 20:47:10 +01:00
Jared Fantaye 68097568d5 Fixed the bug by replacing the thumbnail_url with the thumbnail_stream_id 2023-02-05 20:32:34 +01:00
Jared Fantaye e26c038565 Made some small adjustments 2023-01-20 11:55:50 +01:00
Jared Fantaye 135fc08212 Implemented the "remove duplicates" feature. 2023-01-13 21:35:22 +01:00
Jared Fantaye 38c4a1ed85
Fixed the "Remove Watched" bug
Reverted changes and fixed bug in a different way
2023-01-12 23:44:26 +01:00
Jared Fantaye eb3363d4dd Created the first draft. 2023-01-10 20:55:18 +01:00
Jared Fantaye 1ac62541a8 Formatting, renaming and small fixes 2022-12-09 12:01:59 +01:00
Jared Fantaye 10a5741f36 Tried to implement the feature 2022-12-07 02:32:53 +01:00
Jared Fantaye 8fc5fa979d Added menu with tappable list items 2022-12-03 09:52:04 +01:00
Stypox 25795c3a96
Merge pull request #8706 from Isira-Seneviratne/Improve_LocalPlaylistFragment
Refactor removeWatchedStreams() in LocalPlaylistFragment.
2022-10-30 22:03:39 +01:00
Jfax510 0d73d193ad
Added Toast Notification "Hold to enqueue" (#9196)
* Added Toast Notification "Hold to enqueue"

* Check if enqueue tips are enabled

* created function showHoldToAppendTipIfNeeded() for toast message
2022-10-26 11:35:03 +02:00
Isira Seneviratne 6399e39507 Remove from playlist only upon selecting the option and not afterwards. 2022-08-15 07:26:36 +05:30
Isira Seneviratne f9443f7421 Refactor removeWatchedStreams() in LocalPlaylistFragment. 2022-08-15 07:26:36 +05:30
Isira Seneviratne 47f58040d1 Make OnClickGesture an interface. 2022-08-01 06:47:00 +05:30
litetex 8b209df253 Changed the code accordingly
+ Removed some unused code
2022-07-15 19:55:19 +02:00
litetex b7a44560f5
Merge pull request #8170 from Stypox/player-refactor
Refactor player and extract UI components
2022-07-15 19:41:23 +02:00
Stypox 6ea85e6380
Rename dummy_* and more to placeholder_* 2022-07-14 14:27:33 +02:00
Stypox 8187a3bc04
Move PlayerType into its own class and add documentation
Also replace some `isPlayerOpen` with direct `playerType == null` checks.
2022-07-13 23:33:18 +02:00
Stypox 76ced59b62
Refactor player: separate UIs and more 2022-07-13 23:25:26 +02:00
Carlos Melero d0b6d95f1b
Add Share option to local playlists
A newline-separated text is shared
2022-07-13 14:32:23 +02:00
Stypox 59d8c570b7
Readd spaces 2022-05-05 18:04:33 +02:00
LingYinTianMeng c2762d3b5e
Update LocalPlaylistFragment.java 2022-05-03 09:37:35 +08:00
LingYinTianMeng 50739277c4
Update LocalPlaylistFragment.java 2022-05-03 09:21:43 +08:00
LingYinTianMeng 8ea98b64aa fix issue #7563 2022-04-17 22:23:03 +08:00
Stypox 5f16e4ef87
Replace R.string.yes with R.string.ok
Android doesn't use yes/no but ok/cancel usually, so this should be done here, too
2022-03-02 12:21:25 +01:00
TobiGr 277f21d5b2 Move Classes related to InfoItemDIalog into own package 2022-02-20 20:17:04 +01:00
TobiGr fd0d76e866 Apply feedback
Return this in InfoIrtemDialog.Builder methoods.
Move null checks for InfoIrtemDialog.Builder into constructor.
Fix and add some more docs.
2022-02-20 20:17:04 +01:00
TobiGr 646d8f431c Use identical method names for creating the InfoItemDialog in Fragments 2022-02-20 20:17:04 +01:00
TobiGr 962fe9c36d Use Context instead of Activity
Improve docs
2022-02-20 20:17:04 +01:00
TobiGr 50e2385e82 Add default entries automatically 2022-02-20 20:17:04 +01:00
TobiGr 1cd3ef5dba Extract entries into beginning and end category 2022-02-20 20:17:04 +01:00
TobiGr 80157fc1be Refactor generating InfoItemDialog's
This commit refactors the way `InfoItemDialog`s are generated. This is necessary because the old way used  the `StreamDialogEntry` enum for most of the dialogs' content generation process. This required static variables and methods to store the entries which are used for the dialog to be build (See e.g.`enabledEntries` and methods like `generateCommands()`). In other words, `StreamDialogEntry` wasn't an enumeration anymore.

To address this issue, a `Builder` is introduced for the `InfoItemDialog`'s genration. The builder also comes with some default entries and and a specific order. Both can be used, but are not enforced. 

A second problem that introduced a structure which was atypical for an enumeration was the usage of non-final attributes within `StreamDialogEntry` instances. These were needed, because the default actions needed to overriden in some cases.

To address this problem, the `StreamDialogEntry` enumeration was renamed to `StreamDialogDefaultEntry` and a new `StreamDialogEntry` class is used instead.
2022-02-20 20:17:04 +01:00
Stypox 71c5aaa11e
Do not show enqueue button if play queue not ready 2022-01-27 17:11:16 +01:00
Stypox 9e44053e22
Merge pull request #7160 from nschulzke/mark-as-watched-everywhere
Enable Mark as Watched in all the other playlist fragments.
2021-11-13 20:37:59 +01:00
Nathan Schulzke dee32c3dc5 Factor out shouldAddMarkAsWatched as a shared function 2021-11-13 10:18:17 -07:00
TacoTheDank b6b19b474e Update RecyclerView & Groupie 2021-10-19 17:31:59 -04:00
Nathan Schulzke 108af48b76 Enable Mark as Watched in all the other playlist fragments. 2021-09-23 21:39:47 -06:00
z3r0r4 70354eb73e
Add play next to long press menu & refactor enqueue methods (#6872)
* added mvp play next button in long press menu; new intent handling, new long press dialog entry, new dialog functions, new strings

* changed line length for checkstyle pass

* cleaned comments, moved strings

* Update app/src/main/res/values/strings.xml

to make long press entry more descriptive

Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com>

* Update app/src/main/res/values/strings.xml

Co-authored-by: Stypox <stypox@pm.me>

* replace redundant nextOnVideoPlayer methods

Co-authored-by: Stypox <stypox@pm.me>

* add enqueueNextOnPlayer and enqueueOnPlayer without selectOnAppend and RESUME_PLAYBACK/ deprecate enqueueNextOn*Player and enqueueOn*Player methods
add getPlayerIntent, getPlayerEnqueueIntent and getPlayerEnqueueNextIntent without selectOnAppend and RESUME_PLAYBACK/ deprecate those with
add section comments

* removed deprecated methods
removed redundant methods

* removed deprecated methods
removed redundant methods

* replaced APPEND_ONLY, removed SELECT_ON_APPEND / replaced remaining enqueueOn*Player methods

* now works with playlists

* renamed dialog entry

* checking for >1 items in the queue using the PlayerHolder

* making enqueue*OnPlayer safe to call when no video is playing (defaulting to audio)

* corrected strings

* improve getQueueSize in PlayerHolder

* long press to enqueue only if queue isnt empty

* add Whitespace

Co-authored-by: Stypox <stypox@pm.me>

* clarify comments / add spaces

* PlayerType as parameter of the enqueueOnPlayer method
add Helper method

* using the helper function everywhere (except for the background and popup long-press actions (also on playlists, history, ...)), so basically nowhere
/ passing checkstyle

* assimilated the enqueue*OnPlayer methods

* removed redundant comment, variable

* simplify code line

Co-authored-by: Stypox <stypox@pm.me>

* move if

* replace workaround for isPlayerOpen()

Co-authored-by: Stypox <stypox@pm.me>

* replaced workarounds (getType), corrected static access with getInstance

* remove unused imports

* changed method call to original, new method doesnt exist yet.

* Use getter method instead of property access syntax.

* improve conditional for play next entry

Co-authored-by: Stypox <stypox@pm.me>

* show play next btn in feed fragment

Co-authored-by: Stypox <stypox@pm.me>

* add play next to local playlist and statistics fragment

Co-authored-by: Stypox <stypox@pm.me>

* formating

Co-authored-by: Stypox <stypox@pm.me>

* correcting logic

Co-authored-by: Stypox <stypox@pm.me>

* remove 2 year old unused string, formating

Co-authored-by: Stypox <stypox@pm.me>

* correct enqueue (next) conditionals, default to background if no player is open. Dont generally default to background play.

* remove player open checks from button long press enqueue actions

* improve log msg

* Rename next to enqueue_next

* Refactor kotlin

Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com>
Co-authored-by: Stypox <stypox@pm.me>
2021-09-18 11:22:49 +02:00
ktprograms 76803bfcb1 Save channelUrl to Database if it doesn't exist 2021-08-13 18:02:53 +08:00
TacoTheDank 50f3b08c59 Consolidate edittext alert dialogs into one layout 2021-07-27 13:31:58 -04:00