Commit graph

9591 commits

Author SHA1 Message Date
Stypox
c224821487 Fix surface view not resizing video correctly
Also fix yet another random null pointer exception that could happen when adding the video player view
2022-08-26 18:54:51 +02:00
litetex
cac64a9964 Fixed sonar detected problems
+ Automatically fixed code style (imports)
2022-08-25 17:02:53 +02:00
Stypox
624292abe4 Review suggestions 2022-08-25 17:02:53 +02:00
Stypox
ce1b88eeec Keep strong reference to Picasso thumbnail loading target
Before the Target would sometimes be garbage collected before being called with the loaded thumbnail, since Picasso holds weak references to targets
2022-08-25 17:02:52 +02:00
Stypox
573b4ff8bc Merge MediaSessionManager into MediaSessionPlayerUi 2022-08-25 17:02:52 +02:00
Stypox
c8066c6eb7 Let exoplayer decide when to update metadata
Though still make sure metadata is updated after the thumbnail is loaded.
This fixes the wrong seekbar properties (duration and current position) being shown in the notification sometimes.
2022-08-25 17:02:52 +02:00
Stypox
a4c5d1ee3b Remove useless checks before updating metadata
A while ago NewPipe called the metadata update function very often, so checks were needed to ensure not wasting time updating metadata if it were already up to date. Now, instead, the metadata update function is called exactly when needed, i.e. when metadata changes, so such checks are not needed anymore (and were probably also a little resource-heavy).
2022-08-25 17:02:51 +02:00
Stypox
1a4e886d4b Even when thumbnails should not be shown, set it to null in notification
This makes sure the thumbnail is removed from the notification if the user disables thumbnails
2022-08-25 17:02:51 +02:00
Stypox
9fe370cda1 Fix sometimes seeing outdated thumbnail in notification
Before the thumbnail finishes loading for the new video the player is now playing, the old thumbnail was being used, leading to wrong thumbnails set in the media session and the notification.
2022-08-25 17:02:51 +02:00
Stypox
356fa3f12d Fix thumbnail sometimes not set to media session metadata
The thumbnail was not being updated in the media session metadata after it was loaded, since there was no metadata update in that case, only a notification update.
2022-08-25 17:00:41 +02:00
Stypox
97892be897 Remove useless MediaSessionCallback
The player is now passed directly, it made no sense to wrap around it in a callback that was not really a callback but rather, actually, a wrapper.
2022-08-25 17:00:41 +02:00
Stypox
aa0a1cd70e Create MediaSessionPlayerUi 2022-08-25 17:00:41 +02:00
Stypox
9bfea8082c Keep strong references to Picasso notification icon loading targets
Before the Target would sometimes be garbage collected before being called with the loaded channel icon, since Picasso holds weak references to targets. This meant that sometimes a new streams notification  would not be shown, because the lambda that should have shown it had already been garbage collected.
2022-08-25 16:41:51 +02:00
Isira Seneviratne
77f19bd26f Use ListAdapter in PreferenceSearchAdapter. 2022-08-18 19:52:51 +05:30
Isira Seneviratne
91d4bded3d Use ListAdapter in SuggestionListAdapter. 2022-08-18 19:52:51 +05:30
Isira Seneviratne
158ef0d444 Calculate search score using streams.
Co-authored-by: Stypox <stypox@pm.me>
2022-08-15 07:26:56 +05:30
Isira Seneviratne
aa6b1bc67b Remove from playlist only upon selecting the option and not afterwards. 2022-08-15 07:26:36 +05:30
Isira Seneviratne
ed6bd30481 Refactor removeWatchedStreams() in LocalPlaylistFragment. 2022-08-15 07:26:36 +05:30
Isira Seneviratne
6b3bdb04ce Use ListAdapter in PeertubeInstanceListFragment. 2022-08-15 07:26:02 +05:30
Isira Seneviratne
38aaa7163b Use Okio's ByteString. 2022-08-13 08:27:55 +05:30
Stypox
327ee1bc5a Merge pull request #8666 from TacoTheDank/filepicker
Update FilePicker to our custom fork and disable Jetifier
2022-08-12 09:15:34 +02:00
Isira Seneviratne
2e350c9675 Use range-limiting methods in more places. 2022-08-08 07:10:16 +05:30
Stypox
647f099b30 Merge pull request #8740 from Isira-Seneviratne/Cleanup_methods
Remove some unused methods.
2022-08-06 22:45:40 +02:00
Stypox
5bc82ad0f9 Merge pull request #8738 from Isira-Seneviratne/Collectors_joining
Use Collectors.joining().
2022-08-06 22:31:31 +02:00
Stypox
05a8939e7e Merge pull request #8728 from Isira-Seneviratne/Comparator_factory
Use Comparator factory methods.
2022-08-06 11:56:44 +02:00
Stypox
43fd5a75bf Improve comment 2022-08-06 11:56:00 +02:00
Stypox
2fac881694 Merge pull request #8724 from Isira-Seneviratne/toArray_improvements
Use toArray() with zero-length arrays.
2022-08-06 11:33:05 +02:00
Stypox
735b050c4e Merge pull request #8737 from Isira-Seneviratne/Fix_coerceIn
Replace coerceIn() with MathUtils.clamp().
2022-08-06 11:16:06 +02:00
Stypox
1a32c35951 Merge pull request #8708 from Isira-Seneviratne/Reduce_View.kt_size
Reduce View.kt size.
2022-08-06 10:59:10 +02:00
Isira Seneviratne
fa9cd7f6e3 Remove unused method. 2022-08-06 06:54:21 +05:30
Isira Seneviratne
1e0abb2f80 Use Collectors.joining(). 2022-08-06 06:54:21 +05:30
Isira Seneviratne
cf52c320fc Remove unused methods in HistoryRecordManager. 2022-08-06 05:09:54 +05:30
Isira Seneviratne
fbf3df2c60 Applied code review changes. 2022-08-05 06:54:03 +05:30
Isira Seneviratne
b49b8f325d Use toArray() with zero-length arrays. 2022-08-05 06:50:55 +05:30
Isira Seneviratne
177dffdcbd Replace coerceIn() with MathUtils.clamp(). 2022-08-05 06:19:06 +05:30
Isira Seneviratne
d96850a6a9 Add reusable classes extending AnimatorListenerAdapter. 2022-08-05 06:08:13 +05:30
Isira Seneviratne
dd19d2a5fb Use Comparator.comparingDouble(). 2022-08-05 05:36:39 +05:30
Isira Seneviratne
cc49540c95 Use Comparator factory methods in ListHelper. 2022-08-05 05:36:21 +05:30
Stypox
4ed7229861 Merge pull request #8721 from Isira-Seneviratne/OnClickGesture_interface
Make OnClickGesture an interface.
2022-08-04 16:15:54 +02:00
Stypox
c745d74030 Merge pull request #8682 from Isira-Seneviratne/Refactor_LicenseFragmentHelper
Refactor LicenseFragmentHelper.
2022-08-04 11:18:40 +02:00
Isira Seneviratne
29d0bf1de7 Clean up getLicenseStylesheet(). 2022-08-04 11:17:30 +02:00
Stypox
d84b7c55d8 Merge pull request #8669 from Isira-Seneviratne/Remove_setBottomSheetCallback
Remove uses of setBottomSheetCallback().
2022-08-04 11:03:57 +02:00
Stypox
682bc2f453 Improve FeedGroupDialogViewModel factory 2022-08-04 10:49:33 +02:00
Stypox
4cfc1765f7 Merge pull request #8656 from Isira-Seneviratne/Use_WindowMetrics
Use WindowMetrics API.
2022-08-04 10:12:32 +02:00
Isira Seneviratne
12f042bfd5 Merge branch 'dev' into OnClickGesture_interface 2022-08-04 06:10:39 +05:30
Stypox
bf106612e8 Merge pull request #8709 from Isira-Seneviratne/Tags_case_insensitive
Sort tags case-insensitively.
2022-08-03 22:43:50 +02:00
Stypox
26efa61349 Merge pull request #8701 from Isira-Seneviratne/Use_stackTraceToString
Use Throwable.stackTraceToString().
2022-08-03 21:04:22 +02:00
Stypox
b7f7a87596 Merge pull request #8661 from Stypox/player-refactor-npe
Fix random NullPointerException when adding video player view
2022-08-02 11:09:50 +02:00
Stypox
f7a2c3ff9c Merge pull request #8692 from TacoTheDank/bumpMaterial
Update Google Material to 1.6.1
2022-08-02 11:05:24 +02:00
Stypox
2bb269b46d Merge branch 'dev' into bumpFragment 2022-08-02 10:54:39 +02:00