1
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-09-22 21:40:52 +02:00

Compare commits

..

321 Commits

Author SHA1 Message Date
Christian Schabesberger
7d4c45c4c0 Merge tag 'v0.11.6-beta'
v0.11.6-beta
2018-02-21 11:38:48 +01:00
Christian Schabesberger
f65f2da890 moved on to v0.11.6 2018-02-04 18:40:45 +01:00
Christian Schabesberger
30ab58c33d added some more lambdas 2018-02-04 17:50:22 +01:00
Christian Schabesberger
87ba5a7eb6 Merge branch 'eximport' into dev 2018-02-04 13:40:03 +01:00
Christian Schabesberger
6e8593af91 add import database function
bla

remove unused restart function

add allert dialog and add time to filename
2018-02-04 13:38:58 +01:00
Weblate
0ab1d3fc40 Merge remote-tracking branch 'origin/dev' into dev 2018-02-04 03:36:15 +01:00
ezjerry liao
f22d13e695 Translated using Weblate (Chinese (Traditional))
Currently translated at 83.5% (223 of 267 strings)
2018-02-04 03:36:07 +01:00
Mauricio Colli
cdde61a460 Change service icons for now
- Use place holders while the legal discussion is happening
2018-02-03 22:32:01 -02:00
Mauricio Colli
989ce126f1 Improve up button behavior
- Closes #614
2018-02-03 09:03:55 -02:00
ScratchBuild
28618e822e Translated using Weblate (Japanese)
Currently translated at 74.5% (199 of 267 strings)
2018-02-03 08:38:18 +01:00
Weblate
6772381afc Merge remote-tracking branch 'origin/dev' into dev 2018-01-31 13:34:27 +01:00
孟武尼德霍格龍
75b45beabc Translated using Weblate (Chinese (Traditional))
Currently translated at 77.2% (207 of 268 strings)
2018-01-31 13:34:24 +01:00
ButterflyOfFire
56d53e9b01 Translated using Weblate (Arabic)
Currently translated at 95.1% (255 of 268 strings)
2018-01-31 13:34:15 +01:00
Mauricio Colli
3a8b04e2d1 Fix and improve service switching (introduced colors)
- Every service now have its own colors
- Fix bug navigation button and backstack count
- Fix and themed properly the icons and colors of the main fragment tabs
- Re-organized the styles and colors (too much in one file)
2018-01-30 05:07:40 -02:00
Christian Schabesberger
1ce7d66fb1 Merge pull request #1043 from TobiGr/preferred-string
Make preferred string not translatable
2018-01-29 00:47:55 +01:00
TobiGr
7b5a9b69fe make preferred string not translatable 2018-01-28 21:27:20 +01:00
Allan Nordhøy
837b22ccac Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (268 of 268 strings)
2018-01-28 19:24:39 +01:00
Christian Schabesberger
7146719393 add export newipe db function 2018-01-28 19:02:34 +01:00
Weblate
71ee604c69 Merge remote-tracking branch 'origin/dev' into dev 2018-01-27 21:19:32 +01:00
Mateusz
9945a5b813 Translated using Weblate (Polish)
Currently translated at 98.1% (263 of 268 strings)
2018-01-27 21:19:31 +01:00
Kompiuterių meistras +37060040
7254387042 Translated using Weblate (Lithuanian)
Currently translated at 91.0% (244 of 268 strings)
2018-01-27 21:19:29 +01:00
Jonas
3a7f2a94a6 Translated using Weblate (French)
Currently translated at 100.0% (268 of 268 strings)
2018-01-27 21:19:26 +01:00
Mauricio Colli
6bea4aa96b Fix player switching
- Background to popup wasn't asking for permission
- The new task flag is needed to switch from the background/popup UI to the main player
2018-01-27 02:57:00 -02:00
Mauricio Colli
fa262bbceb Improve settings theme color
- Closes #863
2018-01-27 02:56:10 -02:00
Eduardo Caron
3139fe0170 Translated using Weblate (Portuguese (Brazil))
Currently translated at 98.8% (265 of 268 strings)
2018-01-25 22:39:19 +01:00
Freddy Morán Jr
ef6c5de65b Translated using Weblate (Spanish)
Currently translated at 100.0% (268 of 268 strings)
2018-01-25 19:40:22 +01:00
M1ck
07799563b5 Translated using Weblate (French)
Currently translated at 99.6% (267 of 268 strings)
2018-01-25 18:36:21 +01:00
Nathan Follens
b1de4b7bd6 Translated using Weblate (Dutch)
Currently translated at 100.0% (268 of 268 strings)
2018-01-25 18:16:29 +01:00
E T
2b8ae9a5ea Translated using Weblate (Turkish)
Currently translated at 99.6% (267 of 268 strings)
2018-01-25 14:42:33 +01:00
Georg Rieger
7c52d3ec5d Translated using Weblate (German)
Currently translated at 99.6% (267 of 268 strings)
2018-01-25 14:37:17 +01:00
Osoitz
aefaa7619e Translated using Weblate (Basque)
Currently translated at 99.6% (267 of 268 strings)
2018-01-25 14:34:34 +01:00
Emanuele Petriglia
ca202290bf Translated using Weblate (Italian)
Currently translated at 100.0% (268 of 268 strings)
2018-01-24 14:46:59 +01:00
Weblate
cbdbc4cba2 Merge remote-tracking branch 'origin/dev' into dev 2018-01-24 13:10:42 +01:00
M1ck
8abf904a78 Translated using Weblate (French)
Currently translated at 100.0% (252 of 252 strings)
2018-01-24 13:10:32 +01:00
Mauricio Colli
ecf7969c46 Improve settings up button behavior
- Fix #736
2018-01-23 11:45:41 -02:00
Mauricio Colli
a473e3d623 Add preferred player 2018-01-23 11:15:36 -02:00
Weblate
1f8e90858e Merge remote-tracking branch 'origin/dev' into dev 2018-01-23 12:17:34 +01:00
Osoitz
2c2edca8fa Translated using Weblate (Spanish)
Currently translated at 100.0% (252 of 252 strings)
2018-01-23 12:17:33 +01:00
Rubix
50e86ff1ca Translated using Weblate (Romanian)
Currently translated at 87.6% (221 of 252 strings)
2018-01-23 12:17:33 +01:00
Rintaro matsuo
02ecc5011a Translated using Weblate (Japanese)
Currently translated at 78.9% (199 of 252 strings)
2018-01-23 12:17:32 +01:00
nautilusx
6e666a018b Translated using Weblate (German)
Currently translated at 96.8% (244 of 252 strings)
2018-01-23 12:17:31 +01:00
M2ck
66fbb2ce1e Translated using Weblate (French)
Currently translated at 100.0% (252 of 252 strings)
2018-01-23 12:17:30 +01:00
r2308145
b00722ec0a Translated using Weblate (Czech)
Currently translated at 100.0% (252 of 252 strings)
2018-01-23 12:17:29 +01:00
ButterflyOfFire
77b1413319 Translated using Weblate (Arabic)
Currently translated at 100.0% (252 of 252 strings)
2018-01-23 12:17:29 +01:00
Osoitz
87b8d60c9d Translated using Weblate (Basque)
Currently translated at 100.0% (252 of 252 strings)
2018-01-23 12:17:26 +01:00
Christian Schabesberger
db5203e1ff Merge pull request #1023 from TobiGr/update-screenshots
Update screenshots
2018-01-23 00:27:28 +01:00
TobiGr
ea022670c4 Update screenshots 2018-01-22 21:04:27 +01:00
r2308145
54b009cc49 Translated using Weblate (Czech)
Currently translated at 100.0% (252 of 252 strings)
2018-01-22 19:09:37 +01:00
E T
80c3acace9 Translated using Weblate (Turkish)
Currently translated at 100.0% (252 of 252 strings)
2018-01-21 17:40:52 +01:00
Nathan Follens
cea9428b47 Translated using Weblate (Dutch)
Currently translated at 100.0% (252 of 252 strings)
2018-01-21 17:34:51 +01:00
Emanuele Petriglia
f8ffbfabbe Translated using Weblate (Italian)
Currently translated at 100.0% (252 of 252 strings)
2018-01-21 12:12:04 +01:00
Allan Nordhøy
836a1e652b Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (252 of 252 strings)
2018-01-20 23:27:15 +01:00
Freddy Morán Jr
d8544e0b84 Translated using Weblate (Spanish)
Currently translated at 100.0% (252 of 252 strings)
2018-01-20 23:06:06 +01:00
M2ck
4817d7fddc Translated using Weblate (French)
Currently translated at 100.0% (252 of 252 strings)
2018-01-20 23:00:00 +01:00
ButterflyOfFire
e6a385a85e Translated using Weblate (Arabic)
Currently translated at 100.0% (252 of 252 strings)
2018-01-20 21:34:50 +01:00
Weblate
3634f68364 Merge remote-tracking branch 'origin/dev' into dev 2018-01-20 21:31:01 +01:00
Freddy Morán Jr
f17ffa94fe Translated using Weblate (Spanish)
Currently translated at 100.0% (249 of 249 strings)
2018-01-20 21:31:00 +01:00
Coffeemaker
d52bcd46a1 Translated using Weblate (German)
Currently translated at 97.5% (243 of 249 strings)
2018-01-20 21:30:56 +01:00
ButterflyOfFire
7e58b0b6fe Translated using Weblate (Arabic)
Currently translated at 100.0% (249 of 249 strings)
2018-01-20 21:30:49 +01:00
Christian Schabesberger
f451f1f65d resolve conflict 2018-01-20 18:06:34 +01:00
Christian Schabesberger
4d12e71fba move on to v0.11.5 2018-01-20 16:00:39 +01:00
Christian Schabesberger
66fde7a212 fix loop in channel 2018-01-20 15:59:34 +01:00
Christian Schabesberger
86eccf219d refactore some more lambda functions 2018-01-20 15:24:45 +01:00
Christian Schabesberger
677865f347 player popup menu icons for white theme 2018-01-20 14:46:10 +01:00
Christian Schabesberger
eb4b3810e9 refactor ExtractionHelper using lambda expression 2018-01-20 13:57:31 +01:00
Christian Schabesberger
5f26501ddf fix triangle play button when returning to app 2018-01-20 13:39:06 +01:00
Emanuele Petriglia
b33a72f864 Translated using Weblate (Italian)
Currently translated at 100.0% (249 of 249 strings)
2018-01-19 20:07:50 +01:00
Freddy Morán Jr
675f43b968 Translated using Weblate (Spanish)
Currently translated at 100.0% (249 of 249 strings)
2018-01-19 01:24:52 +01:00
M2ck
9f117a2e59 Translated using Weblate (French)
Currently translated at 100.0% (249 of 249 strings)
2018-01-19 00:33:40 +01:00
Yann Hodiesne
a0844229a3 Translated using Weblate (French)
Currently translated at 97.9% (244 of 249 strings)
2018-01-19 00:23:06 +01:00
M2ck
114fcc144c Translated using Weblate (French)
Currently translated at 97.9% (244 of 249 strings)
2018-01-19 00:19:11 +01:00
Weblate
43372ff648 Merge remote-tracking branch 'origin/dev' into dev 2018-01-19 00:17:53 +01:00
ScratchBuild
b8ebbc5404 Translated using Weblate (Japanese)
Currently translated at 79.5% (194 of 244 strings)
2018-01-19 00:17:51 +01:00
M2ck
28309f82f3 Translated using Weblate (French)
Currently translated at 100.0% (244 of 244 strings)
2018-01-19 00:17:45 +01:00
Christian Schabesberger
c70fa391b6 fix conflict with weblate 2018-01-18 20:43:30 +01:00
nautilusx
caab589dce Translated using Weblate (German)
Currently translated at 99.5% (243 of 244 strings)
2018-01-18 08:18:08 +01:00
maruyuki
20370054e7 Translated using Weblate (Japanese)
Currently translated at 56.9% (139 of 244 strings)
2018-01-18 08:18:04 +01:00
anonymous
f1882cb1e1 Translated using Weblate (German)
Currently translated at 97.5% (238 of 244 strings)
2018-01-12 19:37:15 +01:00
Nick Undnick
2ed149852d Translated using Weblate (German)
Currently translated at 97.5% (238 of 244 strings)
2018-01-10 18:22:38 +01:00
Coffeemaker
ac7226a0df Translated using Weblate (German)
Currently translated at 97.5% (238 of 244 strings)
2018-01-10 18:22:00 +01:00
Coffeemaker
5705650ca8 Translated using Weblate (Telugu)
Currently translated at 53.6% (131 of 244 strings)
2018-01-09 17:53:16 +01:00
Coffeemaker
60855ca7c5 Translated using Weblate (Tamil)
Currently translated at 5.7% (14 of 244 strings)
2018-01-09 17:53:16 +01:00
Coffeemaker
b8d8d181f3 Translated using Weblate (Slovak)
Currently translated at 70.0% (171 of 244 strings)
2018-01-09 17:53:16 +01:00
Thomas Lavend'Homme
6309160fc6 Translated using Weblate (French)
Currently translated at 100.0% (244 of 244 strings)
2018-01-09 17:53:14 +01:00
ButterflyOfFire
fc0e6ed273 Translated using Weblate (Arabic)
Currently translated at 100.0% (244 of 244 strings)
2018-01-09 17:53:04 +01:00
Christian Schabesberger
ada0cee656 move on to v0.11.4 2018-01-09 14:11:37 +01:00
Christian Schabesberger
6dde524d2c Merge branch 'dev' of github.com:teamnewpipe/NewPipe into dev 2018-01-09 14:02:39 +01:00
Christian Schabesberger
6a631e1915 forece select activity when opening with browser 2018-01-09 14:02:32 +01:00
Christian Schabesberger
bb6fa343cf Merge pull request #976 from coffeemakr/feature-share-subject
Add subject to shared URL's (fixes #975)
2018-01-09 13:53:29 +01:00
Christian Schabesberger
7557acde6c Merge pull request #977 from TobiGr/TranslationChecker-Fix
Fix crash due to no "other" item in plurals
2018-01-09 13:51:14 +01:00
TobiGr
25ed8952f9 Fix crash due to no "other" item in plurals 2018-01-09 13:24:50 +01:00
Coffeemakr
b93d94b0bd Add subject to shared URL's (fixes #975) 2018-01-09 12:41:30 +01:00
Christian Schabesberger
33d75fd2fb switch languageCode to content country 2018-01-09 12:25:40 +01:00
Christian Schabesberger
28a9855fd2 add countrycodes 2018-01-09 11:33:17 +01:00
Christian Schabesberger
9aad07621c fix many/other problem 2018-01-09 10:28:28 +01:00
Christian Schabesberger
384cde6eaa fix weblate merge failure 2018-01-08 13:29:25 +01:00
Sebastian Rasmussen
5ae98661ad Translated using Weblate (Swedish)
Currently translated at 100.0% (244 of 244 strings)
2018-01-08 13:21:19 +01:00
Alberto Moshpirit
8f4d9ceca9 Translated using Weblate (Spanish)
Currently translated at 100.0% (244 of 244 strings)
2018-01-08 13:21:15 +01:00
Christian Schabesberger
83d9a1233e horrible hack for fixing channel load next page foo 2018-01-06 20:39:33 +01:00
thami simo
522a287d79 Translated using Weblate (Arabic)
Currently translated at 96.3% (235 of 244 strings)
2018-01-06 17:21:06 +01:00
Sebastian Rasmussen
e052d4660d Translated using Weblate (Swedish)
Currently translated at 100.0% (244 of 244 strings)
2018-01-06 17:21:03 +01:00
John Zhen Mo
39b0b2f032 -Added player conversion to background and popup players.
-[#919] Fixed custom notification does not trigger unlocking on lockscreen.
-[#947] Fixes player crashing on internet outage, issue partially addressed.
-Fixed main player losing state after destroy while in background.
-Fixed main player controls not hiding automatically after orientation change.
-Fixed dialog uploader not marqueeing when too long.
-Fixed popup permission throwing NPE on BaseList.
-Refactored popup permissions to start in NavigationHelper.
-Extracted hardcoded string for player menus.
-Bump Java version to 1.8.
-Some lambda conversions.
2018-01-03 22:53:38 -08:00
Christian Schabesberger
0223d6d200 moved on to v0.11.3 2018-01-04 05:34:19 +01:00
Christian Schabesberger
808ce72078 fix share menu for playlists 2018-01-04 05:28:01 +01:00
Christian Schabesberger
3a84c47176 hopefully fix plurals 2018-01-04 04:56:45 +01:00
Weblate
20c2426128 Merge remote-tracking branch 'origin/dev' into dev 2017-12-30 19:06:47 +01:00
Phạm Nguyễn Hoàng
bf11d4c9fa Translated using Weblate (Vietnamese)
Currently translated at 59.0% (144 of 244 strings)
2017-12-30 19:06:47 +01:00
Matej U
783c0f79d7 Translated using Weblate (Slovenian)
Currently translated at 91.8% (224 of 244 strings)
2017-12-30 19:06:46 +01:00
Ivan Krušlin
98b94bd9c4 Translated using Weblate (Croatian)
Currently translated at 97.1% (237 of 244 strings)
2017-12-30 19:06:44 +01:00
Rex_sa
ff0178f965 Translated using Weblate (Arabic)
Currently translated at 91.8% (224 of 244 strings)
2017-12-30 19:06:41 +01:00
Schabi
7f88c3d0a9 roleback wrong fix 2017-12-30 00:27:29 +01:00
Schabi
11e8e38f2c setup context for making notifications open via setContextIntent() 2017-12-29 17:29:15 +01:00
Schabi
50c5314eaf fix yt trending content language 2017-12-29 15:02:23 +01:00
Schabi
a7a76d4f58 add beta 2 logo 2017-12-26 14:48:06 +01:00
Schabi
4df4f68fe1 Merge branch 'dev' 2017-12-24 12:17:55 +01:00
Schabi
7db8d37137 update extractor and move on to version v0.11.2 2017-12-24 12:17:41 +01:00
Christian Schabesberger
b7503a7d81 Merge pull request #936 from TobiGr/readme-website
Add website, blog and press kit to README.MD
2017-12-23 17:47:59 +01:00
Schabi
9f5d4034e3 fix fullscreen button on popup 2017-12-23 17:34:47 +01:00
Tobias Groza
3c941f6c4b Add website, blog and press kit to README.MD 2017-12-23 16:35:40 +01:00
Christian Schabesberger
ec8fff421a fix avatar not vissible on info screen bug 2017-12-22 16:53:43 +01:00
Christian Schabesberger
a47a0b5432 Merge pull request #904 from Jawnnypoo/tweaks
Pull up support lib version so all always match
2017-12-22 15:25:33 +01:00
Christian Schabesberger
96ba46f21d Merge pull request #931 from TobiGr/notification-icon
Change notification bar icon for popup and background player
2017-12-21 16:03:15 +01:00
Ariel Shulman
90f48d5817 Translated using Weblate (Hebrew)
Currently translated at 100.0% (244 of 244 strings)
2017-12-20 23:47:19 +01:00
Jonas
7288dd097a Translated using Weblate (Spanish)
Currently translated at 100.0% (244 of 244 strings)
2017-12-20 17:02:16 +01:00
TobiGr
0119d62a35 change notification bar icon for popup and background player 2017-12-20 16:29:32 +01:00
Kompiuterių meistras +37060040
4d6ab73fa9 Translated using Weblate (Lithuanian)
Currently translated at 100.0% (244 of 244 strings)
2017-12-20 13:06:09 +01:00
anonymous
f58c95840a Translated using Weblate (Lithuanian)
Currently translated at 60.6% (148 of 244 strings)
2017-12-20 11:04:43 +01:00
Weblate
ecf24f81ec Merge remote-tracking branch 'origin/dev' into dev 2017-12-18 14:15:55 +01:00
Rex_sa
dd3306a940 Translated using Weblate (Arabic)
Currently translated at 91.3% (223 of 244 strings)
2017-12-18 14:15:52 +01:00
Claudio Maradonna
bbb2b98f27 Translated using Weblate (Italian)
Currently translated at 100.0% (244 of 244 strings)
2017-12-18 14:15:32 +01:00
Christian Schabesberger
bc7332780d fix show rending before page was loaded 2017-12-17 12:55:30 +01:00
Joseph Kim
6f3bc3ac8f Translated using Weblate (Korean)
Currently translated at 99.5% (243 of 244 strings)
2017-12-14 11:48:42 +01:00
Weblate
cd04d869b7 Merge remote-tracking branch 'origin/dev' into dev 2017-12-12 15:49:41 +01:00
Eduardo Caron
909e15cbdd Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (244 of 244 strings)
2017-12-12 15:49:31 +01:00
Christian Schabesberger
33fa30ab78 Merge branch 'feature-small-code-improvements' of https://github.com/coffeemakr/NewPipe into coffe 2017-12-11 18:06:38 +01:00
Anthony MARGERAND
44933ac17a Translated using Weblate (French)
Currently translated at 100.0% (244 of 244 strings)
2017-12-10 16:35:06 +01:00
Coffeemakr
bb2af96deb Use getters for extractor items 2017-12-10 11:07:51 +01:00
Coffeemakr
1fe6da14ea Small code improvements 2017-12-10 11:07:08 +01:00
Weblate
b7b9653c21 Merge remote-tracking branch 'origin/dev' into dev 2017-12-09 18:07:20 +01:00
alekksander
8adc5918f8 Translated using Weblate (Polish)
Currently translated at 100.0% (244 of 244 strings)
2017-12-09 18:07:19 +01:00
Tobias Groza
0db593b1bb Translated using Weblate (German)
Currently translated at 100.0% (244 of 244 strings)
2017-12-09 18:07:10 +01:00
Christian Schabesberger
a0c9dbeb78 Merge pull request #910 from coffeemakr/bugfix-integrate-extractor
Fix failing test
2017-12-09 17:36:13 +01:00
Nathan Follens
61d5546d89 Translated using Weblate (Dutch)
Currently translated at 100.0% (244 of 244 strings)
2017-12-09 14:30:18 +01:00
alekksander
f97b7c943b Translated using Weblate (Polish)
Currently translated at 100.0% (244 of 244 strings)
2017-12-09 13:58:19 +01:00
Duppadaadadii
97549b633b Translated using Weblate (Finnish)
Currently translated at 100.0% (244 of 244 strings)
2017-12-09 10:54:55 +01:00
Sérgio Marques
1949e4a9d4 Translated using Weblate (Portuguese)
Currently translated at 93.4% (228 of 244 strings)
2017-12-09 02:49:06 +01:00
Coffeemakr
ecb5f7a5ba Try Travis' solution 2017-12-08 20:26:44 +01:00
Emanuele Petriglia
6021f72cf0 Translated using Weblate (Italian)
Currently translated at 99.1% (242 of 244 strings)
2017-12-08 16:49:42 +01:00
nailyk
c00ef74f96 Translated using Weblate (French)
Currently translated at 99.5% (243 of 244 strings)
2017-12-08 14:46:23 +01:00
Coffeemakr
962e070150 Use Mediaformat objects instead of ids for tests 2017-12-08 13:57:44 +01:00
r2308145
221cbf5e07 Translated using Weblate (Czech)
Currently translated at 100.0% (244 of 244 strings)
2017-12-08 13:45:20 +01:00
Weblate
a72d37ab69 Merge remote-tracking branch 'origin/dev' into dev 2017-12-07 12:40:55 +01:00
E T
f92227e5df Translated using Weblate (Turkish)
Currently translated at 100.0% (244 of 244 strings)
2017-12-07 12:40:54 +01:00
Eduardo Caron
c50617452f Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (244 of 244 strings)
2017-12-07 12:40:52 +01:00
Allan Nordhøy
3957eca94d Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (244 of 244 strings)
2017-12-07 12:40:51 +01:00
Tobias Groza
70111cf614 Translated using Weblate (German)
Currently translated at 99.5% (243 of 244 strings)
2017-12-07 12:40:49 +01:00
r2308145
f9e03c9a40 Translated using Weblate (Czech)
Currently translated at 100.0% (244 of 244 strings)
2017-12-07 12:40:45 +01:00
Christian Schabesberger
88fbdf1cc4 Merge branch 'dev' of github.com:teamnewpipe/NewPipe into dev 2017-12-07 11:36:05 +01:00
Christian Schabesberger
7b76bd79e8 fix swaped name/url for channel 2017-12-07 11:33:34 +01:00
Allan Nordhøy
f4b58e649d Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (244 of 244 strings)
2017-12-07 01:27:39 +01:00
John
91ff301d53 Pull up support lib version so all always match 2017-12-06 18:19:56 -06:00
Eduardo Caron
f5e1c99259 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (244 of 244 strings)
2017-12-07 01:12:44 +01:00
Enol P
abdcd3cc30 Translated using Weblate (Asturian)
Currently translated at 100.0% (244 of 244 strings)
2017-12-07 00:57:40 +01:00
Weblate
23615a39ac Merge remote-tracking branch 'origin/dev' into dev 2017-12-07 00:52:53 +01:00
r2308145
5fa5fc39fc Translated using Weblate (Czech)
Currently translated at 100.0% (239 of 239 strings)
2017-12-07 00:52:50 +01:00
Enol P
01b3c7e91b Translated using Weblate (Asturian)
Currently translated at 100.0% (239 of 239 strings)
2017-12-07 00:52:42 +01:00
Christian Schabesberger
e4e364af3f move on to v0.11.1 2017-12-06 14:49:48 +01:00
Christian Schabesberger
f2358692af update to latest newpipeextractor 2017-12-06 14:29:26 +01:00
TobiGr
26ed6299e3 - add donation hint and website to about activity
- move NewPipe's license to license tab
2017-12-05 17:07:31 +01:00
Christian Schabesberger
3a85187111 Merge pull request #895 from TeamNewPipe/remember
remember last screen orientation
2017-12-05 12:59:00 +01:00
Christian Schabesberger
4261a2eed3 remember last screen orientation 2017-12-05 12:51:23 +01:00
antfarmer
fef17163a9 Translated using Weblate (Bulgarian)
Currently translated at 76.1% (182 of 239 strings)
2017-12-01 11:44:51 +01:00
Deva
9dd447a14f Translated using Weblate (Tamil)
Currently translated at 5.8% (14 of 239 strings)
2017-11-27 15:50:18 +01:00
r2308145
ecf4407ba4 Translated using Weblate (Czech)
Currently translated at 100.0% (239 of 239 strings)
2017-11-27 13:42:16 +01:00
antfarmer
039c0d3ee6 Translated using Weblate (Bulgarian)
Currently translated at 45.6% (109 of 239 strings)
2017-11-25 19:44:55 +01:00
antfarmer
5808aead55 Added translation using Weblate (Bulgarian) 2017-11-23 21:00:38 +01:00
Eduardo Caron
e797e2e7f1 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (239 of 239 strings)
2017-11-23 20:58:37 +01:00
Weblate
23cacbfe65 Merge remote-tracking branch 'origin/dev' into dev 2017-11-23 19:46:19 +01:00
Massedil
4f94ee9b72 Translated using Weblate (French)
Currently translated at 100.0% (239 of 239 strings)

https://github.com/TeamNewPipe/NewPipe/issues/852
2017-11-23 19:46:16 +01:00
TheAssassin
0d1a26298a Recreate LICENSE
git revert screwed up so there was no LICENSE file at all any more, hence we have to recreate it.
2017-11-21 21:18:33 +01:00
TheAssassin
8ccd0b23e9 Revert "Create LICENSE"
This reverts commit d273f69852.
2017-11-21 21:14:52 +01:00
TheAssassin
9d8b991354 Revert "Rename LICENSE to LICENSE.txt"
This reverts commit eee3ccafc3.
2017-11-21 21:14:40 +01:00
TheAssassin
d273f69852 Create LICENSE 2017-11-21 16:06:47 +01:00
TheAssassin
eee3ccafc3 Rename LICENSE to LICENSE.txt
Should satisfy GitHub's license detection.
See https://help.github.com/articles/licensing-a-repository/ for details.
2017-11-21 15:15:07 +01:00
Allan Nordhøy
3686e90e81 Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (239 of 239 strings)
2017-11-21 05:26:38 +01:00
wb9688
f5f8371865 Remove setting 2017-11-20 19:31:33 +01:00
wb9688
1191455d37 Show selected service 2017-11-20 16:04:18 +01:00
Andrey mm
1a5d9da2bf Translated using Weblate (Russian)
Currently translated at 99.5% (238 of 239 strings)
2017-11-20 04:49:02 +01:00
wb9688
011e151c91 Merge branch 'dev' into multiple-services 2017-11-19 17:41:57 +01:00
wb9688
54aa40eac1 Add simple drawer for selecting service 2017-11-19 17:21:46 +01:00
Andrey mm
21a7a73f6d Translated using Weblate (Russian)
Currently translated at 93.7% (224 of 239 strings)

changed according to format of "default audio" title
2017-11-18 08:40:20 +01:00
Andrey mm
5090b41eef Translated using Weblate (Russian)
Currently translated at 93.7% (224 of 239 strings)
2017-11-18 08:28:56 +01:00
ktln
0e55aa6249 Translated using Weblate (Russian)
Currently translated at 93.7% (224 of 239 strings)
2017-11-18 06:28:54 +01:00
Andrey mm
dd2dcf4df2 Translated using Weblate (Russian)
Currently translated at 93.7% (224 of 239 strings)
2017-11-18 06:28:20 +01:00
Oscar Hemelaar
2e84b28998 Translated using Weblate (French)
Currently translated at 100.0% (239 of 239 strings)
2017-11-17 22:46:13 +01:00
Oscar Hemelaar
e6cbfea5a7 Translated using Weblate (Spanish)
Currently translated at 100.0% (239 of 239 strings)
2017-11-16 22:05:00 +01:00
Weblate
641d662944 Merge remote-tracking branch 'origin/dev' into dev 2017-11-16 22:01:48 +01:00
Oscar Hemelaar
09208e183b Translated using Weblate (French)
Currently translated at 100.0% (239 of 239 strings)
2017-11-16 22:01:43 +01:00
Christian Schabesberger
fba3ece688 resolve conflict 2017-11-16 12:20:03 +01:00
Christian Schabesberger
f7d849a3cc Merge branch 'expiring_lru' of https://github.com/karyogamy/NewPipe into info 2017-11-16 11:55:39 +01:00
Allan Nordhøy
709c700cc6 Translated using Weblate (Norwegian Bokmål)
Currently translated at 99.5% (238 of 239 strings)
2017-11-16 07:48:32 +01:00
John Zhen Mo
2da411c1ec -#836: Modified notifications texts to use custom colors instead of device-specific styles. 2017-11-15 20:42:05 -08:00
John Zhen Mo
d6e4f3c809 -Saves the recovery timestamp when player source fails during a valid stream playback. 2017-11-15 20:09:38 -08:00
Freddy Morán Jr
1bb08db8ba Translated using Weblate (Spanish)
Currently translated at 98.7% (236 of 239 strings)
2017-11-15 19:49:38 +01:00
Daria Szatan
2ba116b1e6 Translated using Weblate (Polish)
Currently translated at 69.8% (167 of 239 strings)
2017-11-15 16:48:24 +01:00
lolloCreator
7088de0fb9 Translated using Weblate (Italian)
Currently translated at 100.0% (239 of 239 strings)
2017-11-15 16:47:12 +01:00
Duppadaadadii
7084f73d6c Translated using Weblate (Finnish)
Currently translated at 100.0% (239 of 239 strings)
2017-11-15 13:45:56 +01:00
John Zhen Mo
69374e25fe -Fixed cursor position to point to end after search text insert.
-Reduced and slightly changed offset of search text insert image.
2017-11-14 15:58:13 -08:00
John Zhen Mo
5e16969d61 -Increased search item insert arrow click space. 2017-11-14 11:34:17 -08:00
John Zhen Mo
0fe5a44e5a -Removed todo for timeout feature on info cache. 2017-11-14 11:34:16 -08:00
John Zhen Mo
98e617001d -Added search suggestion insert per #840. 2017-11-14 11:34:16 -08:00
John Zhen Mo
979bd09b29 -Fixed popup player not in foreground when opened by external intent.
-Fixed popup overlay permission causing exception when opened externally.
2017-11-14 11:34:15 -08:00
John Zhen Mo
77678b8f31 -Modified InfoItem LRU cache expire to allow expiration (current default 4 hours).
-Modified info type display on InfoItemDialog to show uploader name if exists.
2017-11-14 11:34:15 -08:00
lolloCreator
3575cac9d7 Translated using Weblate (Italian)
Currently translated at 100.0% (239 of 239 strings)
2017-11-14 16:40:51 +01:00
Weblate
8cdeaf1b27 Merge remote-tracking branch 'origin/dev' into dev 2017-11-14 13:23:41 +01:00
E T
08a8c6c414 Translated using Weblate (Turkish)
Currently translated at 100.0% (239 of 239 strings)
2017-11-14 13:23:40 +01:00
CookieCaptain D
fa5c1b22ae Translated using Weblate (Portuguese)
Currently translated at 95.8% (229 of 239 strings)
2017-11-14 13:23:34 +01:00
vipul jurel
a99e7f3288 Translated using Weblate (Hindi)
Currently translated at 100.0% (239 of 239 strings)
2017-11-14 13:23:32 +01:00
Duppadaadadii
a29506ed2f Translated using Weblate (Finnish)
Currently translated at 100.0% (239 of 239 strings)
2017-11-14 13:23:16 +01:00
Christian Schabesberger
1434b40d03 fix not compilling because of icepick 2017-11-14 12:14:01 +01:00
marin
6d6609187b Add dropdown menu and switch to background option 2017-11-13 20:29:54 +01:00
anonymous
9682eaae2a Translated using Weblate (Portuguese)
Currently translated at 92.4% (221 of 239 strings)
2017-11-13 19:48:08 +01:00
anonymous
1cdb4ccc17 Translated using Weblate (Portuguese)
Currently translated at 90.7% (217 of 239 strings)
2017-11-13 19:47:03 +01:00
CookieCaptain D
2a878dffbc Translated using Weblate (Portuguese)
Currently translated at 90.3% (216 of 239 strings)
2017-11-13 19:46:47 +01:00
anonymous
49f4fb7ed7 Translated using Weblate (Portuguese)
Currently translated at 89.9% (215 of 239 strings)
2017-11-13 19:46:31 +01:00
CookieCaptain D
caa985660a Translated using Weblate (Portuguese)
Currently translated at 89.1% (213 of 239 strings)
2017-11-13 19:45:46 +01:00
Weblate
3842a1e4fb Merge remote-tracking branch 'origin/dev' into dev 2017-11-13 18:41:49 +01:00
Matej U
e06d83cb93 Translated using Weblate (Slovenian)
Currently translated at 92.8% (222 of 239 strings)
2017-11-13 18:41:48 +01:00
Morten R
67df894448 Translated using Weblate (German)
Currently translated at 100.0% (239 of 239 strings)
2017-11-13 18:41:45 +01:00
Charles de Lacombe
d1ec6cf21b Translated using Weblate (French)
Currently translated at 94.5% (226 of 239 strings)
2017-11-13 18:41:43 +01:00
Enol P
537c561cee Translated using Weblate (Asturian)
Currently translated at 94.9% (227 of 239 strings)
2017-11-13 18:41:42 +01:00
Nathan Follens
a65ddc5b36 Translated using Weblate (Dutch)
Currently translated at 100.0% (239 of 239 strings)
2017-11-13 18:41:40 +01:00
Christian Schabesberger
1fb1b3a784 Merge branch 'dev' of github.com:teamnewpipe/NewPipe into dev 2017-11-12 23:58:29 +01:00
Christian Schabesberger
b80879765c Merge branch 'dev' of https://github.com/lawonga/NewPipe into fix 2017-11-12 23:58:08 +01:00
Weblate
10919fe15b Merge remote-tracking branch 'origin/dev' into dev 2017-11-12 21:52:51 +01:00
vipul jurel
9e5fe1edca Translated using Weblate (Hindi)
Currently translated at 100.0% (239 of 239 strings)
2017-11-12 21:52:50 +01:00
Mathias Norräng
03ee3f3d2a Translated using Weblate (Swedish)
Currently translated at 100.0% (239 of 239 strings)
2017-11-12 21:52:38 +01:00
Christian Schabesberger
4113283069 Merge pull request #833 from TeamNewPipe/fastlane
[WIP] add fastlane support
2017-11-12 21:34:10 +01:00
Mathias Norräng
56c5f696df Translated using Weblate (Swedish)
Currently translated at 61.0% (146 of 239 strings)
2017-11-12 21:12:20 +01:00
Weblate
9beb76e641 Merge remote-tracking branch 'origin/dev' into dev 2017-11-12 18:48:19 +01:00
YFdyh000
f71403be58 Translated using Weblate (Chinese (Simplified))
Currently translated at 87.4% (209 of 239 strings)
2017-11-12 18:48:16 +01:00
vipul jurel
d0e5d36b1b Translated using Weblate (Hindi)
Currently translated at 100.0% (239 of 239 strings)
2017-11-12 18:48:05 +01:00
Christian Schabesberger
fdeb7543ca fix channel rssbutton null pointer bug 2017-11-12 13:59:11 +01:00
Weblate
90716f4f5b Merge remote-tracking branch 'origin/dev' into dev 2017-11-12 13:22:06 +01:00
Ivan Krušlin
54d41bc288 Translated using Weblate (Croatian)
Currently translated at 100.0% (233 of 233 strings)
2017-11-12 13:22:05 +01:00
drgsh
d63c7a9042 Translated using Weblate (Hindi)
Currently translated at 25.7% (60 of 233 strings)
2017-11-12 13:22:01 +01:00
Christian Schabesberger
cd5b60cbed fix layout 2017-11-12 09:16:51 +01:00
Christian Schabesberger
6d60e6698a Merge branch 'play-queue-enhancement' of https://github.com/karyogamy/NewPipe into pqe 2017-11-12 08:33:05 +01:00
Christian Schabesberger
d53cb01396 add fastlane support
fix screenthots link

add description
2017-11-12 08:31:09 +01:00
lawonga
8baaecab1b #827 Fixes auto rotation bug with useAsFrontPage on by preserving the useAsFrontPage boolean setting 2017-11-11 19:51:20 -08:00
John Zhen Mo
1368f9f89e -Fixed channel header contrast color. 2017-11-11 15:05:48 -08:00
John Zhen Mo
ce36f3ae3b -Modified play queue action buttons on playlist and channel fragments.
-Added info item menu with custom title banner on long click.
-Enabled starting playlists and channels from middle.
-Enabled caching for play queue item thumbnails.
-Modified play queue to revert to first item on deleting last item.
2017-11-11 14:48:16 -08:00
John Zhen Mo
cf147aa161 -Reverted dropdown menu UI for list view info items. 2017-11-11 14:48:16 -08:00
John Zhen Mo
7700cff5e5 -Added play buttons to channel fragment similar to playlist fragment.
-Fixed abstract info play queue reloading the same initial page.
-Fixed OOB on get item for abstract play queue.
2017-11-11 14:48:16 -08:00
John Zhen Mo
b883f313ba -Fixed NPE when popup is updated during shutdown. 2017-11-11 14:48:16 -08:00
John Zhen Mo
b1ee22cde6 -Added scroll to fetch for external play queues.
-Modified service player activity scrolling to be instantaneous when difference is too large.
-Modified service player activity to no longer update metadata if nothing change when sync is called.
2017-11-11 14:48:16 -08:00
John Zhen Mo
b32f149a1b -Refactored Channel and Playlist PlayQueue into AbstractInfo playQueue.
-Increase list item action dropdown padding.
2017-11-11 14:48:16 -08:00
John Zhen Mo
1d136c6c35 -Added fast seeking on background notification when play queue size is 1.
-Fixed player intent with quality selection not used in detail fragment.
-Fixed window index not reset on sync when not playing.
-Fix dropdown play string for stream info item.
2017-11-11 14:48:16 -08:00
John Zhen Mo
b8a17580c5 -Added play queue dropdown to channel info items.
-Added play queue dropdown to playlist info items.
-Added Channel Play Queue.
-Renamed External Play Queue to Playlist Play Queue.
-Modified Playlist Play Queue to allow loading from initial state.
2017-11-11 14:48:16 -08:00
John Zhen Mo
87febf8679 -Added dropdown to start play for all StreamInfoItem.
-Refactored NavigationHelper to allow service player control to open anywhere.
-Refactored NavigationHelper to allow starting player at anywhere.
2017-11-11 14:48:16 -08:00
John Zhen Mo
38b2ffd450 -Added fling to toss popup view when velocity is below shutdown.
-Added string for unknown content.
-Fixed NPE when UI element is touched after player shuts down in service activity.
-Fixed shuffle reset caused by position discontinuity offsets index.
-Moved some more player shared preferences to PlayerHelper.
2017-11-11 14:48:16 -08:00
John Zhen Mo
01e031e7e7 -Modified recovery to not set if progress position is 0 or less.
-Modified queue item synchronization to no longer trigger update when the sync is run on the identical item.
2017-11-11 14:48:16 -08:00
John Zhen Mo
0b1eda3050 -Improved null checks in player stream resolution.
-Improved naming in MediaSourceManager
2017-11-11 14:48:16 -08:00
Weblate
52cdf96dfe Merge remote-tracking branch 'origin/dev' into dev 2017-11-11 18:55:55 +01:00
nautilusx
1f5eba59c5 Translated using Weblate (German)
Currently translated at 99.5% (232 of 233 strings)
2017-11-11 18:55:51 +01:00
r2308145
372c2f2be0 Translated using Weblate (Czech)
Currently translated at 100.0% (233 of 233 strings)
2017-11-11 18:55:48 +01:00
Ivan Krušlin
25e0b46396 Translated using Weblate (Croatian)
Currently translated at 100.0% (233 of 233 strings)
2017-11-11 18:55:45 +01:00
wb9688
621a1909ec Merge remote-tracking branch 'origin/dev' into multiple-services 2017-11-11 13:18:26 +01:00
Christian Schabesberger
d3332583b6 Merge branch 'dev' of github.com:teamnewpipe/NewPipe into dev 2017-11-10 21:31:39 +01:00
Christian Schabesberger
cb5cf9bb09 update support lib to 27.0.1 2017-11-10 21:31:19 +01:00
Nick Undnick
6cb2c2a84e Translated using Weblate (German)
Currently translated at 99.5% (232 of 233 strings)
2017-11-10 20:54:24 +01:00
nautilusx
633137fd79 Translated using Weblate (German)
Currently translated at 99.5% (232 of 233 strings)
2017-11-10 20:53:22 +01:00
Weblate
9627fdf33f Merge remote-tracking branch 'origin/dev' into dev 2017-11-10 20:46:38 +01:00
Praveen0899
b39366c80a Translated using Weblate (Telugu)
Currently translated at 72.5% (169 of 233 strings)
2017-11-10 20:46:38 +01:00
drgsh
ac01c49666 Translated using Weblate (Hindi)
Currently translated at 23.6% (55 of 233 strings)
2017-11-10 20:46:13 +01:00
r2308145
80d16ea407 Translated using Weblate (Czech)
Currently translated at 100.0% (233 of 233 strings)
2017-11-10 20:46:11 +01:00
Tobias Groza
4f44f26333 Translated using Weblate (German)
Currently translated at 99.5% (232 of 233 strings)
2017-11-10 20:46:08 +01:00
Christian Schabesberger
a21bdb1487 Merge branch 'studio-3' of https://github.com/wb9688/NewPipe into a 2017-11-10 20:45:05 +01:00
Christian Schabesberger
4d6a2f40d3 Merge pull request #830 from TobiGr/fix-ta-language-code
Fix Tamil language code
2017-11-10 19:47:12 +01:00
Nick Undnick
e6773aac0e Translated using Weblate (German)
Currently translated at 99.5% (232 of 233 strings)
2017-11-10 19:46:31 +01:00
TobiGr
997381d0c3 Fix Tamil language code 2017-11-10 16:57:58 +01:00
wb9688
ac53eeb76d Upgrade ACRA 2017-11-10 15:36:13 +01:00
wb9688
a09c8934fc Fix Travis 2017-11-10 15:34:57 +01:00
Ephraim Raj
b4120c39e6 Translated using Weblate (Hindi)
Currently translated at 21.8% (51 of 233 strings)
2017-11-10 13:46:37 +01:00
wb9688
5d6320d925 Upgrade to Studio 3 2017-11-10 10:33:59 +01:00
Xuacu Saturio
985bf50f7f Translated using Weblate (Asturian)
Currently translated at 96.5% (225 of 233 strings)
2017-11-09 22:44:19 +01:00
Allan Nordhøy
84d21af644 Translated using Weblate (Norwegian Bokmål)
Currently translated at 95.7% (223 of 233 strings)
2017-11-09 21:47:47 +01:00
Weblate
267cd99b04 Merge remote-tracking branch 'origin/dev' into dev 2017-11-08 19:49:19 +01:00
r2308145
401960079c Translated using Weblate (Czech)
Currently translated at 100.0% (233 of 233 strings)
2017-11-08 19:49:17 +01:00
Freddy Morán Jr
1fbc8a2850 Translated using Weblate (Spanish)
Currently translated at 98.7% (230 of 233 strings)
2017-11-08 19:49:08 +01:00
Christian Schabesberger
16fe5a94ac Merge pull request #821 from Stokkie64/patch-1
Update CONTRIBUTING.md
2017-11-08 13:02:34 +01:00
Arjen Singels
1c20a4d9eb Update CONTRIBUTING.md
fixed typo.
2017-11-08 13:58:01 +02:00
Christian Schabesberger
3a9f30d954 Merge pull request #812 from imallan/dev
Fixes ClassCastException when getting Bitmap from AdaptiveIcon
2017-11-08 12:55:07 +01:00
Christian Schabesberger
856aacf8ce Merge pull request #819 from TobiGr/fix-czech-plurals
Fix Czech plurals
2017-11-08 12:54:38 +01:00
TobiGr
441b510775 Fix plurals not showing number of views, videos and subscribers
Fix typo in pull request template
2017-11-07 14:48:48 +01:00
Weblate
88a10b5af1 Merge remote-tracking branch 'origin/dev' into dev 2017-11-07 11:44:38 +01:00
Duppadaadadii
65205ace95 Translated using Weblate (Finnish)
Currently translated at 100.0% (233 of 233 strings)
2017-11-07 11:44:37 +01:00
Nathan Follens
1a4ef06ee9 Translated using Weblate (Dutch)
Currently translated at 100.0% (233 of 233 strings)
2017-11-07 11:44:31 +01:00
r2308145
64ac631040 Translated using Weblate (Czech)
Currently translated at 100.0% (233 of 233 strings)
2017-11-07 11:44:30 +01:00
Omar
4e4cabb929 Translated using Weblate (Arabic)
Currently translated at 40.3% (94 of 233 strings)
2017-11-07 11:44:22 +01:00
Christian Schabesberger
b242c86869 add support for indian languages 2017-11-07 11:04:12 +01:00
vesp
d37fee346a Translated using Weblate (Czech)
Currently translated at 100.0% (233 of 233 strings)
2017-11-06 22:41:56 +01:00
r2308145
cc52d3b0af Translated using Weblate (Czech)
Currently translated at 100.0% (233 of 233 strings)
2017-11-06 22:41:07 +01:00
vesp
d5b1bae305 Translated using Weblate (Czech)
Currently translated at 100.0% (233 of 233 strings)
2017-11-06 22:39:44 +01:00
r2308145
04e22faf85 Translated using Weblate (Czech)
Currently translated at 100.0% (233 of 233 strings)
2017-11-06 22:38:51 +01:00
Nathan Follens
48cb3ed138 Translated using Weblate (Dutch)
Currently translated at 100.0% (233 of 233 strings)
2017-11-06 18:24:39 +01:00
wb9688
ebdeee8b3c Translated using Weblate (Dutch)
Currently translated at 100.0% (233 of 233 strings)
2017-11-06 18:21:29 +01:00
anonymous
6449d7d4ee Translated using Weblate (Dutch)
Currently translated at 100.0% (233 of 233 strings)
2017-11-06 18:20:08 +01:00
yilun
4b775d15a2 Fixes ClassCastException when getting Bitmap from AdaptiveIcon on Android 8+ 2017-11-06 12:27:10 +00:00
wb9688
e4d6a453b0 Translated using Weblate (Dutch)
Currently translated at 100.0% (233 of 233 strings)
2017-11-06 11:44:55 +01:00
anonymous
9dcbcd57cb Translated using Weblate (Arabic)
Currently translated at 33.4% (78 of 233 strings)
2017-11-06 10:36:44 +01:00
Omar
17aa44c88b Translated using Weblate (Arabic)
Currently translated at 33.4% (78 of 233 strings)
2017-11-06 10:36:32 +01:00
Weblate
60dc266e13 Merge remote-tracking branch 'origin/dev' into dev 2017-11-05 23:03:03 +01:00
Duppadaadadii
60ed308caa Translated using Weblate (Finnish)
Currently translated at 100.0% (233 of 233 strings)
2017-11-05 23:02:59 +01:00
Christian Schabesberger
c485e7e167 merge master 2017-11-05 21:00:05 +01:00
Christian Schabesberger
71a8361580 merge dev 2017-11-05 20:59:17 +01:00
Christian Schabesberger
3d1cc348c8 fix getUploaderName() and move on to v0.10.2 2017-10-31 19:47:46 +01:00
wb9688
25db3c2940 Update NewPipeExtractor 2017-09-16 10:25:54 +02:00
wb9688
442290d7f0 Hide spinner 2017-09-14 11:43:30 +02:00
wb9688
a6eb871f5e Change layout for audio-only streams 2017-09-14 10:49:39 +02:00
wb9688
b500c3f526 Add service setting 2017-09-14 09:31:01 +02:00
225 changed files with 8178 additions and 2088 deletions

View File

@@ -32,7 +32,7 @@ Do not report crashes in the GitHub issue tracker. NewPipe has an automated cras
* Please test (compile and run) your code before you submit changes! Ideally, provide test feedback in the PR description. Untested code will **not** be merged!
* Try to figure out yourself why builds on our CI fail.
* Make sure your PR is up-to-date with the rest of the code. Often, a simple click on "Update branch" will do the job, but if not, you are asked to merge the master branch manually and resolve the problems on your own. That will make the maintainers' jobs way easier.
* Please show intention to maintain your features and code after you contributed it. Unmaintained code is a hassle for the core developers, and just adds work. If you do not intend to maintain features you contributed, please think again about sumission, or clearly state that in the description of your PR.
* Please show intention to maintain your features and code after you contributed it. Unmaintained code is a hassle for the core developers, and just adds work. If you do not intend to maintain features you contributed, please think again about submission, or clearly state that in the description of your PR.
* Respond yourselves if someone requests changes or otherwise raises issues about your PRs.
* Check if your contributions align with the [fdroid inclusion guidelines](https://f-droid.org/en/docs/Inclusion_Policy/).
* Check if your submission can be build with the current fdroid build server setup.

View File

@@ -1 +1 @@
- [ ] I carefully reed the [contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md) and agree to them.
- [ ] I carefully read the [contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md) and agree to them.

1
.gitignore vendored
View File

@@ -10,3 +10,4 @@
gradle.properties
*~
.weblate
*.class

View File

@@ -5,11 +5,13 @@ android:
components:
# The BuildTools version used by NewPipe
- tools
- build-tools-26.0.1
- build-tools-27.0.1
# The SDK version used to compile NewPipe
- android-26
- android-27
before_install:
- yes | sdkmanager "platforms;android-27"
script: ./gradlew -Dorg.gradle.jvmargs=-Xmx1536m assembleDebug lintDebug testDebugUnitTest
licenses:

170
CheckTranslations.java Normal file
View File

@@ -0,0 +1,170 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.regex.*;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.nio.file.Files;
import java.nio.charset.Charset;
public final class CheckTranslations {
private static boolean debug = false;
private static boolean plurals = false;
private static boolean empty = false;
private static boolean remove = false;
private static int checks = 0;
private static int matches = 0;
private static int changes = 0;
private static Pattern p, pb, pe, e, o;
/**
* Search translated strings.xml files for empty item / plural tags
* and remove them.
* @param args directories which contain string.xml files (in any subdirectory)
* -e option to find all empty string tags
* -p option to find all empty plurals and item tags
* -r option to remove all occurrences from the files
* -d option to see more details
*/
public static void main(String[] args) {
if (args.length < 1 || (args[0].equals("-d") && args.length < 2)) {
System.out.println("Not enough arguments");
return;
}
for (int i = 0; i < args.length; i++) {
switch (args[i]) {
case "-d":
debug = true;
break;
case "-p":
plurals = true;
break;
case "-e":
empty = true;
break;
case "-r":
remove = true;
break;
}
}
if (!plurals && !empty) {
plurals = true;
empty = true;
}
p = Pattern.compile("(<item quantity=\")(zero|one|two|three|few|many|other)(\"></item>|\"/>)");
pb = Pattern.compile("(<plurals[\\sa-zA-Z=\"]*>)");
pe = Pattern.compile("(</plurals>)");
e = Pattern.compile("(<string[\\sa-z_\\\"=]*)((><\\/string>|\\/>){1})");
o = Pattern.compile("(<item quantity=\"other\">)[^</>]*(<\\/item>)");
for (int i = 0; i < args.length; i++) {
if (!args[i].equals("-d") && !args[i].equals("-p") && !args[i].equals("-e") && !args[i].equals("-r")) {
File f = new File(args[i]);
if (f.exists() && !f.isDirectory()) {
checkFile(f);
} else if (f.isDirectory()) {
checkFiles(f.listFiles());
} else {
System.out.println("'" + args[i] + "' does not exist!");
}
}
}
System.out.println(checks + " files were checked.");
System.out.println(matches + " corrupt lines detected.");
if (remove) {
System.out.println(matches + " corrupt lines removed and " + changes + " lines fixed.");
}
}
private static void checkFiles(File[] f) {
for (int i = 0; i < f.length; i++) {
if (f[i].exists() && !f[i].isDirectory()) {
if (f[i].toString().contains("strings.xml")) {
checkFile(f[i]);
}
} else if (f[i].isDirectory()) {
checkFiles(f[i].listFiles());
}
}
}
private static void checkFile(File f) {
// Do not check our original English strings to cause no unwanted changes
// Btw. there should not be empty plural/item tags
if (f.toString().contains("values/strings.xml")) {
return;
}
if (debug) System.out.println("Checking " + f.toString());
checks++;
List<String> lines = new ArrayList<String>();
boolean checkFailed = false;
boolean otherDetected = false;
boolean inPlurals = false;
try (BufferedReader br = new BufferedReader(new FileReader(f))) {
String line;
int ln = 0;
while ((line = br.readLine()) != null) {
ln++;
if (plurals && p.matcher(line).find()) {
matches++;
if (debug) System.out.println(" Line " + ln + " was " + ((remove) ? "removed" : "detected") + ": '" + line + "'");
checkFailed = true;
} else if (empty && e.matcher(line).find()) {
matches++;
checkFailed = true;
if (debug) System.out.println(" Line " + ln + " was " + ((remove) ? "removed" : "detected") + ": '" + line + "'");
} else {
if (remove) lines.add(line);
}
}
br.close();
int pluralsLine = 0;
for (int i = 0; i < lines.size(); i++) {
if (o.matcher(lines.get(i)).find()) {
otherDetected = true;
}
if (plurals && pb.matcher(lines.get(i)).find()) {
inPlurals = true;
pluralsLine = i;
} else if (plurals && pe.matcher(lines.get(i)).find()) {
inPlurals = false;
if (!otherDetected) {
boolean b = false;
check: for(int j = pluralsLine; j < i; j++) {
if (lines.get(j).contains("many")) {
b = true;
pluralsLine = j;
break check;
}
}
if (remove && b) {
if (debug) System.out.println(" Line " + (pluralsLine + 1) + " was " + ((remove) ? "changed" : "detected") + ": '" + lines.get(pluralsLine) + "'");
lines.set(pluralsLine, lines.get(pluralsLine).replace("many", "other"));
changes++;
checkFailed = true;
} else if (debug) {
if (debug) System.out.println(" WARNING: Line " + (i + 1) + " - No <item quantity=\"other\"> found!");
}
}
otherDetected = false;
}
}
if (remove && checkFailed) {
Files.write(f.toPath(), lines, Charset.forName("UTF-8"));
}
} catch (IOException e) {
System.out.println(e);
}
}
}

View File

@@ -13,21 +13,22 @@
</p>
<hr />
<p align="center"><a href="#screenshots">Screenshots</a> &bull; <a href="#description">Description</a> &bull; <a href="#features">Features</a> &bull; <a href="#contribution">Contribution</a> &bull; <a href="#donate">Donate</a> &bull; <a href="#license">License</a></p>
<p align="center"><a href="https://newpipe.schabi.org">Website</a> &bull; <a href="https://newpipe.schabi.org/blog/">Blog</a> &bull; <a href="https://newpipe.schabi.org/press/">Press</a></p>
<hr />
WARNING: PUTTING NEWPIPE OR ANY FORK OF IT INTO GOOGLE PLAYSTORE VIOLATES THEIR TERMS OF CONDITIONS.
## Screenshots
[<img src="screenshots/shot_1.png" width=160>](screenshots/shot_1.png)
[<img src="screenshots/shot_2.png" width=160>](screenshots/shot_2.png)
[<img src="screenshots/shot_3.png" width=160>](screenshots/shot_3.png)
[<img src="screenshots/shot_4.png" width=160>](screenshots/shot_4.png)
[<img src="screenshots/shot_5.png" width=160>](screenshots/shot_5.png)
[<img src="screenshots/shot_6.png" width=160>](screenshots/shot_6.png)
[<img src="screenshots/shot_7.png" width=160>](screenshots/shot_7.png)
[<img src="screenshots/shot_8.png" width=160>](screenshots/shot_8.png)
[<img src="screenshots/shot_9.png" width=160>](screenshots/shot_9.png)
[<img src="screenshots/shot_10.png" width=160>](screenshots/shot_10.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_10.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_10.png)
## Description

View File

@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig {
applicationId "org.schabi.newpipe"
minSdkVersion 15
targetSdkVersion 26
versionCode 41
versionName "0.11.0"
targetSdkVersion 27
versionCode 47
versionName "0.11.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
@@ -27,6 +27,10 @@ android {
applicationIdSuffix ".debug"
}
beta {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationIdSuffix ".beta"
}
}
@@ -38,48 +42,51 @@ android {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
ext {
supportLibVersion = '27.0.2'
}
dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2') {
exclude module: 'support-annotations'
}
compile 'com.github.TeamNewPipe:NewPipeExtractor:b9d0941'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:7fd21ec08581d'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:preference-v14:26.0.1'
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation "com.android.support:support-v4:$supportLibVersion"
implementation "com.android.support:design:$supportLibVersion"
implementation "com.android.support:recyclerview-v7:$supportLibVersion"
implementation "com.android.support:preference-v14:$supportLibVersion"
compile 'com.google.code.gson:gson:2.7'
compile 'ch.acra:acra:4.9.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'ch.acra:acra:4.9.2'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.github.nirhart:parallaxscroll:1.0'
compile 'com.nononsenseapps:filepicker:3.0.1'
compile 'com.google.android.exoplayer:exoplayer:r2.5.4'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.nirhart:ParallaxScroll:dd53d1f9d1'
implementation 'com.nononsenseapps:filepicker:3.0.1'
implementation 'com.google.android.exoplayer:exoplayer:r2.5.4'
debugCompile 'com.facebook.stetho:stetho:1.5.0'
debugCompile 'com.facebook.stetho:stetho-urlconnection:1.5.0'
debugCompile 'com.android.support:multidex:1.0.1'
debugImplementation 'com.facebook.stetho:stetho:1.5.0'
debugImplementation 'com.facebook.stetho:stetho-urlconnection:1.5.0'
debugImplementation 'com.android.support:multidex:1.0.2'
compile 'io.reactivex.rxjava2:rxjava:2.1.2'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
compile 'android.arch.persistence.room:runtime:1.0.0-alpha8'
compile 'android.arch.persistence.room:rxjava2:1.0.0-alpha8'
annotationProcessor 'android.arch.persistence.room:compiler:1.0.0-alpha8'
implementation 'android.arch.persistence.room:runtime:1.0.0'
implementation 'android.arch.persistence.room:rxjava2:1.0.0'
annotationProcessor 'android.arch.persistence.room:compiler:1.0.0'
compile 'frankiesardo:icepick:3.2.0'
provided 'frankiesardo:icepick-processor:3.2.0'
implementation 'frankiesardo:icepick:3.2.0'
annotationProcessor 'frankiesardo:icepick-processor:3.2.0'
}

View File

@@ -16,7 +16,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:logo="@mipmap/ic_launcher"
android:theme="@style/DarkTheme"
android:theme="@style/OpeningTheme"
tools:ignore="AllowBackup">
<activity
android:name=".MainActivity"
@@ -31,7 +31,7 @@
<activity
android:name=".player.old.PlayVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/VideoPlayerTheme"
android:theme="@style/OldVideoPlayerTheme"
tools:ignore="UnusedAttribute"/>
<service
@@ -56,8 +56,7 @@
android:name=".player.MainVideoPlayer"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/PlayerTheme"/>
android:launchMode="singleTask"/>
<activity
android:name=".settings.SettingsActivity"
@@ -124,7 +123,7 @@
<activity
android:name=".RouterActivity"
android:taskAffinity=""
android:theme="@android:style/Theme.NoDisplay">
android:theme="@style/RouterActivityThemeDark">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
@@ -175,17 +174,21 @@
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
</intent-filter>
</activity>
<service
android:name=".RouterPlayerActivity$FetcherService"
android:exported="false"/>
<activity
android:name=".RouterPopupActivity"
android:label="@string/popup_mode_share_menu_title"
android:name=".RouterPlayerActivity"
android:excludeFromRecents="true"
android:label="@string/preferred_player_share_menu_title"
android:taskAffinity=""
android:theme="@android:style/Theme.NoDisplay">
android:theme="@style/RouterActivityThemeDark">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
@@ -204,6 +207,11 @@
<data android:pathPrefix="/embed/"/>
<data android:pathPrefix="/watch"/>
<data android:pathPrefix="/attribution_link"/>
<!-- channel prefix -->
<data android:pathPrefix="/channel/"/>
<data android:pathPrefix="/user/"/>
<!-- playlist prefix -->
<data android:pathPrefix="/playlist"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>

View File

@@ -1,9 +1,12 @@
package org.schabi.newpipe;
import android.app.AlarmManager;
import android.app.Application;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.util.Log;
@@ -116,7 +119,6 @@ public class App extends Application {
});
}
private void initACRA() {
try {
final ACRAConfiguration acraConfig = new ConfigurationBuilder(this)
@@ -149,4 +151,5 @@ public class App extends Application {
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.createNotificationChannel(mChannel);
}
}

View File

@@ -77,17 +77,6 @@ public abstract class BaseFragment extends Fragment {
protected void initListeners() {
}
/*//////////////////////////////////////////////////////////////////////////
// Utils
//////////////////////////////////////////////////////////////////////////*/
protected final int resolveResourceIdFromAttr(@AttrRes int attr) {
TypedArray a = activity.getTheme().obtainStyledAttributes(new int[]{attr});
int attributeResourceId = a.getResourceId(0, 0);
a.recycle();
return attributeResourceId;
}
/*//////////////////////////////////////////////////////////////////////////
// DisplayImageOptions default configurations
//////////////////////////////////////////////////////////////////////////*/

View File

@@ -28,8 +28,12 @@ import android.os.Looper;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
@@ -50,11 +54,13 @@ import org.schabi.newpipe.extractor.stream.AudioStream;
import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.extractor.stream.VideoStream;
import org.schabi.newpipe.fragments.BackPressable;
import org.schabi.newpipe.fragments.MainFragment;
import org.schabi.newpipe.fragments.detail.VideoDetailFragment;
import org.schabi.newpipe.fragments.list.search.SearchFragment;
import org.schabi.newpipe.history.HistoryListener;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.StateSaver;
import org.schabi.newpipe.util.ThemeHelper;
@@ -67,8 +73,10 @@ import io.reactivex.subjects.PublishSubject;
public class MainActivity extends AppCompatActivity implements HistoryListener {
private static final String TAG = "MainActivity";
public static final boolean DEBUG = false;
public static final boolean DEBUG = !BuildConfig.BUILD_TYPE.equals("release");
private SharedPreferences sharedPreferences;
private ActionBarDrawerToggle toggle = null;
/*//////////////////////////////////////////////////////////////////////////
// Activity's LifeCycle
@@ -77,7 +85,10 @@ public class MainActivity extends AppCompatActivity implements HistoryListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
if (DEBUG) Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]");
ThemeHelper.setTheme(this);
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
ThemeHelper.setTheme(this, ServiceHelper.getSelectedServiceId(this));
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@@ -85,13 +96,53 @@ public class MainActivity extends AppCompatActivity implements HistoryListener {
initFragments();
}
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
setSupportActionBar(findViewById(R.id.toolbar));
setupDrawer();
initHistory();
}
private void setupDrawer() {
final Toolbar toolbar = findViewById(R.id.toolbar);
final DrawerLayout drawer = findViewById(R.id.drawer_layout);
final NavigationView drawerItems = findViewById(R.id.navigation);
//drawerItems.setItemIconTintList(null); // Set null to use the original icon
drawerItems.getMenu().getItem(ServiceHelper.getSelectedServiceId(this)).setChecked(true);
if (!BuildConfig.BUILD_TYPE.equals("release")) {
toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.drawer_open, R.string.drawer_close);
toggle.syncState();
drawer.addDrawerListener(toggle);
drawer.addDrawerListener(new DrawerLayout.SimpleDrawerListener() {
private int lastService;
@Override
public void onDrawerOpened(View drawerView) {
lastService = ServiceHelper.getSelectedServiceId(MainActivity.this);
}
@Override
public void onDrawerClosed(View drawerView) {
if (lastService != ServiceHelper.getSelectedServiceId(MainActivity.this)) {
new Handler(Looper.getMainLooper()).post(MainActivity.this::recreate);
}
}
});
drawerItems.setNavigationItemSelectedListener(item -> {
if (item.getGroupId() == R.id.menu_services_group) {
drawerItems.getMenu().getItem(ServiceHelper.getSelectedServiceId(this)).setChecked(false);
ServiceHelper.setSelectedServiceId(this, item.getTitle().toString());
drawerItems.getMenu().getItem(ServiceHelper.getSelectedServiceId(this)).setChecked(true);
}
drawer.closeDrawers();
return true;
});
} else {
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
}
}
@Override
protected void onDestroy() {
super.onDestroy();
@@ -112,20 +163,14 @@ public class MainActivity extends AppCompatActivity implements HistoryListener {
sharedPreferences.edit().putBoolean(Constants.KEY_THEME_CHANGE, false).apply();
// https://stackoverflow.com/questions/10844112/runtimeexception-performing-pause-of-activity-that-is-not-resumed
// Briefly, let the activity resume properly posting the recreate call to end of the message queue
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
MainActivity.this.recreate();
}
});
new Handler(Looper.getMainLooper()).post(MainActivity.this::recreate);
}
if(sharedPreferences.getBoolean(Constants.KEY_MAIN_PAGE_CHANGE, false)) {
if (sharedPreferences.getBoolean(Constants.KEY_MAIN_PAGE_CHANGE, false)) {
if (DEBUG) Log.d(TAG, "main page has changed, recreating main fragment...");
sharedPreferences.edit().putBoolean(Constants.KEY_MAIN_PAGE_CHANGE, false).apply();
NavigationHelper.openMainActivity(this);
}
}
@Override
@@ -159,6 +204,38 @@ public class MainActivity extends AppCompatActivity implements HistoryListener {
} else super.onBackPressed();
}
/**
* Implement the following diagram behavior for the up button:
* <pre>
* +---------------+
* | Main Screen +----+
* +-------+-------+ |
* | |
* ▲ Up | Search Button
* | |
* +----+-----+ |
* +------------+ Search |◄-----+
* | +----+-----+
* | Open |
* | something ▲ Up
* | |
* | +------------+-------------+
* | | |
* | | Video <-> Channel |
* +---►| Channel <-> Playlist |
* | Video <-> .... |
* | |
* +--------------------------+
* </pre>
*/
private void onHomeButtonPressed() {
// If search fragment wasn't found in the backstack...
if (!NavigationHelper.tryGotoSearchFragment(getSupportFragmentManager())) {
// ...go to the main fragment
NavigationHelper.gotoMainFragment(getSupportFragmentManager());
}
}
/*//////////////////////////////////////////////////////////////////////////
// Menu
//////////////////////////////////////////////////////////////////////////*/
@@ -184,6 +261,9 @@ public class MainActivity extends AppCompatActivity implements HistoryListener {
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(false);
}
updateDrawerNavigation();
return true;
}
@@ -194,7 +274,7 @@ public class MainActivity extends AppCompatActivity implements HistoryListener {
switch (id) {
case android.R.id.home:
NavigationHelper.gotoMainFragment(getSupportFragmentManager());
onHomeButtonPressed();
return true;
case R.id.action_settings:
NavigationHelper.openSettings(this);
@@ -228,6 +308,27 @@ public class MainActivity extends AppCompatActivity implements HistoryListener {
// Utils
//////////////////////////////////////////////////////////////////////////*/
private void updateDrawerNavigation() {
if (getSupportActionBar() == null) return;
final Toolbar toolbar = findViewById(R.id.toolbar);
final DrawerLayout drawer = findViewById(R.id.drawer_layout);
final Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_holder);
if (fragment instanceof MainFragment) {
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
if (toggle != null) {
toggle.syncState();
toolbar.setNavigationOnClickListener(v -> drawer.openDrawer(GravityCompat.START));
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNDEFINED);
}
} else {
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
toolbar.setNavigationOnClickListener(v -> onHomeButtonPressed());
}
}
private void handleIntent(Intent intent) {
if (DEBUG) Log.d(TAG, "handleIntent() called with: intent = [" + intent + "]");

View File

@@ -3,14 +3,25 @@ package org.schabi.newpipe;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.widget.Toast;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.NavigationHelper;
import java.util.Collection;
import java.util.HashSet;
/**
import icepick.Icepick;
import icepick.State;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers;
/*
* Copyright (C) Christian Schabesberger 2017 <chris.schabesberger@mailbox.org>
* RouterActivity.java is part of NewPipe.
*
@@ -34,23 +45,71 @@ import java.util.HashSet;
*/
public class RouterActivity extends AppCompatActivity {
@State
protected String currentUrl;
protected CompositeDisposable disposables = new CompositeDisposable();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Icepick.restoreInstanceState(this, savedInstanceState);
String videoUrl = getUrl(getIntent());
handleUrl(videoUrl);
if (TextUtils.isEmpty(currentUrl)) {
currentUrl = getUrl(getIntent());
if (TextUtils.isEmpty(currentUrl)) {
Toast.makeText(this, R.string.invalid_url_toast, Toast.LENGTH_LONG).show();
finish();
}
}
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
Icepick.saveInstanceState(this, outState);
}
@Override
protected void onStart() {
super.onStart();
handleUrl(currentUrl);
}
protected void handleUrl(String url) {
boolean success = NavigationHelper.openByLink(this, url);
if (!success) {
disposables.add(Observable
.fromCallable(() -> NavigationHelper.getIntentByLink(this, url))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(intent -> {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
finish();
}, this::handleError)
);
}
protected void handleError(Throwable error) {
error.printStackTrace();
if (error instanceof ExtractionException) {
Toast.makeText(this, R.string.url_not_supported_toast, Toast.LENGTH_LONG).show();
} else {
ExtractorHelper.handleGeneralException(this, -1, null, error, UserAction.SOMETHING_ELSE, null);
}
finish();
}
@Override
protected void onDestroy() {
super.onDestroy();
disposables.clear();
}
/*//////////////////////////////////////////////////////////////////////////
// Utils
//////////////////////////////////////////////////////////////////////////*/
@@ -71,7 +130,8 @@ public class RouterActivity extends AppCompatActivity {
} else if (intent.getStringExtra(Intent.EXTRA_TEXT) != null) {
//this means that vidoe was called through share menu
String extraText = intent.getStringExtra(Intent.EXTRA_TEXT);
videoUrl = getUris(extraText)[0];
final String[] uris = getUris(extraText);
videoUrl = uris.length > 0 ? uris[0] : null;
}
return videoUrl;

File diff suppressed because it is too large Load Diff

View File

@@ -1,49 +0,0 @@
package org.schabi.newpipe;
import android.content.Intent;
import android.os.Build;
import android.widget.Toast;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.player.PopupVideoPlayer;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.PermissionHelper;
/**
* Get the url from the intent and open a popup player
*/
public class RouterPopupActivity extends RouterActivity {
@Override
protected void handleUrl(String url) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
&& !PermissionHelper.checkSystemAlertWindowPermission(this)) {
Toast.makeText(this, R.string.msg_popup_permission, Toast.LENGTH_LONG).show();
return;
}
StreamingService service;
try {
service = NewPipe.getServiceByUrl(url);
} catch (ExtractionException e) {
Toast.makeText(this, R.string.url_not_supported_toast, Toast.LENGTH_LONG).show();
return;
}
Intent callIntent = new Intent(this, PopupVideoPlayer.class);
switch (service.getLinkTypeByUrl(url)) {
case STREAM:
break;
default:
Toast.makeText(this, R.string.url_not_supported_toast, Toast.LENGTH_LONG).show();
return;
}
callIntent.putExtra(Constants.KEY_URL, url);
callIntent.putExtra(Constants.KEY_SERVICE_ID, service.getServiceId());
startService(callIntent);
finish();
}
}

View File

@@ -135,8 +135,12 @@ public class AboutActivity extends AppCompatActivity {
View githubLink = rootView.findViewById(R.id.github_link);
githubLink.setOnClickListener(new OnGithubLinkClickListener());
View licenseLink = rootView.findViewById(R.id.app_read_license);
licenseLink.setOnClickListener(new OnReadFullLicenseClickListener());
View donationLink = rootView.findViewById(R.id.donation_link);
donationLink.setOnClickListener(new OnDonationLinkClickListener());
View websiteLink = rootView.findViewById(R.id.website_link);
websiteLink.setOnClickListener(new OnWebsiteLinkClickListener());
return rootView;
}
@@ -149,10 +153,21 @@ public class AboutActivity extends AppCompatActivity {
}
}
private static class OnReadFullLicenseClickListener implements View.OnClickListener {
private static class OnDonationLinkClickListener implements View.OnClickListener {
@Override
public void onClick(View v) {
LicenseFragment.showLicense(v.getContext(), StandardLicenses.GPL3);
public void onClick(final View view) {
final Context context = view.getContext();
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(context.getString(R.string.donation_url)));
context.startActivity(intent);
}
}
private static class OnWebsiteLinkClickListener implements View.OnClickListener {
@Override
public void onClick(final View view) {
final Context context = view.getContext();
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(context.getString(R.string.website_url)));
context.startActivity(intent);
}
}
}

View File

@@ -62,6 +62,9 @@ public class LicenseFragment extends Fragment {
View rootView = inflater.inflate(R.layout.fragment_licenses, container, false);
ViewGroup softwareComponentsView = rootView.findViewById(R.id.software_components);
View licenseLink = rootView.findViewById(R.id.app_read_license);
licenseLink.setOnClickListener(new OnReadFullLicenseClickListener());
for (final SoftwareComponent component : softwareComponents) {
View componentView = inflater.inflate(R.layout.item_software_component, container, false);
TextView softwareName = componentView.findViewById(R.id.name);
@@ -119,4 +122,11 @@ public class LicenseFragment extends Fragment {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(componentLink));
startActivity(browserIntent);
}
private static class OnReadFullLicenseClickListener implements View.OnClickListener {
@Override
public void onClick(View v) {
LicenseFragment.showLicense(v.getContext(), StandardLicenses.GPL3);
}
}
}

View File

@@ -48,7 +48,7 @@ public class WatchHistoryEntry extends HistoryEntry {
}
public WatchHistoryEntry(StreamInfo streamInfo) {
this(new Date(), streamInfo.service_id, streamInfo.name, streamInfo.url,
this(new Date(), streamInfo.getServiceId(), streamInfo.getName(), streamInfo.getUrl(),
streamInfo.id, streamInfo.thumbnail_url, streamInfo.uploader_name, streamInfo.duration);
}

View File

@@ -116,10 +116,7 @@ public class SubscriptionEntity {
@Ignore
public ChannelInfoItem toChannelInfoItem() {
ChannelInfoItem item = new ChannelInfoItem();
item.url = getUrl();
item.service_id = getServiceId();
item.name = getName();
ChannelInfoItem item = new ChannelInfoItem(getServiceId(), getUrl(), getName());
item.thumbnail_url = getAvatarUrl();
item.subscriber_count = getSubscriberCount();
item.description = getDescription();

View File

@@ -108,8 +108,8 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
nameEditText = view.findViewById(R.id.file_name);
nameEditText.setText(FilenameUtils.createFilename(getContext(), currentInfo.name));
selectedAudioIndex = ListHelper.getDefaultAudioFormat(getContext(), currentInfo.audio_streams);
nameEditText.setText(FilenameUtils.createFilename(getContext(), currentInfo.getName()));
selectedAudioIndex = ListHelper.getDefaultAudioFormat(getContext(), currentInfo.getAudioStreams());
streamsSpinner = view.findViewById(R.id.quality_spinner);
streamsSpinner.setOnItemSelectedListener(this);
@@ -183,7 +183,7 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
String[] items = new String[audioStreams.size()];
for (int i = 0; i < audioStreams.size(); i++) {
AudioStream audioStream = audioStreams.get(i);
items[i] = MediaFormat.getNameById(audioStream.format) + " " + audioStream.average_bitrate + "kbps";
items[i] = audioStream.getFormat().getName() + " " + audioStream.getAverageBitrate() + "kbps";
}
ArrayAdapter<String> itemAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_dropdown_item, items);
@@ -242,7 +242,7 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
RadioButton audioButton = view.findViewById(R.id.audio_button);
RadioButton videoButton = view.findViewById(R.id.video_button);
if (currentInfo.audio_streams == null || currentInfo.audio_streams.size() == 0) {
if (currentInfo.getAudioStreams() == null || currentInfo.getAudioStreams().size() == 0) {
audioButton.setVisibility(View.GONE);
videoButton.setChecked(true);
} else if (sortedStreamVideosList == null || sortedStreamVideosList.size() == 0) {
@@ -256,14 +256,18 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
String url, location;
String fileName = nameEditText.getText().toString().trim();
if (fileName.isEmpty()) fileName = FilenameUtils.createFilename(getContext(), currentInfo.name);
if (fileName.isEmpty()) fileName = FilenameUtils.createFilename(getContext(), currentInfo.getName());
boolean isAudio = radioVideoAudioGroup.getCheckedRadioButtonId() == R.id.audio_button;
url = isAudio ? currentInfo.audio_streams.get(selectedAudioIndex).url : sortedStreamVideosList.get(selectedVideoIndex).url;
location = isAudio ? NewPipeSettings.getAudioDownloadPath(getContext()) : NewPipeSettings.getVideoDownloadPath(getContext());
if (isAudio) fileName += "." + MediaFormat.getSuffixById(currentInfo.audio_streams.get(selectedAudioIndex).format);
else fileName += "." + MediaFormat.getSuffixById(sortedStreamVideosList.get(selectedVideoIndex).format);
if (isAudio) {
url = currentInfo.getAudioStreams().get(selectedAudioIndex).getUrl();
location = NewPipeSettings.getAudioDownloadPath(getContext());
fileName += "." + currentInfo.getAudioStreams().get(selectedAudioIndex).getFormat().getSuffix();
} else {
url = sortedStreamVideosList.get(selectedVideoIndex).getUrl();
location = NewPipeSettings.getVideoDownloadPath(getContext());
fileName += "." + sortedStreamVideosList.get(selectedVideoIndex).getFormat().getSuffix();
}
DownloadManagerService.startMission(getContext(), url, location, fileName, isAudio, threadsSeekBar.getProgress() + 1);
getDialog().dismiss();

View File

@@ -1,6 +1,7 @@
package org.schabi.newpipe.fragments;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
@@ -50,6 +51,7 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
protected Button errorButtonRetry;
protected TextView errorTextView;
@State
protected boolean useAsFrontPage = false;
@Override
@@ -218,6 +220,7 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
if (serviceName == null) serviceName = "none";
if (request == null) request = "none";
ErrorActivity.reportError(getContext(), exception, MainActivity.class, null, ErrorActivity.ErrorInfo.make(userAction, serviceName, request, errorId));
}
@@ -238,4 +241,28 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
ErrorActivity.reportError(getContext(), exception, MainActivity.class, rootView, ErrorActivity.ErrorInfo.make(userAction, serviceName, request, errorId));
}
/*//////////////////////////////////////////////////////////////////////////
// Utils
//////////////////////////////////////////////////////////////////////////*/
public void setTitle(String title) {
if (DEBUG) Log.d(TAG, "setTitle() called with: title = [" + title + "]");
if (activity != null && activity.getSupportActionBar() != null) {
activity.getSupportActionBar().setTitle(title);
}
}
protected void openUrlInBrowser(String url) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(Intent.createChooser(intent, activity.getString(R.string.share_dialog_title)));
}
protected void shareUrl(String subject, String url) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_TEXT, url);
startActivity(Intent.createChooser(intent, getString(R.string.share_dialog_title)));
}
}

