1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-07-04 02:53:31 +00:00
Commit Graph

2516 Commits

Author SHA1 Message Date
evermind
48c2c156cb convert PlayerHolder to Singleton, handle context within, bugfix ServiceConnection leak
- bugfix: have ServiceConnection created only once!

- select the context within the PlayerHolder to start, stop, bind or unbind the service
  -> we have to make sure the Service is started AND stopped within the same context
  -> so let PlayerHolder be the one to select the context

- remove removeListener() and replace the call with setListener(null)
- Compatibility: use ContextCompat.startForegroundService instead of startService()
2021-07-06 12:31:26 +02:00
evermind
435813355f use viewBinding correctly 2021-07-06 07:56:05 +02:00
evermind
e30a552b6c remove duplicated code for toggle Fullscreen 2021-07-06 07:56:00 +02:00
evermind
22a4a4b2df move null checks for player and playerService to helper methods
- code is easier to read
- duplication of code reduced
2021-07-06 07:55:52 +02:00
evermind
aaa3e20c5a service.onDestroy() should only be called from the system and not manually
instead use service.stopService() which inturn calls stopSelf() and
triggers hopefully onDestroy() to be called. Eventually we have to make
sure that all ServiceConnections are closed to successfully stop the service
now!

Cleanup within stopService() and not only onDestroy()

So we make sure that all listeners can react to onServiceStopped()
and close their ServiceConnections. Afterwards the android framework
is ready to stop the Service.
2021-06-24 10:15:07 +02:00
bopol
0da8e28651
Merge pull request #6558 from Douile/fix/searchfragment-null-service
Fix null pointer exception when displaying SearchFragment
2021-06-24 09:16:00 +02:00
bopol
25cf8dc20a Refactoring by Android Studio 2021-06-23 14:30:01 +02:00
Douile
384ca66205
#6522: Fix null pointer exception when displaying SearchFragment
It seems due to #6394 updating the FragmentX library there was a
change to the order of lifecycle calls, as such onResume() was no longer
before onCreateOptionsMenu() creating a null pointer exception when
using service in onCreateOptionsMenu() as it is only set in onResume().

By moving the initialization of service to onStart() which still happens
before onCreateOptionsMenu() this crash can be avoided. This commit also
adds a check for a null service to prevent future crashes for similar
issues.
2021-06-22 16:52:02 +01:00
Mohammed Anas
62b4f333bb
Don't enable SAF on Fire TV (#6516) 2021-06-20 19:01:06 +00:00
TacoTheDank
79deff3261 Annotate some overridden methods and parameters as NonNull 2021-06-19 18:37:02 -04:00
Stypox
74ad488f4a
Merge pull request #6394 from TacoTheDank/androidx-fragment-134
Update AndroidX Fragment to 1.3.4
2021-06-18 13:14:30 +02:00
Tobi
be676ad93c
Merge pull request #3371 from mauriciocolli/feed-hide-played-items
Add ability to hide played items in a feed
2021-06-18 09:18:48 +02:00
Robin
0803d9f2b5
Merge pull request #6504 from evermind-zz/fixes-choice-dialog
dismiss choice dialog in onStop() to avoid a leaked window Exception:
2021-06-17 21:17:35 +02:00
Stypox
841fb4cfc5
Merge pull request #6495 from danielmbutler/Replace-System.exit-calls
Replace the System.exit calls with getActivity.finishAffinity()
2021-06-17 21:07:48 +02:00
danielmbutler
90de75968d Replaced System.Exit calls with FinishAffinity and Start Activity calls
Implemented "RestartApp" method defined in NavigationHelper.java.
 This method is used in ExitActivity.java and ContentSettingsFragment.java
2021-06-17 17:18:15 +01:00
evermind
a9ab2f54ea dismiss choice dialog in onStop() to avoid a leaked window Exception:
E/WindowManager: android.view.WindowLeaked: Activity org.schabi.newpipe.RouterActivity has leaked window DecorView@d99fe3b[] that was originally added here
        at android.view.ViewRootImpl.<init>(ViewRootImpl.java:418)