View File

@@ -2,6 +2,7 @@ package org.schabi.newpipe.fragments;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
@@ -22,6 +23,7 @@ import android.view.ViewGroup;
import org.schabi.newpipe.BaseFragment;
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.ServiceList;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.kiosk.KioskList;
import org.schabi.newpipe.fragments.list.channel.ChannelFragment;
@@ -30,30 +32,25 @@ import org.schabi.newpipe.fragments.list.kiosk.KioskFragment;
import org.schabi.newpipe.fragments.subscription.SubscriptionFragment;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.KioskTranslator;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.ThemeHelper;
import java.util.concurrent.ExecutionException;
public class MainFragment extends BaseFragment implements TabLayout.OnTabSelectedListener {
private ViewPager viewPager;
private boolean showBlankTab = false;
private static final int FALLBACK_SERVICE_ID = 0; // Youtbe
private static final String FALLBACK_CHANNEL_URL =
"https://www.youtube.com/channel/UC-9-kyTW8ZkZNDHQJ6FgpwQ";
private static final String FALLBACK_CHANNEL_NAME = "Music";
private static final String FALLBACK_KIOSK_ID = "Trending";
public int currentServiceId = -1;
private ViewPager viewPager;
/*//////////////////////////////////////////////////////////////////////////
// Konst
// Constants
//////////////////////////////////////////////////////////////////////////*/
private static final int KIOSK_MENU_OFFSETT = 2000;
private static final int FALLBACK_SERVICE_ID = ServiceList.YouTube.getId();
private static final String FALLBACK_CHANNEL_URL = "https://www.youtube.com/channel/UC-9-kyTW8ZkZNDHQJ6FgpwQ";
private static final String FALLBACK_CHANNEL_NAME = "Music";
private static final String FALLBACK_KIOSK_ID = "Trending";
private static final int KIOSK_MENU_OFFSET = 2000;
/*//////////////////////////////////////////////////////////////////////////
// Fragment's LifeCycle
@@ -66,9 +63,8 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
}
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
currentServiceId = Integer.parseInt(PreferenceManager.getDefaultSharedPreferences(getActivity())
.getString(getString(R.string.current_service_key), "0"));
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
currentServiceId = ServiceHelper.getSelectedServiceId(activity);
return inflater.inflate(R.layout.fragment_main, container, false);
}
@@ -86,27 +82,15 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
tabLayout.setupWithViewPager(viewPager);
if(ThemeHelper.isLightThemeSelected(getActivity())) {
tabLayout.setBackgroundColor(getResources().getColor(R.color.light_youtube_primary_color));
}
int channelIcon = ThemeHelper.resolveResourceIdFromAttr(activity, R.attr.ic_channel);
int whatsHotIcon = ThemeHelper.resolveResourceIdFromAttr(activity, R.attr.ic_hot);
if(PreferenceManager.getDefaultSharedPreferences(getActivity())
.getString(getString(R.string.main_page_content_key), getString(R.string.blank_page_key))
.equals(getString(R.string.subscription_page_key))) {
if(ThemeHelper.isLightThemeSelected(getActivity())) {
tabLayout.getTabAt(0).setIcon(R.drawable.ic_channel_black_24dp);
} else{
tabLayout.getTabAt(0).setIcon(R.drawable.ic_channel_white_24dp);
}
} else {
if(ThemeHelper.isLightThemeSelected(getActivity())) {
tabLayout.getTabAt(0).setIcon(R.drawable.ic_whatshot_black_24dp);
tabLayout.getTabAt(1).setIcon(R.drawable.ic_channel_black_24dp);
} else {
tabLayout.getTabAt(0).setIcon(R.drawable.ic_whatshot_white_24dp);
tabLayout.getTabAt(1).setIcon(R.drawable.ic_channel_white_24dp);
}
}
if (isSubscriptionsPageOnlySelected()) {
tabLayout.getTabAt(0).setIcon(channelIcon);
} else {
tabLayout.getTabAt(0).setIcon(whatsHotIcon);
tabLayout.getTabAt(1).setIcon(channelIcon);
}
}
/*//////////////////////////////////////////////////////////////////////////
@@ -139,7 +123,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_search:
NavigationHelper.openSearchFragment(getFragmentManager(), 0, "");
NavigationHelper.openSearchFragment(getFragmentManager(), ServiceHelper.getSelectedServiceId(activity), "");
return true;
}
return super.onOptionsItemSelected(item);
@@ -164,11 +148,6 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
private class PagerAdapter extends FragmentPagerAdapter {
private int[] tabTitles = new int[]{
R.string.tab_main,
R.string.tab_subscriptions
};
PagerAdapter(FragmentManager fm) {
super(fm);
}
@@ -177,13 +156,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
public Fragment getItem(int position) {
switch (position) {
case 0:
if(PreferenceManager.getDefaultSharedPreferences(getActivity())
.getString(getString(R.string.main_page_content_key), getString(R.string.blank_page_key))
.equals(getString(R.string.subscription_page_key))) {
return new SubscriptionFragment();
} else {
return getMainPageFramgent();
}
return isSubscriptionsPageOnlySelected() ? new SubscriptionFragment() : getMainPageFragment();
case 1:
return new SubscriptionFragment();
default:
@@ -199,13 +172,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
@Override
public int getCount() {
if(PreferenceManager.getDefaultSharedPreferences(getActivity())
.getString(getString(R.string.main_page_content_key), getString(R.string.blank_page_key))
.equals(getString(R.string.subscription_page_key))) {
return 1;
} else {
return 2;
}
return isSubscriptionsPageOnlySelected() ? 1 : 2;
}
}
@@ -213,28 +180,33 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
// Main page content
//////////////////////////////////////////////////////////////////////////*/
private Fragment getMainPageFramgent() {
private boolean isSubscriptionsPageOnlySelected() {
return PreferenceManager.getDefaultSharedPreferences(activity)
.getString(getString(R.string.main_page_content_key), getString(R.string.blank_page_key))
.equals(getString(R.string.subscription_page_key));
}
private Fragment getMainPageFragment() {
try {
SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(getActivity());
final String setMainPage = preferences.getString(getString(R.string.main_page_content_key),
getString(R.string.main_page_selectd_kiosk_id));
if(setMainPage.equals(getString(R.string.blank_page_key))) {
getString(R.string.main_page_selectd_kiosk_id));
if (setMainPage.equals(getString(R.string.blank_page_key))) {
return new BlankFragment();
} else if(setMainPage.equals(getString(R.string.kiosk_page_key))) {
} else if (setMainPage.equals(getString(R.string.kiosk_page_key))) {
int serviceId = preferences.getInt(getString(R.string.main_page_selected_service),
FALLBACK_SERVICE_ID);
String kioskId = preferences.getString(getString(R.string.main_page_selectd_kiosk_id),
FALLBACK_KIOSK_ID);
KioskFragment fragment = KioskFragment.getInstance(serviceId, kioskId
);
KioskFragment fragment = KioskFragment.getInstance(serviceId, kioskId);
fragment.useAsFrontPage(true);
return fragment;
} else if(setMainPage.equals(getString(R.string.feed_page_key))) {
} else if (setMainPage.equals(getString(R.string.feed_page_key))) {
FeedFragment fragment = new FeedFragment();
fragment.useAsFrontPage(true);
return fragment;
} else if(setMainPage.equals(getString(R.string.channel_page_key))) {
} else if (setMainPage.equals(getString(R.string.channel_page_key))) {
int serviceId = preferences.getInt(getString(R.string.main_page_selected_service),
FALLBACK_SERVICE_ID);
String url = preferences.getString(getString(R.string.main_page_selected_channel_url),
@@ -267,8 +239,8 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
StreamingService service = NewPipe.getService(currentServiceId);
KioskList kl = service.getKioskList();
int i = 0;
for(final String ks : kl.getAvailableKiosks()) {
menu.add(0, KIOSK_MENU_OFFSETT + i, Menu.NONE,
for (final String ks : kl.getAvailableKiosks()) {
menu.add(0, KIOSK_MENU_OFFSET + i, Menu.NONE,
KioskTranslator.getTranslatedKioskName(ks, getContext()))
.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override

View File

@@ -60,7 +60,7 @@ public class SpinnerToolbarAdapter extends BaseAdapter {
ImageView woSoundIcon = convertView.findViewById(R.id.wo_sound_icon);
TextView text = convertView.findViewById(android.R.id.text1);
VideoStream item = (VideoStream) getItem(position);
text.setText(MediaFormat.getNameById(item.format) + " " + item.resolution);
text.setText(item.getFormat().getName() + " " + item.getResolution());
int visibility = !showIconNoAudio ? View.GONE
: item.isVideoOnly ? View.VISIBLE

View File

@@ -4,7 +4,8 @@ import java.io.Serializable;
class StackItem implements Serializable {
private int serviceId;
private String title, url;
private String title;
private String url;
StackItem(int serviceId, String url, String title) {
this.serviceId = serviceId;

View File

@@ -1,15 +1,21 @@
package org.schabi.newpipe.fragments.list;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.InfoItem;
@@ -19,8 +25,11 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.fragments.BaseStateFragment;
import org.schabi.newpipe.fragments.OnScrollBelowItemsListener;
import org.schabi.newpipe.info_list.InfoItemBuilder;
import org.schabi.newpipe.info_list.InfoItemDialog;
import org.schabi.newpipe.info_list.InfoListAdapter;
import org.schabi.newpipe.playlist.SinglePlayQueue;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PermissionHelper;
import org.schabi.newpipe.util.StateSaver;
import java.util.List;
@@ -137,7 +146,12 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
onItemSelected(selectedItem);
NavigationHelper.openVideoDetailFragment(
useAsFrontPage?getParentFragment().getFragmentManager():getFragmentManager(),
selectedItem.service_id, selectedItem.url, selectedItem.name);
selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName());
}
@Override
public void held(StreamInfoItem selectedItem) {
showStreamDialog(selectedItem);
}
});
@@ -147,8 +161,11 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
onItemSelected(selectedItem);
NavigationHelper.openChannelFragment(
useAsFrontPage?getParentFragment().getFragmentManager():getFragmentManager(),
selectedItem.service_id, selectedItem.url, selectedItem.name);
selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName());
}
@Override
public void held(ChannelInfoItem selectedItem) {}
});
infoListAdapter.setOnPlaylistSelectedListener(new InfoItemBuilder.OnInfoItemSelectedListener<PlaylistInfoItem>() {
@@ -157,8 +174,11 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
onItemSelected(selectedItem);
NavigationHelper.openPlaylistFragment(
useAsFrontPage?getParentFragment().getFragmentManager():getFragmentManager(),
selectedItem.service_id, selectedItem.url, selectedItem.name);
selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName());
}
@Override
public void held(PlaylistInfoItem selectedItem) {}
});
itemsList.clearOnScrollListeners();
@@ -176,6 +196,34 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
}
}
protected void showStreamDialog(final StreamInfoItem item) {
final Context context = getContext();
final Activity activity = getActivity();
if (context == null || context.getResources() == null || getActivity() == null) return;
final String[] commands = new String[]{
context.getResources().getString(R.string.enqueue_on_background),
context.getResources().getString(R.string.enqueue_on_popup)
};
final DialogInterface.OnClickListener actions = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
switch (i) {
case 0:
NavigationHelper.enqueueOnBackgroundPlayer(context, new SinglePlayQueue(item));
break;
case 1:
NavigationHelper.enqueueOnPopupPlayer(activity, new SinglePlayQueue(item));
break;
default:
break;
}
}
};
new InfoItemDialog(getActivity(), item, commands, actions).show();
}
/*//////////////////////////////////////////////////////////////////////////
// Menu
//////////////////////////////////////////////////////////////////////////*/