2021-06-17 06:53:47 +02:00
TacoTheDank
a1432e939f Fix onActivityResult deprecation in SubscriptionFragment 2021-06-15 22:09:19 -04:00
TacoTheDank
cae160b5be Fix onActivityResult deprecation in SubscriptionsImportFragment 2021-06-15 22:09:07 -04:00
TacoTheDank
aa4e5da146 Fix onActivityResult deprecation in ContentSettingsFragment 2021-06-15 22:08:55 -04:00
TacoTheDank
1061fca6a3 Add super.onRequestPermissionsResult where missing 2021-06-15 22:08:41 -04:00
TacoTheDank
e4885e3c52 Fix some older deprecations from previous Fragment versions 2021-06-15 22:08:25 -04:00
Stypox
d6e0bd8c26
Merge pull request #6059 from Dakkaron/manual-tablet-mode-setting
Adds manual tablet mode setting
2021-06-15 21:46:19 +02:00
Dakkaron
e01ef42d31
Adds manual tablet mode setting
Co-authored-by: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com>
2021-06-15 21:43:06 +02:00
Stypox
32df4d39a4
Reshow feed if grid/list view mode changed 2021-06-15 18:40:25 +02:00
Stypox
7145b117cc
Fix long press menu in feed 2021-06-14 19:02:57 +02:00
Stypox
4698d07323
Do not hide feed buttons (show/hide & help) behind three-dots menu 2021-06-14 19:02:57 +02:00
Stypox
2142f05a88
Fix hiding finished streams in groups; new stream state validity condition
Consider stream state valid also if >1/4 of video was watched
2021-06-14 19:01:01 +02:00
TiA4f8R
4eef498d24
Only call addClickListenersOnTimestamps if relatedInfo is instance of StreamInfo 2021-06-11 14:08:08 +02:00
TiA4f8R
32b0bdb98c
Fix the compile error 2021-06-11 12:19:29 +02:00
Stypox
edfe0f9c30
Fix disposables handling for text linkifier
also use differently Markwon methods to convert plain text to markdown
2021-06-11 12:12:12 +02:00
Stypox
eef418a757
Improve text linkifier function parameters 2021-06-11 12:12:11 +02:00
TiA4f8R
218f25c171
Annotate params and methods with NonNull 2021-06-11 12:12:10 +02:00
TiA4f8R
f02df6d80c
Fix an error and add a new method in the ShareUtils class
Fix the error due to the rebase on the dev branch of this branch
Add a shareText method in the ShareUtils class which has 3 parameters and calls
the original shareText method with an empty string for the
imagePreviewUrl param.
2021-06-11 12:12:09 +02:00
TiA4f8R
da4d379b22
Initial work: use disposables for timestamps parsing in YouTube video descriptions and YouTube comments 2021-06-11 12:12:08 +02:00
TiA4f8R
f13f4cc5d2
Split handleUrl method into two methods
Split handleURL method, now private, into two methods:
handleUrlCommentsTimestamp and handleUrlDescriptionTimestamp. Code is
now more proper.
2021-06-11 12:12:07 +02:00
TiA4f8R
a79badd783
Adress requested changes and try some cleanup in handleUrl method of InternalUrlsHandler class 2021-06-11 12:12:06 +02:00
TiA4f8R
2702700d10
Don't use a chooser for other intents than opening a content in a browser or sharing a content to other apps
Use an ACTION_CHOOSER intent has a negative impact for user experience, because user cannot set as default an activity for an intent
2021-06-11 12:12:05 +02:00
TiA4f8R
267686fd37
Initial work: add support for opening hashtags in plain text descriptions
This commit adds supports for opening hashtags in plain text descriptions, using the same logic as timestamps.
Every hashtag opens a search on the current service with the text in the hashtag.
Also use a better regular expression for parsing timestamps.
2021-06-11 12:12:04 +02:00
TiA4f8R
e5df2f65b8
Move some classes to a new subpackage and adress requested changes
Rename URLHandler and KoreUtil classes to InternalUrlsHandler and KoreUtils.
Move InternalUrlsHandler, KoreUtils, TextLinkfier, ShareUtils classes to external_communication subpackage.
Remove unused param showPreviewText in shareText method of ShareUtils class.
Add initial work to be able to display an image preview of the content shared (not for downloads).
Use a better regular expression to parse timestamps in plain text descriptions.
2021-06-11 12:12:03 +02:00
TiA4f8R
d6decc05d7
Move some classes to a new subpackage and adress requested changes
Rename URLHandler and KoreUtil classes to InternalUrlsHandler and KoreUtils.
Move InternalUrlsHandler, KoreUtils, TextLinkfier, ShareUtils classes to external_communication subpackage.
Remove unused param showPreviewText in shareText method of ShareUtils class.
Add initial work to be able to display an image preview of the content shared (not for downloads).
Use a better regular expression to parse timestamps in plain text descriptions.
2021-06-11 12:12:02 +02:00
TiA4f8R
d85afd6435
Initial work to add the image of the content in the share sheet
Also do some fixes when sharing a file in downloads and some improvements in JavaDocs of ShareUtils class.
2021-06-11 12:12:00 +02:00
TiA4f8R
2fb86364ab
Fix title of the subject when sharing an URL 2021-06-11 12:11:59 +02:00
TiA4f8R
c972940338
Apply suggested changes and fix some warnings 2021-06-11 12:11:58 +02:00
TiA4f8R
6abdd2a6d8
Try to change message of the system chooser for the update notification
This commit tries to change the title of the system chooser shown, which is from Android System ("Open links with"), when no defaut browser is present, for the update notification.
2021-06-11 12:11:57 +02:00
TiA4f8R
9e9d1a04e4
Fix toast shown when falling back to Google Play Store URL and the action of Open with Kodi button in the player
Add a boolean param, showToast, in ShareUtils.openIntentInApp and only show toast "No app on your device can open this" if this boolean is true.
Fix the action of play with Kodi button by applying the fix provided in #5599 (adding the flag Intent.FLAG_ACTIVITY_NEW_TASK to the intent in NavigationHelper.playWithKore method).
Do also some cleanup in viewWithFileProvider and shareFile methods of MissionAdapter class.
2021-06-11 12:11:56 +02:00
TiA4f8R
ae9349e36c
Initial work: add support for opening timestamps in plain text descriptions
This commit adds support for opening plain text timestamps by parsing the description text using a regular expression, add a click listener for each timestamp which opens the popup player at the indicated time in the timestamp.
In order to do this, playOnPopup method of the URLHandler class. Also, handleUrl method of this class has been renamed to canHandleUrl.
2021-06-11 12:11:55 +02:00
TiA4f8R
4031777606
Open recognized timestamps in the description of contents in the popup player
This commit adds support of opening recognized timestamps in the popup
player instead of starting an intent which opens the YouTube website with
the video timestamp.
2021-06-11 12:11:44 +02:00
Stypox
06d10cf9aa
Merge pull request #6313 from Isira-Seneviratne/Update_Room_to_2.3.0
Update Room to 2.3.0.
2021-06-09 16:28:55 +02:00
Stypox
0113ad5e14
Correctly save stream progress at the end of a video 2021-06-09 15:53:51 +02:00
Stypox
e58feadba9
Remove IN HISTORY label on stream info items 2021-06-09 15:53:51 +02:00