View File

@@ -84,17 +84,6 @@ public abstract class BaseListInfoFragment<I extends ListInfo> extends BaseListF
currentNextItemsUrl = (String) savedObjects.poll();
}
/*//////////////////////////////////////////////////////////////////////////
// Utils
//////////////////////////////////////////////////////////////////////////*/
public void setTitle(String title) {
Log.d(TAG, "setTitle() called with: title = [" + title + "]");
if (activity.getSupportActionBar() != null) {
activity.getSupportActionBar().setTitle(title);
}
}
/*//////////////////////////////////////////////////////////////////////////
// Load and handle
//////////////////////////////////////////////////////////////////////////*/
@@ -124,20 +113,12 @@ public abstract class BaseListInfoFragment<I extends ListInfo> extends BaseListF
currentWorker = loadResult(forceLoad)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<I>() {
@Override
public void accept(@NonNull I result) throws Exception {
isLoading.set(false);
currentInfo = result;
currentNextItemsUrl = result.next_streams_url;
handleResult(result);
}
}, new Consumer<Throwable>() {
@Override
public void accept(@NonNull Throwable throwable) throws Exception {
onError(throwable);
}
});
.subscribe((@NonNull I result) -> {
isLoading.set(false);
currentInfo = result;
currentNextItemsUrl = result.next_streams_url;
handleResult(result);
}, (@NonNull Throwable throwable) -> onError(throwable));
}
/**
@@ -153,18 +134,12 @@ public abstract class BaseListInfoFragment<I extends ListInfo> extends BaseListF
currentWorker = loadMoreItemsLogic()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ListExtractor.NextItemsResult>() {
@Override
public void accept(@io.reactivex.annotations.NonNull ListExtractor.NextItemsResult nextItemsResult) throws Exception {
isLoading.set(false);
handleNextItems(nextItemsResult);
}
}, new Consumer<Throwable>() {
@Override
public void accept(@io.reactivex.annotations.NonNull Throwable throwable) throws Exception {
isLoading.set(false);
onError(throwable);
}
.subscribe((@io.reactivex.annotations.NonNull ListExtractor.NextItemsResult nextItemsResult) -> {
isLoading.set(false);
handleNextItems(nextItemsResult);
}, (@io.reactivex.annotations.NonNull Throwable throwable) -> {
isLoading.set(false);
onError(throwable);
});
}
@@ -190,8 +165,8 @@ public abstract class BaseListInfoFragment<I extends ListInfo> extends BaseListF
public void handleResult(@NonNull I result) {
super.handleResult(result);
url = result.url;
name = result.name;
url = result.getUrl();
name = result.getName();
setTitle(name);
if (infoListAdapter.getItemsList().size() == 0) {

View File

@@ -297,12 +297,12 @@ public class FeedFragment extends BaseListFragment<List<SubscriptionEntity>, Voi
// Called only when response is non-empty
@Override
public void onSuccess(final ChannelInfo channelInfo) {
if (infoListAdapter == null || channelInfo.related_streams.isEmpty()) {
if (infoListAdapter == null || channelInfo.getRelatedStreams().isEmpty()) {
onDone();
return;
}
final InfoItem item = channelInfo.related_streams.get(0);
final InfoItem item = channelInfo.getRelatedStreams().get(0);
// Keep requesting new items if the current one already exists
boolean itemExists = doesItemExist(infoListAdapter.getItemsList(), item);
if (!itemExists) {
@@ -412,9 +412,9 @@ public class FeedFragment extends BaseListFragment<List<SubscriptionEntity>, Voi
private boolean doesItemExist(final List<InfoItem> items, final InfoItem item) {
for (final InfoItem existingItem : items) {
if (existingItem.info_type == item.info_type &&
existingItem.service_id == item.service_id &&
existingItem.name.equals(item.name) &&
existingItem.url.equals(item.url)) return true;
existingItem.getServiceId() == item.getServiceId() &&
existingItem.getName().equals(item.getName()) &&
existingItem.getUrl().equals(item.getUrl())) return true;
}
return false;
}

View File

@@ -5,6 +5,7 @@ import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@@ -27,6 +28,7 @@ import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.KioskTranslator;
import org.schabi.newpipe.util.NavigationHelper;
import icepick.State;
import io.reactivex.Single;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
@@ -53,16 +55,14 @@ import static org.schabi.newpipe.util.AnimationUtils.animateView;
public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
private String kioskId = "";
@State
protected String kioskId = "";
protected String kioskTranslatedName;
/*//////////////////////////////////////////////////////////////////////////
// Views
//////////////////////////////////////////////////////////////////////////*/
private View headerRootLayout;
private TextView headerTitleView;
public static KioskFragment getInstance(int serviceId)
throws ExtractionException {
return getInstance(serviceId, NewPipe.getService(serviceId)
@@ -87,20 +87,30 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
// LifeCycle
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
kioskTranslatedName = KioskTranslator.getTranslatedKioskName(kioskId, activity);
name = kioskTranslatedName;
}
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if(useAsFrontPage && isVisibleToUser) {
if(useAsFrontPage && isVisibleToUser && activity != null) {
try {
activity.getSupportActionBar().setTitle(KioskTranslator.getTranslatedKioskName(kioskId, getActivity()));
setTitle(kioskTranslatedName);
} catch (Exception e) {
onError(e);
onUnrecoverableError(e, UserAction.UI_ERROR,
"none",
"none", R.string.app_ui_crash);
}
}
}
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_kiosk, container, false);
}
@@ -125,14 +135,18 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
public Single<KioskInfo> loadResult(boolean forceReload) {
String contentCountry = PreferenceManager
.getDefaultSharedPreferences(activity)
.getString(getString(R.string.search_language_key),
getString(R.string.default_language_value));
.getString(getString(R.string.content_country_key),
getString(R.string.default_country_value));
return ExtractorHelper.getKioskInfo(serviceId, url, contentCountry, forceReload);
}
@Override
public Single<ListExtractor.NextItemsResult> loadMoreItemsLogic() {
return ExtractorHelper.getMoreKioskItems(serviceId, url, currentNextItemsUrl);
String contentCountry = PreferenceManager
.getDefaultSharedPreferences(activity)
.getString(getString(R.string.content_country_key),
getString(R.string.default_country_value));
return ExtractorHelper.getMoreKioskItems(serviceId, url, currentNextItemsUrl, contentCountry);
}
/*//////////////////////////////////////////////////////////////////////////
@@ -149,14 +163,13 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
public void handleResult(@NonNull final KioskInfo result) {
super.handleResult(result);
String title = KioskTranslator.getTranslatedKioskName(result.id, getActivity());
ActionBar supportActionBar = activity.getSupportActionBar();
supportActionBar.setTitle(title);
name = kioskTranslatedName;
setTitle(kioskTranslatedName);
if (!result.errors.isEmpty()) {
showSnackBarError(result.errors,
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(),
UserAction.REQUESTED_PLAYLIST,
NewPipe.getNameOfService(result.service_id), result.url, 0);
NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);
}
}
@@ -164,8 +177,8 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
public void handleNextItems(ListExtractor.NextItemsResult result) {
super.handleNextItems(result);
if (!result.errors.isEmpty()) {
showSnackBarError(result.errors,
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(),
UserAction.REQUESTED_PLAYLIST, NewPipe.getNameOfService(serviceId)
, "Get next page of: " + url, 0);
}

View File

@@ -1,38 +1,36 @@
package org.schabi.newpipe.fragments.list.playlist;
import android.content.Intent;
import android.os.Build;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.ListExtractor;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.playlist.PlaylistInfo;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.fragments.list.BaseListInfoFragment;
import org.schabi.newpipe.player.BackgroundPlayer;
import org.schabi.newpipe.player.MainVideoPlayer;
import org.schabi.newpipe.player.PopupVideoPlayer;
import org.schabi.newpipe.playlist.ExternalPlayQueue;
import org.schabi.newpipe.info_list.InfoItemDialog;
import org.schabi.newpipe.playlist.PlayQueue;
import org.schabi.newpipe.playlist.PlaylistPlayQueue;
import org.schabi.newpipe.playlist.SinglePlayQueue;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PermissionHelper;
import io.reactivex.Single;
@@ -50,10 +48,11 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
private TextView headerUploaderName;
private ImageView headerUploaderAvatar;
private TextView headerStreamCount;
private View playlistCtrl;
private Button headerPlayAllButton;
private Button headerPopupButton;
private Button headerBackgroundButton;
private View headerPlayAllButton;
private View headerPopupButton;
private View headerBackgroundButton;
public static PlaylistFragment getInstance(int serviceId, String url, String name) {
PlaylistFragment instance = new PlaylistFragment();
@@ -81,10 +80,11 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
headerUploaderName = headerRootLayout.findViewById(R.id.uploader_name);
headerUploaderAvatar = headerRootLayout.findViewById(R.id.uploader_avatar_view);
headerStreamCount = headerRootLayout.findViewById(R.id.playlist_stream_count);
playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control);
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_play_all_button);
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_play_popup_button);
headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_play_bg_button);
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button);
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button);
headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button);
return headerRootLayout;
}
@@ -96,6 +96,49 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
infoListAdapter.useMiniItemVariants(true);
}
@Override
protected void showStreamDialog(final StreamInfoItem item) {
final Context context = getContext();
final Activity activity = getActivity();
if (context == null || context.getResources() == null || getActivity() == null) return;
final String[] commands = new String[]{
context.getResources().getString(R.string.enqueue_on_background),
context.getResources().getString(R.string.enqueue_on_popup),
context.getResources().getString(R.string.start_here_on_main),
context.getResources().getString(R.string.start_here_on_background),
context.getResources().getString(R.string.start_here_on_popup),
};
final DialogInterface.OnClickListener actions = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
final int index = Math.max(infoListAdapter.getItemsList().indexOf(item), 0);
switch (i) {
case 0:
NavigationHelper.enqueueOnBackgroundPlayer(context, new SinglePlayQueue(item));
break;
case 1:
NavigationHelper.enqueueOnPopupPlayer(activity, new SinglePlayQueue(item));
break;
case 2:
NavigationHelper.playOnMainPlayer(context, getPlayQueue(index));
break;
case 3:
NavigationHelper.playOnBackgroundPlayer(context, getPlayQueue(index));
break;
case 4:
NavigationHelper.playOnPopupPlayer(activity, getPlayQueue(index));
break;
default:
break;
}
}
};
new InfoItemDialog(getActivity(), item, commands, actions).show();
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
if (DEBUG) Log.d(TAG, "onCreateOptionsMenu() called with: menu = [" + menu + "], inflater = [" + inflater + "]");
@@ -117,6 +160,23 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
return ExtractorHelper.getPlaylistInfo(serviceId, url, forceLoad);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_item_openInBrowser:
openUrlInBrowser(url);
break;
case R.id.menu_item_share: {
shareUrl(name, url);
break;
}
default:
return super.onOptionsItemSelected(item);
}
return true;
}
/*//////////////////////////////////////////////////////////////////////////
// Contract
//////////////////////////////////////////////////////////////////////////*/
@@ -138,69 +198,67 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
animateView(headerRootLayout, true, 100);
animateView(headerUploaderLayout, true, 300);
headerUploaderLayout.setOnClickListener(null);
if (!TextUtils.isEmpty(result.uploader_name)) {
headerUploaderName.setText(result.uploader_name);
if (!TextUtils.isEmpty(result.uploader_url)) {
if (!TextUtils.isEmpty(result.getUploaderName())) {
headerUploaderName.setText(result.getUploaderName());
if (!TextUtils.isEmpty(result.getUploaderUrl())) {
headerUploaderLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
NavigationHelper.openChannelFragment(getFragmentManager(), result.service_id, result.uploader_url, result.uploader_name);
NavigationHelper.openChannelFragment(getFragmentManager(), result.getServiceId(), result.getUploaderUrl(), result.getUploaderName());
}
});
}
}
imageLoader.displayImage(result.uploader_avatar_url, headerUploaderAvatar, DISPLAY_AVATAR_OPTIONS);
playlistCtrl.setVisibility(View.VISIBLE);
imageLoader.displayImage(result.getUploaderAvatarUrl(), headerUploaderAvatar, DISPLAY_AVATAR_OPTIONS);
headerStreamCount.setText(getResources().getQuantityString(R.plurals.videos, (int) result.stream_count, (int) result.stream_count));
if (!result.errors.isEmpty()) {
showSnackBarError(result.errors, UserAction.REQUESTED_PLAYLIST, NewPipe.getNameOfService(result.service_id), result.url, 0);
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(), UserAction.REQUESTED_PLAYLIST, NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);
}
headerPlayAllButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(buildPlaylistIntent(MainVideoPlayer.class));
NavigationHelper.playOnMainPlayer(activity, getPlayQueue());
}
});
headerPopupButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !PermissionHelper.checkSystemAlertWindowPermission(activity)) {
Toast toast = Toast.makeText(activity, R.string.msg_popup_permission, Toast.LENGTH_LONG);
TextView messageView = toast.getView().findViewById(android.R.id.message);
if (messageView != null) messageView.setGravity(Gravity.CENTER);
toast.show();
return;
}
activity.startService(buildPlaylistIntent(PopupVideoPlayer.class));
NavigationHelper.playOnPopupPlayer(activity, getPlayQueue());
}
});
headerBackgroundButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
activity.startService(buildPlaylistIntent(BackgroundPlayer.class));
NavigationHelper.playOnBackgroundPlayer(activity, getPlayQueue());
}
});
}
private Intent buildPlaylistIntent(final Class targetClazz) {
final PlayQueue playQueue = new ExternalPlayQueue(
currentInfo.service_id,
currentInfo.url,
currentInfo.next_streams_url,
private PlayQueue getPlayQueue() {
return getPlayQueue(0);
}
private PlayQueue getPlayQueue(final int index) {
return new PlaylistPlayQueue(
currentInfo.getServiceId(),
currentInfo.getUrl(),
currentInfo.getNextStreamsUrl(),
infoListAdapter.getItemsList(),
0
index
);
return NavigationHelper.getPlayerIntent(activity, targetClazz, playQueue);
}
@Override
public void handleNextItems(ListExtractor.NextItemsResult result) {
super.handleNextItems(result);
if (!result.errors.isEmpty()) {
showSnackBarError(result.errors, UserAction.REQUESTED_PLAYLIST, NewPipe.getNameOfService(serviceId)
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(), UserAction.REQUESTED_PLAYLIST, NewPipe.getNameOfService(serviceId)
, "Get next page of: " + url, 0);
}
}

View File

@@ -111,7 +111,7 @@ public class SearchFragment extends BaseListFragment<SearchResult, ListExtractor
private int currentPage = 0;
private int currentNextPage = 0;
private String searchLanguage;
private String contentCountry;
private boolean isSuggestionsEnabled = true;
private boolean isSearchHistoryEnabled = true;
@@ -165,7 +165,7 @@ public class SearchFragment extends BaseListFragment<SearchResult, ListExtractor
suggestionListAdapter = new SuggestionListAdapter(activity);
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
isSearchHistoryEnabled = preferences.getBoolean(getString(R.string.enable_search_history_key), true);
suggestionListAdapter.setShowSugestinHistory(isSearchHistoryEnabled);
suggestionListAdapter.setShowSuggestionHistory(isSearchHistoryEnabled);
searchHistoryDAO = NewPipeDatabase.getInstance().searchHistoryDAO();
}
@@ -176,7 +176,7 @@ public class SearchFragment extends BaseListFragment<SearchResult, ListExtractor
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
isSuggestionsEnabled = preferences.getBoolean(getString(R.string.show_search_suggestions_key), true);
searchLanguage = preferences.getString(getString(R.string.search_language_key), getString(R.string.default_language_value));
contentCountry = preferences.getString(getString(R.string.content_country_key), getString(R.string.default_country_value));
}
@Override
@@ -446,6 +446,12 @@ public class SearchFragment extends BaseListFragment<SearchResult, ListExtractor
searchEditText.setText(item.query);
}
@Override
public void onSuggestionItemInserted(SuggestionItem item) {
searchEditText.setText(item.query);
searchEditText.setSelection(searchEditText.getText().length());
}
@Override
public void onSuggestionItemLongClick(SuggestionItem item) {
if (item.fromHistory) showDeleteSuggestionDialog(item);
@@ -613,7 +619,7 @@ public class SearchFragment extends BaseListFragment<SearchResult, ListExtractor
return local.materialize();
}
final Observable<List<SuggestionItem>> network = ExtractorHelper.suggestionsFor(serviceId, query, searchLanguage).toObservable()
final Observable<List<SuggestionItem>> network = ExtractorHelper.suggestionsFor(serviceId, query, contentCountry).toObservable()
.map(new Function<List<String>, List<SuggestionItem>>() {
@Override
public List<SuggestionItem> apply(@io.reactivex.annotations.NonNull List<String> strings) throws Exception {
@@ -725,7 +731,7 @@ public class SearchFragment extends BaseListFragment<SearchResult, ListExtractor
super.startLoading(forceLoad);
if (disposables != null) disposables.clear();
if (searchDisposable != null) searchDisposable.dispose();
searchDisposable = ExtractorHelper.searchFor(serviceId, searchQuery, currentPage, searchLanguage, filter)
searchDisposable = ExtractorHelper.searchFor(serviceId, searchQuery, currentPage, contentCountry, filter)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<SearchResult>() {
@@ -749,7 +755,7 @@ public class SearchFragment extends BaseListFragment<SearchResult, ListExtractor
showListFooter(true);
if (searchDisposable != null) searchDisposable.dispose();
currentNextPage = currentPage + 1;
searchDisposable = ExtractorHelper.getMoreSearchItems(serviceId, searchQuery, currentNextPage, searchLanguage, filter)
searchDisposable = ExtractorHelper.getMoreSearchItems(serviceId, searchQuery, currentNextPage, contentCountry, filter)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<ListExtractor.NextItemsResult>() {
@@ -855,8 +861,8 @@ public class SearchFragment extends BaseListFragment<SearchResult, ListExtractor
lastSearchedQuery = searchQuery;
if (infoListAdapter.getItemsList().size() == 0) {
if (result.resultList.size() > 0) {
infoListAdapter.addInfoItemList(result.resultList);
if (!result.getResults().isEmpty()) {
infoListAdapter.addInfoItemList(result.getResults());
} else {
infoListAdapter.clearStreamItemList();
showEmptyState();
@@ -870,11 +876,11 @@ public class SearchFragment extends BaseListFragment<SearchResult, ListExtractor
@Override
public void handleNextItems(ListExtractor.NextItemsResult result) {
showListFooter(false);
currentPage = Integer.parseInt(result.nextItemsUrl);
infoListAdapter.addInfoItemList(result.nextItemsList);
currentPage = Integer.parseInt(result.getNextItemsUrl());
infoListAdapter.addInfoItemList(result.getNextItemsList());
if (!result.errors.isEmpty()) {
showSnackBarError(result.errors, UserAction.SEARCHED, NewPipe.getNameOfService(serviceId)
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(), UserAction.SEARCHED, NewPipe.getNameOfService(serviceId)
, "\"" + searchQuery + "\" → page " + currentPage, 0);
}
super.handleNextItems(result);

View File

@@ -19,10 +19,11 @@ public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAd
private final ArrayList<SuggestionItem> items = new ArrayList<>();
private final Context context;
private OnSuggestionItemSelected listener;
private boolean showSugestinHistory = true;
private boolean showSuggestionHistory = true;
public interface OnSuggestionItemSelected {
void onSuggestionItemSelected(SuggestionItem item);
void onSuggestionItemInserted(SuggestionItem item);
void onSuggestionItemLongClick(SuggestionItem item);
}
@@ -32,7 +33,7 @@ public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAd
public void setItems(List<SuggestionItem> items) {
this.items.clear();
if (showSugestinHistory) {
if (showSuggestionHistory) {
this.items.addAll(items);
} else {
// remove history items if history is disabled
@@ -49,8 +50,8 @@ public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAd
this.listener = listener;
}
public void setShowSugestinHistory(boolean v) {
showSugestinHistory = v;
public void setShowSuggestionHistory(boolean v) {
showSuggestionHistory = v;
}
@Override
@@ -62,19 +63,25 @@ public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAd
public void onBindViewHolder(SuggestionItemHolder holder, int position) {
final SuggestionItem currentItem = getItem(position);
holder.updateFrom(currentItem);
holder.itemView.setOnClickListener(new View.OnClickListener() {
holder.queryView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (listener != null) listener.onSuggestionItemSelected(currentItem);
}
});
holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
holder.queryView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
if (listener != null) listener.onSuggestionItemLongClick(currentItem);
return true;
}
});
holder.insertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (listener != null) listener.onSuggestionItemInserted(currentItem);
}
});
}
private SuggestionItem getItem(int position) {
@@ -93,6 +100,8 @@ public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAd
public static class SuggestionItemHolder extends RecyclerView.ViewHolder {
private final TextView itemSuggestionQuery;
private final ImageView suggestionIcon;
private final View queryView;
private final View insertView;
// Cache some ids, as they can potentially be constantly updated/recycled
private final int historyResId;
@@ -103,6 +112,9 @@ public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAd
suggestionIcon = rootView.findViewById(R.id.item_suggestion_icon);
itemSuggestionQuery = rootView.findViewById(R.id.item_suggestion_query);
queryView = rootView.findViewById(R.id.suggestion_search);
insertView = rootView.findViewById(R.id.suggestion_insert);
historyResId = resolveResourceIdFromAttr(rootView.getContext(), R.attr.history);
searchResId = resolveResourceIdFromAttr(rootView.getContext(), R.attr.search);
}

Some files were not shown because too many files have changed in this diff Show More