1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2026-01-13 18:22:41 +00:00

Compare commits

..

1925 Commits

Author SHA1 Message Date
Tobias Groza
3c306a0971 Merge pull request #5067 from Isira-Seneviratne/Add_workaround_for_null_offset_ID
Add a workaround for a possible null offset ID.
2020-12-10 11:37:18 +01:00
Isira Seneviratne
c0d6c8aeb3 Add a workaround for a possible null offset ID. 2020-12-10 15:23:30 +05:30
TobiGr
b27b49e4f3 Update NewPipe Extractor to 0.20.6 2020-12-09 23:46:55 +01:00
TobiGr
7ed0dbcf1a Release 0.20.6 (960) 2020-12-09 23:43:02 +01:00
TobiGr
8a23de6b20 Version code 960, not 970... 2020-12-09 23:40:54 +01:00
TobiGr
6cc3089204 Add changelog for 0.20.6 2020-12-09 23:37:26 +01:00
TobiGr
093e95c078 Merge remote-tracking branch 'Weblate/dev' into dev 2020-12-09 23:33:43 +01:00
Milo Ivir
7c8ac04e35 Translated using Weblate (Croatian)
Currently translated at 99.6% (607 of 609 strings)
2020-12-09 23:32:24 +01:00
Enol P
dc88f8b172 Translated using Weblate (Asturian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-09 23:31:35 +01:00
Igor Nedoboy
c94f0ded27 Translated using Weblate (Russian)
Currently translated at 7.5% (3 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ru/
2020-12-08 15:29:10 +01:00
David Braz
b553aa2159 Translated using Weblate (Portuguese (Brazil))
Currently translated at 25.0% (10 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_BR/
2020-12-08 15:29:09 +01:00
Deleted User
a7bd2666f0 Translated using Weblate (Malay)
Currently translated at 67.3% (410 of 609 strings)
2020-12-08 15:29:08 +01:00
David Braz
fe2fc60581 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (609 of 609 strings)
2020-12-08 15:29:08 +01:00
simo
ce59c05d5b Translated using Weblate (Arabic)
Currently translated at 100.0% (609 of 609 strings)
2020-12-08 15:29:08 +01:00
zeritti
a4858bc702 Translated using Weblate (Czech)
Currently translated at 100.0% (609 of 609 strings)
2020-12-08 15:29:07 +01:00
pjammo
a2bb58a991 Translated using Weblate (Italian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-08 15:29:07 +01:00
Francesco Saltori
f7b41227d2 Translated using Weblate (Italian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-08 15:29:07 +01:00
Igor Nedoboy
5b1a6831d5 Translated using Weblate (Russian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-08 15:29:06 +01:00
nautilusx
42b1bbe414 Translated using Weblate (German)
Currently translated at 100.0% (609 of 609 strings)
2020-12-08 15:29:06 +01:00
Tobias Groza
db9f20a22f Merge pull request #4961 from TeamNewPipe/lint
Fix some Lint errors
2020-12-07 11:19:01 +01:00
nautilusx
cf67b592da Translated using Weblate (German)
Currently translated at 100.0% (609 of 609 strings)
2020-12-06 19:08:14 +01:00
domifi
e867bfbc82 Translated using Weblate (German)
Currently translated at 100.0% (609 of 609 strings)
2020-12-06 19:08:14 +01:00
Igor Nedoboy
9a671851df Translated using Weblate (Russian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 12:08:13 +01:00
Igor Nedoboy
4b92f78cc8 Translated using Weblate (Russian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 11:43:29 +01:00
Allan Nordhøy
c585982557 Translated using Weblate (Norwegian Bokmål)
Currently translated at 12.5% (5 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/nb_NO/
2020-12-05 11:29:08 +01:00
Michal L
6bf22e7ad0 Translated using Weblate (Polish)
Currently translated at 47.5% (19 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pl/
2020-12-05 11:29:08 +01:00
Sérgio Marques
2f8dccf7f6 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 11:29:07 +01:00
Allan Nordhøy
027768d97d Translated using Weblate (Norwegian Bokmål)
Currently translated at 93.5% (570 of 609 strings)
2020-12-05 11:29:07 +01:00
Jeff Huang
085f63b8c5 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 11:29:07 +01:00
Eric
6f7c337e00 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 11:29:06 +01:00
Michal L
16a968f3bb Translated using Weblate (Polish)
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 11:29:06 +01:00
zmni
d7e0167fed Translated using Weblate (Indonesian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 11:29:06 +01:00
simo
41c4f515cf Translated using Weblate (Arabic)
Currently translated at 99.8% (608 of 609 strings)
2020-12-05 11:29:06 +01:00
Sérgio Marques
d9a8218372 Translated using Weblate (Portuguese)
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 11:29:05 +01:00
Francesco Saltori
dd9bd4da8b Translated using Weblate (Italian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 11:29:05 +01:00
pitachips
cf98500b7f Translated using Weblate (Korean)
Currently translated at 85.2% (519 of 609 strings)
2020-12-05 11:29:05 +01:00
2-Seol
2ce8facc05 Translated using Weblate (Korean)
Currently translated at 85.2% (519 of 609 strings)
2020-12-05 11:29:05 +01:00
Kaede
d1b117d07c Translated using Weblate (Japanese)
Currently translated at 99.8% (608 of 609 strings)
2020-12-05 11:29:04 +01:00
xxkfqz
c0377c7ebf Translated using Weblate (Russian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 11:29:04 +01:00
Ács Zoltán
a2490a5730 Translated using Weblate (Hungarian)
Currently translated at 68.6% (418 of 609 strings)
2020-12-05 11:29:04 +01:00
JoC
177334ba62 Translated using Weblate (Spanish)
Currently translated at 100.0% (609 of 609 strings)
2020-12-05 11:29:03 +01:00
Kaede
7bce588767 Translated using Weblate (Japanese)
Currently translated at 99.8% (608 of 609 strings)
2020-12-04 03:26:00 +01:00
hdringanioooboo
4bb67c634f Translated using Weblate (Japanese)
Currently translated at 99.8% (608 of 609 strings)
2020-12-04 03:26:00 +01:00
ssantos
3653afbcc4 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (609 of 609 strings)
2020-12-03 11:04:03 +01:00
Sérgio Marques
1f4a4ea09f Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (609 of 609 strings)
2020-12-03 11:04:03 +01:00
ssantos
3d38add4b4 Translated using Weblate (Portuguese)
Currently translated at 100.0% (609 of 609 strings)
2020-12-03 11:01:38 +01:00
Sérgio Marques
124b7eefb5 Translated using Weblate (Portuguese)
Currently translated at 100.0% (609 of 609 strings)
2020-12-03 11:01:38 +01:00
x
b52924048c Translated using Weblate (Italian)
Currently translated at 42.5% (17 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/it/
2020-12-01 23:52:13 +01:00
Ajeje Brazorf
93393f5dff Translated using Weblate (Sardinian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 23:52:12 +01:00
Yaron Shahrabani
275a75ebaa Translated using Weblate (Hebrew)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 23:52:12 +01:00
Oğuz Ersen
3e4a7a19cc Translated using Weblate (Turkish)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 23:52:12 +01:00
Marian Hanzel
734af457f3 Translated using Weblate (Slovak)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 23:52:11 +01:00
x
55bdb1f47a Translated using Weblate (Italian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 23:52:11 +01:00
Ldm Public
adff0d199d Translated using Weblate (French)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 23:52:11 +01:00
Hosted Weblate
f95b3262a0 Merge branch 'origin/dev' into Weblate. 2020-12-01 20:59:26 +01:00
Óscar Fernández Díaz
794a14e76c Translated using Weblate (Spanish)
Currently translated at 27.5% (11 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/es/
2020-12-01 20:59:26 +01:00
Gontzal Manuel Pujana Onaindia
ba857b5ef7 Translated using Weblate (Basque)
Currently translated at 25.0% (10 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/eu/
2020-12-01 20:59:25 +01:00
minsk21
2aed04a8c2 Translated using Weblate (Belarusian)
Currently translated at 83.7% (510 of 609 strings)
2020-12-01 20:59:25 +01:00
Stypox
5f9e6b51da Merge pull request #5043 from mhmdanas/improve-database-summaries
Improve export database summary
2020-12-01 20:43:57 +01:00
mhmdanas
e7b5c99ed6 Remove Oxford comma 2020-12-01 22:04:14 +03:00
mhmdanas
9c0b3d35be State what is exported or imported explicitly 2020-12-01 18:09:36 +03:00
TobiGr
a54bc96eab Update extractor to 0.20.5 2020-12-01 08:22:17 +01:00
Ajeje Brazorf
a2a8e4b965 Translated using Weblate (Sardinian)
Currently translated at 12.5% (5 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/sc/
2020-12-01 08:20:11 +01:00
ssantos
81ad2c61d9 Translated using Weblate (Portuguese (Portugal))
Currently translated at 62.5% (25 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_PT/
2020-12-01 08:20:10 +01:00
Bopol
32616493b3 Translated using Weblate (French)
Currently translated at 70.0% (28 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-12-01 08:20:10 +01:00
Stypox
05183ffd0f Translated using Weblate (Italian)
Currently translated at 25.0% (10 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/it/
2020-12-01 08:20:09 +01:00
Yaron Shahrabani
e72ddc9439 Translated using Weblate (Hebrew)
Currently translated at 27.5% (11 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/he/
2020-12-01 08:20:09 +01:00
ssantos
32e3caecac Translated using Weblate (Portuguese)
Currently translated at 62.5% (25 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt/
2020-12-01 08:20:08 +01:00
minsk21
df43389183 Translated using Weblate (Belarusian)
Currently translated at 74.5% (454 of 609 strings)
2020-12-01 08:20:07 +01:00
Aarjav Parashar
19b77809ec Translated using Weblate (Hindi)
Currently translated at 82.2% (501 of 609 strings)
2020-12-01 08:20:07 +01:00
Milo Ivir
be05b827f3 Translated using Weblate (Croatian)
Currently translated at 99.1% (604 of 609 strings)
2020-12-01 08:20:06 +01:00
Vũ Hoàng
5dfc6f822d Translated using Weblate (Vietnamese)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 08:20:06 +01:00
Emin Tufan Çetin
c3e004da03 Translated using Weblate (Turkish)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 08:20:05 +01:00
zmni
8bae73b6ea Translated using Weblate (Indonesian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 08:20:04 +01:00
Mohammed Anas
d1e19d3b63 Translated using Weblate (Arabic)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 08:20:04 +01:00
Francesco Saltori
ffca897ddf Translated using Weblate (Italian)
Currently translated at 100.0% (609 of 609 strings)
2020-12-01 08:20:03 +01:00
mhmdanas
4277b6e262 Fix unescaped quote 2020-11-30 19:52:38 +03:00
mhmdanas
506c4ce701 Improve "import database" summary 2020-11-30 19:49:55 +03:00
mhmdanas
d251e58984 Improve export database summary 2020-11-30 15:45:51 +03:00
Mohammed Anas
4a1213c081 Translated using Weblate (Arabic)
Currently translated at 62.5% (25 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ar/
2020-11-28 14:21:26 +01:00
Oğuz Ersen
8b7609255c Translated using Weblate (Turkish)
Currently translated at 17.5% (7 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/tr/
2020-11-28 14:21:25 +01:00
TobiGr
ef78fe0653 Translated using Weblate (German)
Currently translated at 27.5% (11 of 40 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/
2020-11-28 14:21:25 +01:00
TobiGr
70b3ccb422 Release NewPipe 0.20.5 (959) 2020-11-28 12:56:45 +01:00
TobiGr
81d6b367fe Add changelog for 0.20.5 (959) 2020-11-28 12:54:21 +01:00
TobiGr
0a78ae60be Add missing import for @throws annotation 2020-11-28 12:53:22 +01:00
TobiGr
a61830a860 Merge remote-tracking branch 'Weblate/dev' into dev 2020-11-28 12:47:46 +01:00
Mukhamadjonov
86bae9ddc9 Translated using Weblate (Uzbek (latin))
Currently translated at 58.9% (23 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/uz_Latn/
2020-11-28 12:46:10 +01:00
Issac
033780862a Translated using Weblate (Spanish)
Currently translated at 23.0% (9 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/es/
2020-11-28 12:46:10 +01:00
pjammo
6094d8a74e Translated using Weblate (Italian)
Currently translated at 23.0% (9 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/it/
2020-11-28 12:46:09 +01:00
yn
356ca3d177 Translated using Weblate (Japanese)
Currently translated at 15.3% (6 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ja/
2020-11-28 12:46:09 +01:00
Igor Nedoboy
d69806faa9 Translated using Weblate (Russian)
Currently translated at 100.0% (39 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ru/
2020-11-28 12:46:08 +01:00
David Schneider
ab67635dcb Translated using Weblate (German)
Currently translated at 25.6% (10 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/
2020-11-28 12:46:07 +01:00
Igor Nedoboy
cee3d49458 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:06 +01:00
Igor Nedoboy
5b53a7aef7 Translated using Weblate (Sardinian)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:06 +01:00
Igor Nedoboy
9b29665cc0 Translated using Weblate (Dutch (Belgium))
Currently translated at 99.6% (607 of 609 strings)
2020-11-28 12:46:06 +01:00
Igor Nedoboy
f447c87b45 Translated using Weblate (Finnish)
Currently translated at 99.6% (607 of 609 strings)
2020-11-28 12:46:06 +01:00
Igor Nedoboy
e3eea45d86 Translated using Weblate (Hebrew)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:06 +01:00
Jeff Huang
f61a06ce0a Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:05 +01:00
Eric
539842aa99 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:05 +01:00
Igor Nedoboy
5925f1d2aa Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:05 +01:00
Enol P
61eb150825 Translated using Weblate (Asturian)
Currently translated at 47.9% (292 of 609 strings)
2020-11-28 12:46:04 +01:00
Igor Nedoboy
cf95de4d27 Translated using Weblate (Polish)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:04 +01:00
Oğuz Ersen
fdad7ec1ba Translated using Weblate (Turkish)
Currently translated at 99.8% (608 of 609 strings)
2020-11-28 12:46:04 +01:00
Igor Nedoboy
850efb4237 Translated using Weblate (Indonesian)
Currently translated at 99.6% (607 of 609 strings)
2020-11-28 12:46:04 +01:00
Igor Nedoboy
853cb3887f Translated using Weblate (Arabic)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:03 +01:00
Igor Nedoboy
412f2c1664 Translated using Weblate (Czech)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:03 +01:00
zeritti
2810a69bd4 Translated using Weblate (Czech)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:03 +01:00
Igor Nedoboy
5347f95f50 Translated using Weblate (Slovak)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:03 +01:00
Igor Nedoboy
6b469f0621 Translated using Weblate (Greek)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:03 +01:00
Igor Nedoboy
0021562c93 Translated using Weblate (Basque)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:02 +01:00
Gontzal Manuel Pujana Onaindia
f2bd2b0a59 Translated using Weblate (Basque)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:02 +01:00
Igor Nedoboy
647eb8bbf5 Translated using Weblate (Portuguese)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:02 +01:00
Igor Nedoboy
816d13ae3f Translated using Weblate (Italian)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:02 +01:00
pjammo
578fea4a9c Translated using Weblate (Italian)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:02 +01:00
Y. Sakamoto
1a660d9a4a Translated using Weblate (Japanese)
Currently translated at 99.8% (608 of 609 strings)
2020-11-28 12:46:01 +01:00
Igor Nedoboy
227ac6d9e3 Translated using Weblate (English)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:01 +01:00
Igor Nedoboy
bb57407733 Translated using Weblate (Dutch)
Currently translated at 99.6% (607 of 609 strings)
2020-11-28 12:46:01 +01:00
Éfrit
13ddcce0a2 Translated using Weblate (French)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:00 +01:00
Igor Nedoboy
53767a78d1 Translated using Weblate (Spanish)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:00 +01:00
Issac
5600e8a2ad Translated using Weblate (Spanish)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:00 +01:00
Igor Nedoboy
c6ed52c592 Translated using Weblate (German)
Currently translated at 100.0% (609 of 609 strings)
2020-11-28 12:46:00 +01:00
Allan Nordhøy
3ad14e4adf Contributing guidelines reworked (#4318)
* Contributing guidelines reworked

Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com>
Co-authored-by: bopol <bopol@e.email>
Co-authored-by: Tobias Groza <TobiGr@users.noreply.github.com>
2020-11-28 12:00:00 +01:00
Igor Nedoboy
8a22bdea5d Translated using Weblate (French)
Currently translated at 100.0% (609 of 609 strings)
2020-11-27 22:53:42 +01:00
Éfrit
6135a3c3e2 Translated using Weblate (French)
Currently translated at 100.0% (609 of 609 strings)
2020-11-27 22:53:42 +01:00
Tobias Groza
1e3c979303 Merge pull request #5005 from Chenkail/grammar-fixes
Minor grammar fixes in README.md
2020-11-27 22:31:17 +01:00
Tobias Groza
d0228406b6 Merge pull request #4995 from XiangRongLin/hotfix
Make ErrorInfo contructor public
2020-11-27 22:29:12 +01:00
XiangRongLin
507a2237b7 Make ErrorInfo constructor public
Allows the library behind Parceable to crete an object of the class.
2020-11-25 17:05:52 +01:00
Chenkail
c15c597d99 Update README.md 2020-11-25 11:12:53 +00:00
Igor Nedoboy
7c26cd3270 Translated using Weblate (Russian)
Currently translated at 100.0% (609 of 609 strings)
2020-11-24 02:14:43 +01:00
Igor Nedoboy
938af73059 Translated using Weblate (Russian)
Currently translated at 100.0% (609 of 609 strings)
2020-11-24 02:06:09 +01:00
Jeff Huang
1c047366d2 Translated using Weblate (Chinese (Traditional))
Currently translated at 56.4% (22 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hant/
2020-11-23 23:11:07 +01:00
Michal L
cb20f0cbb0 Translated using Weblate (Polish)
Currently translated at 46.1% (18 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pl/
2020-11-23 23:11:06 +01:00
Yaron Shahrabani
468251c84e Translated using Weblate (Hebrew)
Currently translated at 25.6% (10 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/he/
2020-11-23 23:11:06 +01:00
Gontzal Manuel Pujana Onaindia
ca86ae0c9a Translated using Weblate (Basque)
Currently translated at 23.0% (9 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/eu/
2020-11-23 23:11:05 +01:00
Sérgio Marques
59221b0b4e Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 23:11:05 +01:00
Marcos Chavarría Teijeiro
d3e0640400 Translated using Weblate (Galician)
Currently translated at 94.4% (575 of 609 strings)
2020-11-23 23:11:04 +01:00
Davit Mayilyan
bcb72321f5 Translated using Weblate (Armenian)
Currently translated at 23.9% (146 of 609 strings)
2020-11-23 23:11:04 +01:00
Jeff Huang
4060af715d Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 23:11:03 +01:00
Eric
2ec0237e83 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 23:11:03 +01:00
Michal L
c5593880f2 Translated using Weblate (Polish)
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 23:11:03 +01:00
Marian Hanzel
3673cbce4f Translated using Weblate (Slovak)
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 23:11:02 +01:00
Vasilis K
1f6f7be4b2 Translated using Weblate (Greek)
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 23:11:02 +01:00
Gontzal Manuel Pujana Onaindia
580cce3506 Translated using Weblate (Basque)
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 23:11:02 +01:00
Sérgio Marques
36ba546fc6 Translated using Weblate (Portuguese)
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 23:11:01 +01:00
Francesco Saltori
7f37799cbe Translated using Weblate (Italian)
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 23:11:01 +01:00
Sérgio Marques
5570eeeff9 Translated using Weblate (Portuguese)
Currently translated at 99.6% (607 of 609 strings)
2020-11-23 15:16:35 +01:00
pjammo
2b186ce6e0 Translated using Weblate (Italian)
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 08:20:34 +01:00
Francesco Saltori
72938fed69 Translated using Weblate (Italian)
Currently translated at 100.0% (609 of 609 strings)
2020-11-23 08:20:33 +01:00
Tobias Groza
d54c806e03 Merge pull request #4969 from B0pol/peertube_instances
[PeerTube] update instances list
2020-11-22 23:07:29 +01:00
Hosted Weblate
7eb3551485 Merge branch 'origin/dev' into Weblate. 2020-11-22 22:50:12 +01:00
David Braz
57abe27895 Translated using Weblate (Portuguese (Brazil))
Currently translated at 23.0% (9 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_BR/
2020-11-22 22:30:43 +01:00
David Braz
a628a36082 Translated using Weblate (Portuguese (Brazil))
Currently translated at 23.0% (9 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_BR/
2020-11-22 22:29:56 +01:00
Ajeje Brazorf
0d3e04ff25 Translated using Weblate (Sardinian)
Currently translated at 100.0% (609 of 609 strings)
2020-11-22 22:29:56 +01:00
Yaron Shahrabani
0c78a3f7b0 Translated using Weblate (Hebrew)
Currently translated at 100.0% (609 of 609 strings)
2020-11-22 22:29:55 +01:00
simo
fb1f574c26 Translated using Weblate (Arabic)
Currently translated at 100.0% (609 of 609 strings)
2020-11-22 22:29:55 +01:00
bopol
7f15c18fca [PeerTube] update instance list 2020-11-22 22:10:41 +01:00
TobiGr
e274650956 Release NewPipe 0.20.4 2020-11-22 18:18:14 +01:00
Oğuz Ersen
2a1db4a338 Revert "Translated using Weblate (Turkish)"
This reverts commit 6d15389da8.
2020-11-22 18:04:04 +01:00
TobiGr
0b6ea9ec61 Translated using Weblate (German)
Currently translated at 25.6% (10 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/
2020-11-22 18:03:23 +01:00
Bopol
257a826d45 Translated using Weblate (French)
Currently translated at 69.2% (27 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-11-22 17:53:49 +01:00
Mohammed Anas
e9f48f5134 Translated using Weblate (Arabic)
Currently translated at 61.5% (24 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ar/
2020-11-22 17:53:48 +01:00
Stypox
fcf04624d4 Translated using Weblate (Italian)
Currently translated at 23.0% (9 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/it/
2020-11-22 17:53:47 +01:00
mmagian
16218d6dc5 Translated using Weblate (Portuguese (Brazil))
Currently translated at 20.5% (8 of 39 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_BR/
2020-11-22 17:53:47 +01:00
mmagian
071f33e3cd Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (609 of 609 strings)
2020-11-22 17:53:46 +01:00
Oğuz Ersen
6d15389da8 Translated using Weblate (Turkish)
Currently translated at 99.1% (604 of 609 strings)
2020-11-22 17:53:46 +01:00
Ldm Public
2e8530ec00 Translated using Weblate (French)
Currently translated at 100.0% (609 of 609 strings)
2020-11-22 17:53:46 +01:00
nautilusx
4edd1c5497 Translated using Weblate (German)
Currently translated at 100.0% (609 of 609 strings)
2020-11-22 17:53:46 +01:00
TobiGr
8e693b8b42 Add changelog for version 0.20.4 (958) 2020-11-22 14:53:36 +01:00
Tobias Groza
29376066e8 Merge pull request #4768 from Stypox/update-dependencies
Update most dependencies
2020-11-22 14:28:57 +01:00
Stypox
a44f3071bf Update checkstyle (8.36.2 -> 8.37) and mockito-core (3.5.13 -> 3.6.0) 2020-11-22 14:03:11 +01:00
Stypox
b66047e084 Fix ktlint errors 2020-11-22 14:03:10 +01:00
Stypox
f0ca916432 Update most dependencies 2020-11-22 14:03:10 +01:00
Tobias Groza
c88b4032ef Merge pull request #4948 from Stypox/fix-crash-startup
Fix crash on startup when there is no internet connection
2020-11-22 14:00:36 +01:00
Stypox
6f5e99be6f Handle CheckForNewAppVersion exceptions in one place 2020-11-22 13:27:51 +01:00
TobiGr
fd4c37e9b3 Fix crash on startup caused by no implementation of onError() method 2020-11-22 11:46:24 +01:00
TobiGr
7a8dab2d58 Fix typos 2020-11-22 10:39:00 +01:00
TobiGr
6f3dfad550 Fix Lint: Inconsistent line separators 2020-11-22 10:16:27 +01:00
TobiGr
18fb0a13d7 Merge remote-tracking branch 'Weblate/dev' into dev 2020-11-22 10:10:41 +01:00
Rui Martins
e88f9ae03b Translated using Weblate (Portuguese)
Currently translated at 60.5% (23 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt/
2020-11-21 22:09:26 +01:00
Éfrit
30c010ad3f Translated using Weblate (French)
Currently translated at 68.4% (26 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-11-21 18:06:19 +01:00
Azizov Aga
e84e70bdc6 Translated using Weblate (Azerbaijani)
Currently translated at 5.2% (2 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/az/
2020-11-21 18:06:19 +01:00
Sebuktegin Khan
1e6b6165ae Translated using Weblate (Hindi)
Currently translated at 2.6% (1 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/hi/
2020-11-21 18:06:18 +01:00
Gontzal Manuel Pujana Onaindia
c6d149d091 Translated using Weblate (Basque)
Currently translated at 21.0% (8 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/eu/
2020-11-21 18:06:18 +01:00
Deactivated Account
d55d8d78de Translated using Weblate (Greek)
Currently translated at 36.8% (14 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/el/
2020-11-21 18:06:18 +01:00
Azizov Aga
eff59f7b5e Translated using Weblate (Azerbaijani)
Currently translated at 43.1% (261 of 605 strings)
2020-11-21 18:06:17 +01:00
Davit Mayilyan
a7a5437245 Translated using Weblate (Armenian)
Currently translated at 18.3% (111 of 605 strings)
2020-11-21 18:06:15 +01:00
Gontzal Manuel Pujana Onaindia
6671b9e55b Translated using Weblate (Basque)
Currently translated at 100.0% (605 of 605 strings)
2020-11-21 18:06:14 +01:00
Éfrit
2dde1cc589 Translated using Weblate (French)
Currently translated at 100.0% (605 of 605 strings)
2020-11-21 18:06:14 +01:00
Stypox
17866c29ae Refactor CheckForNewAppVersion 2020-11-21 12:02:08 +01:00
Stypox
8dc4e6dc2a Fix crash on startup without internet: Cbservable callable returning null
Use Maybe instead
2020-11-21 12:02:03 +01:00
Stypox
1197f44262 Merge pull request #4944 from Isira-Seneviratne/Dispose_RxView_disposable
Dispose of RxViews disposable in BaseStateFragment.
2020-11-21 10:52:00 +01:00
Stypox
a86ed1f801 Merge pull request #4815 from Isira-Seneviratne/Use_try-with-resources
Use try-with-resources.
2020-11-21 10:20:49 +01:00
Isira Seneviratne
e98d3423e4 Dispose of RxViews disposable in BaseStateFragment. 2020-11-21 14:24:21 +05:30
Isira Seneviratne
95333d37c8 Use try-with-resources. 2020-11-21 13:47:13 +05:30
Stypox
8bcf0c6498 Merge pull request #4377 from Isira-Seneviratne/Use_Parcelize_annotation
Use the Kotlin Parcelize annotation.
2020-11-21 08:39:55 +01:00
Isira Seneviratne
340b92e32b Convert ErrorInfo to Kotlin and use the Parcelize annotation. 2020-11-21 12:47:35 +05:30
Isira Seneviratne
6e68ab19f9 Convert SavedState to Kotlin and use the Parcelize annotation. 2020-11-21 12:47:32 +05:30
Isira Seneviratne
15fed32d92 Convert SoftwareComponent to Kotlin and use the Parcelize annotation. 2020-11-21 12:47:30 +05:30
Isira Seneviratne
897c754dd4 Convert MissionRecoveryInfo to Kotlin and use the Parcelize annotation. 2020-11-21 12:47:29 +05:30
Isira Seneviratne
ec1e746a22 Convert License to Kotlin and use the Parcelize annotation. 2020-11-21 12:47:26 +05:30
Stypox
001f078ba9 Merge pull request #4937 from vkay94/fix-player-brightness-volume-setting
Fix respecting brightness-volume-gesture settings
2020-11-20 22:53:14 +01:00
vkay94
b5321152fd Player gestures: Fix respecting brightness-volume-gesture settings 2020-11-20 21:08:02 +01:00
Stypox
66d15ea635 Merge pull request #4893 from okan35/whatsNewSwipeRefresh
Pull to Refresh Feed
2020-11-20 18:13:32 +01:00
Stypox
72177033d2 Merge pull request #4891 from vkay94/locallist-entry-progressTime
Improve performance for some updateState calls (local lists)
2020-11-20 17:12:16 +01:00
Stypox
06b7072240 Merge pull request #4642 from XiangRongLin/hide_thumbnail
Add option to hide thumbnail on lock screen
2020-11-20 16:35:10 +01:00
Tobias Groza
4700f35739 Merge pull request #4921 from Isira-Seneviratne/Call_offsetDateTime_instead_of_date
Call DateWrapper's offsetDateTime() instead of date().
2020-11-20 15:58:22 +01:00
Tobias Groza
bbfa280e86 Merge pull request #4929 from TacoTheDank/murder-all-the-annoying-lints
Various code improvements
2020-11-20 15:53:37 +01:00
TacoTheDank
2669ba944d Correct some other small lints 2020-11-19 18:54:27 -05:00
Michal L
c8788dbfbe Translated using Weblate (Polish)
Currently translated at 44.7% (17 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pl/
2020-11-20 00:21:29 +01:00
Anxhelo Lushka
5e7c3b53f8 Translated using Weblate (Albanian)
Currently translated at 98.8% (598 of 605 strings)
2020-11-20 00:21:28 +01:00
Vasilis K
99348c2300 Translated using Weblate (Greek)
Currently translated at 100.0% (605 of 605 strings)
2020-11-20 00:21:28 +01:00
randomtroller
ab2b9797fd Translated using Weblate (Slovenian)
Currently translated at 54.7% (331 of 605 strings)
2020-11-20 00:21:28 +01:00
Alvaro
637653ea11 Translated using Weblate (Spanish)
Currently translated at 99.8% (604 of 605 strings)
2020-11-20 00:21:27 +01:00
TacoTheDank
04cb6ba3d0 Update Android Studio 2020-11-19 15:25:07 -05:00
Isira Seneviratne
eb1cddd85a Call DateWrapper's offsetDateTime() instead of date(). 2020-11-19 18:37:07 +05:30
Prasanta-Hembram
723b230093 Translated using Weblate (Santali)
Currently translated at 10.5% (64 of 605 strings)
2020-11-19 09:33:47 +01:00
nautilusx
7185fae491 Translated using Weblate (German)
Currently translated at 23.6% (9 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/
2020-11-19 09:33:46 +01:00
TacoTheDank
0274cd6beb Lint: Inner class may be static 2020-11-18 18:02:33 -05:00
TacoTheDank
ad2ea0b807 Lint: 'if' replaceable with 'switch' 2020-11-18 17:58:41 -05:00
TacoTheDank
c24999075d Lint: Lambda fix 2020-11-18 17:57:30 -05:00
TacoTheDank
773bde14ab Lint: 'size() == 0' replaceable with 'isEmpty()' 2020-11-18 17:54:16 -05:00
TacoTheDank
00b08318a5 Lint: Redundant 'new' expression in constant array creation 2020-11-18 17:52:30 -05:00
TacoTheDank
39e5d8ccc2 Lint: Make a bunch of stuff final 2020-11-18 17:50:00 -05:00
TacoTheDank
e25622df4b Lint: Move declarations into assignments 2020-11-18 17:48:01 -05:00
TacoTheDank
ea5939c1b7 Kotlin lint fixing 2020-11-18 17:45:19 -05:00
TacoTheDank
4734d04d4f Use two more KTX extensions 2020-11-18 17:29:58 -05:00
TobiGr
493e47f7e6 Add Central Atlas Tamazight (Tamaziɣt) to app locales 2020-11-18 19:59:15 +01:00
Mukhamadjonov
ef2b32eb05 Translated using Weblate (Uzbek (latin))
Currently translated at 13.1% (5 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/uz_Latn/
2020-11-18 18:44:59 +01:00
Mukhamadjonov
1da91d44e1 Translated using Weblate (Uzbek (latin))
Currently translated at 99.1% (600 of 605 strings)
2020-11-18 18:44:58 +01:00
Mario Rossi
ebd7ab3e46 Translated using Weblate (Neapolitan)
Currently translated at 10.7% (65 of 605 strings)
2020-11-18 18:44:54 +01:00
Allan Nordhøy
99bddfdf0a Translated using Weblate (Norwegian Bokmål)
Currently translated at 10.5% (4 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/nb_NO/
2020-11-18 18:44:53 +01:00
Nicky Db
144f48c9a6 Translated using Weblate (Dutch (Belgium))
Currently translated at 36.8% (14 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/nl_BE/
2020-11-18 18:44:53 +01:00
Mark
8d0d2ba07b Translated using Weblate (Dutch)
Currently translated at 10.5% (4 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/nl/
2020-11-18 18:44:52 +01:00
Yaron Shahrabani
a6ad334dc0 Translated using Weblate (Hebrew)
Currently translated at 23.6% (9 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/he/
2020-11-18 18:44:52 +01:00
Naimul Kabir
468ca30070 Translated using Weblate (Bengali)
Currently translated at 10.5% (4 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/bn/
2020-11-18 18:44:52 +01:00
UserX
7b2d2d9338 Translated using Weblate (German)
Currently translated at 23.6% (9 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/
2020-11-18 18:44:51 +01:00
Naimul Kabir
0e08819cf3 Translated using Weblate (Bengali)
Currently translated at 78.6% (476 of 605 strings)
2020-11-18 18:44:51 +01:00
vachan-maker
1d3f7b49dc Translated using Weblate (Malayalam)
Currently translated at 92.7% (561 of 605 strings)
2020-11-18 18:44:51 +01:00
Allan Nordhøy
3566ec7012 Translated using Weblate (Norwegian Bokmål)
Currently translated at 93.3% (565 of 605 strings)
2020-11-18 18:44:50 +01:00
Azizov Aga
f37a36efa4 Translated using Weblate (Azerbaijani)
Currently translated at 36.5% (221 of 605 strings)
2020-11-18 18:44:50 +01:00
षिखर्
2ea069cd8c Translated using Weblate (Hindi)
Currently translated at 78.5% (475 of 605 strings)
2020-11-18 18:44:48 +01:00
Naimul Kabir
08e111f6dc Translated using Weblate (Bengali (Bangladesh))
Currently translated at 64.9% (393 of 605 strings)
2020-11-18 18:44:48 +01:00
Krysa Czech
6339881684 Translated using Weblate (Czech)
Currently translated at 100.0% (605 of 605 strings)
2020-11-18 18:44:47 +01:00
Stypox
e222538575 Translated using Weblate (Italian)
Currently translated at 100.0% (605 of 605 strings)
2020-11-18 18:44:47 +01:00
Francesco Saltori
c4a67ce420 Translated using Weblate (Italian)
Currently translated at 100.0% (605 of 605 strings)
2020-11-18 18:44:47 +01:00
xxkfqz
77e348ba62 Translated using Weblate (Russian)
Currently translated at 100.0% (605 of 605 strings)
2020-11-18 18:44:46 +01:00
Pera Petrovic
bde39d8c37 Translated using Weblate (Serbian)
Currently translated at 40.9% (248 of 605 strings)
2020-11-18 18:44:45 +01:00
Tobias Groza
ebb906c273 Merge pull request #4852 from TeamNewPipe/release_0.20.3
Release 0.20.3
2020-11-18 16:40:52 +01:00
TobiGr
46b91bf8b0 Merge remote-tracking branch 'Weblate/dev' into release_0.20.3 2020-11-18 15:57:57 +01:00
okan35
7a432b38e9 gradle change 2020-11-17 19:25:49 +01:00
okan35
9b6a201bbb removed unnecessary spaces - code change 2020-11-17 19:23:29 +01:00
Bopol
a79d7c8417 Translated using Weblate (French)
Currently translated at 68.4% (26 of 38 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-11-16 22:09:30 +01:00
Stypox
7a6e0d651f Add Uzbek language (O'zbek) and remove Neapolitan
Neapolitan only has 43 translated strings, so it should not appear as a possible language
2020-11-15 23:37:39 +01:00
Stypox
7476498823 [Regression] Revert "Removed remember popup properties setting"
This reverts commit 314615bfef.
2020-11-15 22:24:27 +01:00
Stypox
4c7b5d44a0 [Regression] Fix videos added multiple times to detail fragment stack 2020-11-15 22:23:47 +01:00
Mukhamadjonov
620bb54881 Translated using Weblate (Uzbek (latin))
Currently translated at 66.7% (404 of 605 strings)
2020-11-15 22:23:47 +01:00
Prasanta-Hembram
73be747cbe Translated using Weblate (Santali)
Currently translated at 8.5% (52 of 605 strings)
2020-11-15 22:23:46 +01:00
WaldiS
4d874451c9 Translated using Weblate (Polish)
Currently translated at 37.8% (14 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pl/
2020-11-15 22:23:46 +01:00
Allan Nordhøy
3245d620c3 Translated using Weblate (Norwegian Bokmål)
Currently translated at 93.3% (565 of 605 strings)
2020-11-15 22:23:46 +01:00
Terry Louwers
a59f80589a Translated using Weblate (Dutch (Belgium))
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:46 +01:00
Milo Ivir
6b269c7559 Translated using Weblate (Croatian)
Currently translated at 98.8% (598 of 605 strings)
2020-11-15 22:23:46 +01:00
Michal L
53cadeab61 Translated using Weblate (Polish)
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:46 +01:00
2-Seol
e90d388fdb Translated using Weblate (Korean)
Currently translated at 82.8% (501 of 605 strings)
2020-11-15 22:23:46 +01:00
Terry Louwers
219f059834 Translated using Weblate (Dutch)
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:46 +01:00
WaldiS
dc2dac66a3 Translated using Weblate (Polish)
Currently translated at 99.8% (604 of 605 strings)
2020-11-15 22:23:46 +01:00
Mukhamadjonov
e04ee666b8 Translated using Weblate (Uzbek (latin))
Currently translated at 36.5% (221 of 605 strings)
2020-11-15 22:23:46 +01:00
Prasanta-Hembram
7d27003bb2 Translated using Weblate (Santali)
Currently translated at 8.4% (51 of 605 strings)
2020-11-15 22:23:46 +01:00
Allan Nordhøy
b866c9dd08 Translated using Weblate (Norwegian Bokmål)
Currently translated at 10.8% (4 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/nb_NO/
2020-11-15 22:23:46 +01:00
Ajeje Brazorf
d17236fe45 Translated using Weblate (Sardinian)
Currently translated at 10.8% (4 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/sc/
2020-11-15 22:23:46 +01:00
ssantos
d2580ec87c Translated using Weblate (Portuguese (Portugal))
Currently translated at 54.0% (20 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_PT/
2020-11-15 22:23:46 +01:00
Florian
7c10f414dc Translated using Weblate (French)
Currently translated at 24.3% (9 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-11-15 22:23:46 +01:00
simo
2a4717cb7f Translated using Weblate (Arabic)
Currently translated at 62.1% (23 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ar/
2020-11-15 22:23:46 +01:00
Yaron Shahrabani
be9cb8a4da Translated using Weblate (Hebrew)
Currently translated at 21.6% (8 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/he/
2020-11-15 22:23:46 +01:00
ssantos
e887363910 Translated using Weblate (Portuguese)
Currently translated at 54.0% (20 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt/
2020-11-15 22:23:45 +01:00
nautilusx
a274159726 Translated using Weblate (German)
Currently translated at 18.9% (7 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/
2020-11-15 22:23:45 +01:00
ssantos
83384e0de4 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:45 +01:00
Ajeje Brazorf
748904b8ad Translated using Weblate (Sardinian)
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:44 +01:00
Yaron Shahrabani
3e72df8b1e Translated using Weblate (Hebrew)
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:25 +01:00
Jeff Huang
2921563e9c Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:25 +01:00
Eric
01c1346696 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:25 +01:00
simo
796e0456ef Translated using Weblate (Arabic)
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:24 +01:00
Bopol
eeb68497fe Translated using Weblate (Esperanto)
Currently translated at 91.0% (551 of 605 strings)
2020-11-15 22:23:24 +01:00
ssantos
7eadb6acad Translated using Weblate (Portuguese)
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:24 +01:00
Vancha March
9d588aa7e7 Translated using Weblate (Dutch)
Currently translated at 99.8% (604 of 605 strings)
2020-11-15 22:23:24 +01:00
Florian
204b5f7f09 Translated using Weblate (French)
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:24 +01:00
nautilusx
e0f53b63ce Translated using Weblate (German)
Currently translated at 100.0% (605 of 605 strings)
2020-11-15 22:23:24 +01:00
Allan Nordhøy
83f4dbe40e Translated using Weblate (Norwegian Bokmål)
Currently translated at 93.0% (563 of 605 strings)
2020-11-15 22:23:24 +01:00
Mukhamadjonov
8d8ba68838 Translated using Weblate (Uzbek (latin))
Currently translated at 20.3% (123 of 603 strings)
2020-11-15 22:23:24 +01:00
Stypox
3f25940dec Release 0.20.3 2020-11-15 22:23:24 +01:00
okan35
745773b207 swipe to refresh added 2020-11-15 17:54:40 +01:00
Tobias Groza
35f5575595 Merge pull request #4892 from TeamNewPipe/correct_gigaget_license
Correct Gigaget's license from GPLv2 to GPLv3
2020-11-15 15:30:02 +01:00
opusforlife2
e4746f8b32 Remove GPLv2 - not needed 2020-11-15 14:04:10 +00:00
opusforlife2
7e0552efde Delete GPLv2 license file - not needed 2020-11-15 14:03:20 +00:00
opusforlife2
6075b98634 Correct Gigaget's license
It's GPLv3, not GPLv2.
2020-11-15 13:41:43 +00:00
vkay94
ebe9f518d0 Replace some loadStateStream calls with progressTime field 2020-11-15 14:12:05 +01:00
vkay94
37ceddd11b Add progressTime field to some stream entries (database) 2020-11-15 14:08:41 +01:00
Hosted Weblate
d1d8b911b9 Merge branch 'origin/dev' into Weblate. 2020-11-14 11:48:32 +01:00
Stypox
796e656328 Translated using Weblate (Italian)
Currently translated at 100.0% (605 of 605 strings)
2020-11-14 11:48:32 +01:00
ysard
8b869915e7 Translated using Weblate (French)
Currently translated at 67.5% (25 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-11-14 11:48:21 +01:00
Stypox
9b05243d61 Translated using Weblate (Italian)
Currently translated at 100.0% (605 of 605 strings)
2020-11-14 11:48:20 +01:00
Stypox
81c24510a8 Add Release 0.20.3 fastlane changelog to allow translation 2020-11-14 11:30:27 +01:00
Stypox
9e7fb4d21a Merge pull request #4771 from Stypox/fix-playlist-select
Fix playlist select dialog and do some refactoring
2020-11-14 11:21:20 +01:00
XiangRongLin
7805f8a9b1 Add option to hide thumbnail on lock screen and inside notification 2020-11-14 10:01:07 +01:00
Prasanta-Hembram
ae7f04578d Translated using Weblate (Santali)
Currently translated at 9.7% (59 of 605 strings)
2020-11-14 00:56:38 +01:00
chr56
ce814cffd1 Translated using Weblate (Chinese (Simplified))
Currently translated at 64.8% (24 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/
2020-11-14 00:56:38 +01:00
Ville Rantanen
703b310ef0 Translated using Weblate (Finnish)
Currently translated at 5.4% (2 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fi/
2020-11-14 00:56:36 +01:00
ysard
da6c4ad36a Translated using Weblate (French)
Currently translated at 24.3% (9 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-11-14 00:56:36 +01:00
Michal L
a8c849d38a Translated using Weblate (Polish)
Currently translated at 40.5% (15 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pl/
2020-11-14 00:56:35 +01:00
jimman2003
d8d5e04a51 Translated using Weblate (Greek)
Currently translated at 16.2% (6 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/el/
2020-11-14 00:56:35 +01:00
David Braz
fa348cb98f Translated using Weblate (Portuguese (Brazil))
Currently translated at 21.6% (8 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_BR/
2020-11-14 00:56:34 +01:00
Oymate
f4ec2d8107 Translated using Weblate (Bengali)
Currently translated at 78.5% (475 of 605 strings)
2020-11-14 00:56:33 +01:00
Ville Rantanen
de39d828de Translated using Weblate (Finnish)
Currently translated at 100.0% (605 of 605 strings)
2020-11-14 00:56:33 +01:00
David Braz
25d3d0d0ba Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (605 of 605 strings)
2020-11-14 00:56:33 +01:00
Habib Rohman
6f3b1000a7 Translated using Weblate (Indonesian)
Currently translated at 100.0% (605 of 605 strings)
2020-11-14 00:56:32 +01:00
Marian Hanzel
1ebb8d8d14 Translated using Weblate (Slovak)
Currently translated at 100.0% (605 of 605 strings)
2020-11-14 00:56:32 +01:00
jimman2003
4e4acdaecc Translated using Weblate (Greek)
Currently translated at 99.6% (603 of 605 strings)
2020-11-14 00:56:32 +01:00
pjammo
f7fb03bf56 Translated using Weblate (Italian)
Currently translated at 100.0% (605 of 605 strings)
2020-11-14 00:56:31 +01:00
Ács Zoltán
429aafc7ba Translated using Weblate (Hungarian)
Currently translated at 68.4% (414 of 605 strings)
2020-11-14 00:56:31 +01:00
Ldm Public
acdfede2a8 Translated using Weblate (French)
Currently translated at 21.6% (8 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-11-13 20:54:16 +01:00
Hosted Weblate
8366c4c165 Merge branch 'origin/dev' into Weblate. 2020-11-10 12:15:50 +01:00
Mukhamadjonov
4c7260b043 Translated using Weblate (Uzbek (latin))
Currently translated at 66.7% (404 of 605 strings)
2020-11-10 12:14:17 +01:00
Prasanta-Hembram
c878f7dc25 Translated using Weblate (Santali)
Currently translated at 8.5% (52 of 605 strings)
2020-11-10 12:14:13 +01:00
WaldiS
aca21f6ef2 Translated using Weblate (Polish)
Currently translated at 37.8% (14 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pl/
2020-11-10 12:14:13 +01:00
Allan Nordhøy
10c582bafb Translated using Weblate (Norwegian Bokmål)
Currently translated at 93.3% (565 of 605 strings)
2020-11-10 12:14:12 +01:00
Terry Louwers
7b3bd26631 Translated using Weblate (Dutch (Belgium))
Currently translated at 100.0% (605 of 605 strings)
2020-11-10 12:14:12 +01:00
Milo Ivir
731f88da84 Translated using Weblate (Croatian)
Currently translated at 98.8% (598 of 605 strings)
2020-11-10 12:14:12 +01:00
Michal L
b7fb9a65b6 Translated using Weblate (Polish)
Currently translated at 100.0% (605 of 605 strings)
2020-11-10 12:14:11 +01:00
2-Seol
843c24b17a Translated using Weblate (Korean)
Currently translated at 82.8% (501 of 605 strings)
2020-11-10 12:14:11 +01:00
Terry Louwers
18dbbfc95a Translated using Weblate (Dutch)
Currently translated at 100.0% (605 of 605 strings)
2020-11-10 12:14:11 +01:00
bopol
5b6e187b49 Merge pull request #4845 from KIMMINTAE98/rm_kor
Add korean translation of README.md
2020-11-10 12:07:27 +01:00
opusforlife2
9025a9b88c Rename and add links to translations 2020-11-10 06:58:20 +00:00
opusforlife2
07b2891671 Add links to translations
All READMEs should contains links to translated versions.
2020-11-10 06:56:01 +00:00
Tobias Groza
c4a739bef6 Merge pull request #4562 from Stypox/fix-detail-open
Fix opening VideoDetailFragment and much more
2020-11-09 22:04:39 +01:00
WaldiS
1008c74cd7 Translated using Weblate (Polish)
Currently translated at 99.8% (604 of 605 strings)
2020-11-09 20:57:14 +01:00
Stypox
60dc9d27bc Merge pull request #4784 from bd0n4lds/Dont-Use-Float-Type-For-Loop-Indices
Change loop index from float to int
2020-11-09 13:04:17 +01:00
Bri@n
9eb0f48a7a Change loop index from float to int 2020-11-09 12:55:59 +01:00
KIMMINTAE98
7b1fccdd06 complete korean translation of README.md 2020-11-09 15:29:56 +09:00
Mukhamadjonov
64ae07b03b Translated using Weblate (Uzbek (latin))
Currently translated at 36.5% (221 of 605 strings)
2020-11-08 23:47:25 +01:00
Prasanta-Hembram
6ecbbd1f79 Translated using Weblate (Santali)
Currently translated at 8.4% (51 of 605 strings)
2020-11-08 23:47:22 +01:00
Allan Nordhøy
a1fb268764 Translated using Weblate (Norwegian Bokmål)
Currently translated at 10.8% (4 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/nb_NO/
2020-11-08 23:47:22 +01:00
Ajeje Brazorf
868661edf0 Translated using Weblate (Sardinian)
Currently translated at 10.8% (4 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/sc/
2020-11-08 23:47:22 +01:00
ssantos
9899e63d53 Translated using Weblate (Portuguese (Portugal))
Currently translated at 54.0% (20 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_PT/
2020-11-08 23:47:22 +01:00
Florian
0b37b8b059 Translated using Weblate (French)
Currently translated at 24.3% (9 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-11-08 23:47:21 +01:00
simo
1b34ca822f Translated using Weblate (Arabic)
Currently translated at 62.1% (23 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ar/
2020-11-08 23:47:20 +01:00
Yaron Shahrabani
a4e3a874ad Translated using Weblate (Hebrew)
Currently translated at 21.6% (8 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/he/
2020-11-08 23:47:19 +01:00
ssantos
8ec3df552a Translated using Weblate (Portuguese)
Currently translated at 54.0% (20 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt/
2020-11-08 23:47:19 +01:00
nautilusx
b4b1c9256b Translated using Weblate (German)
Currently translated at 18.9% (7 of 37 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/
2020-11-08 23:47:18 +01:00
ssantos
acee20d897 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (605 of 605 strings)
2020-11-08 23:47:18 +01:00
Ajeje Brazorf
6ea3ebb72d Translated using Weblate (Sardinian)
Currently translated at 100.0% (605 of 605 strings)
2020-11-08 23:47:17 +01:00
Yaron Shahrabani
55f23e9304 Translated using Weblate (Hebrew)
Currently translated at 100.0% (605 of 605 strings)
2020-11-08 23:47:17 +01:00
Jeff Huang
ad223a04f8 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (605 of 605 strings)
2020-11-08 23:47:17 +01:00
Eric
0b150ea475 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (605 of 605 strings)
2020-11-08 23:47:16 +01:00
simo
167e9fbc6d Translated using Weblate (Arabic)
Currently translated at 100.0% (605 of 605 strings)
2020-11-08 23:47:16 +01:00
Bopol
77ea160cd9 Translated using Weblate (Esperanto)
Currently translated at 91.0% (551 of 605 strings)
2020-11-08 23:47:16 +01:00
ssantos
f9204450f1 Translated using Weblate (Portuguese)
Currently translated at 100.0% (605 of 605 strings)
2020-11-08 23:47:15 +01:00
Vancha March
21ef76816f Translated using Weblate (Dutch)
Currently translated at 99.8% (604 of 605 strings)
2020-11-08 23:47:15 +01:00
Florian
f166cfbac8 Translated using Weblate (French)
Currently translated at 100.0% (605 of 605 strings)
2020-11-08 23:47:15 +01:00
nautilusx
e5f64710f4 Translated using Weblate (German)
Currently translated at 100.0% (605 of 605 strings)
2020-11-08 23:47:15 +01:00
KIMMINTAE98
32a5062081 update korean translation of README.md 2020-11-09 03:37:56 +09:00
KIMMINTAE98
e6bc29281e create korean translation of README.md
just create
2020-11-08 23:01:02 +09:00
Stypox
617ee0afc0 Fix brightness and volume scroll swapped 2020-11-08 10:00:28 +01:00
Stypox
1b47a1a994 Fix switching to main player when MainActivity is closed 2020-11-08 10:00:28 +01:00
Stypox
5a87cfc25d Open mini player if player running on app open 2020-11-08 10:00:28 +01:00
Stypox
00a178f7d3 Fix tapping on video thumbnail does nothing 2020-11-08 10:00:28 +01:00
Stypox
2a2c82e73b More fixes with opening VideoDetailFragment 2020-11-08 10:00:28 +01:00
Stypox
bb882ada2c Show "Show info" instead of "Video player" if a stream is playing not on the main player when sharing something to NewPipe 2020-11-08 10:00:28 +01:00
Stypox
1d42e45d78 Unify all ways of opening VideoDetailFragment 2020-11-08 10:00:27 +01:00
Allan Nordhøy
15c4a5c9ea Translated using Weblate (Norwegian Bokmål)
Currently translated at 93.0% (563 of 605 strings)
2020-11-08 01:39:02 +01:00
Tobias Groza
f4435f9031 Merge pull request #4555 from Stypox/playqueue-crash
Fix NullPointerException in queue handling
2020-11-08 01:19:38 +01:00
Hosted Weblate
5a423c89a3 Merge branch 'origin/dev' into Weblate. 2020-11-08 01:08:16 +01:00
Tobias Groza
8b02154f5a Merge pull request #4749 from Prasanta-Hembram/dev
[Translation]Added Santali language
2020-11-08 01:02:37 +01:00
Hosted Weblate
97c454ea77 Merge branch 'origin/dev' into Weblate. 2020-11-08 01:00:30 +01:00
Mukhamadjonov
f07a6d03b5 Translated using Weblate (Uzbek (latin))
Currently translated at 20.3% (123 of 603 strings)
2020-11-08 00:55:24 +01:00
TobiGr
1f18fb5446 Remove unused "video_is_age_restricted" translations 2020-11-08 00:52:20 +01:00
TobiGr
92ee5b66ab Remove unused translation 2020-11-08 00:48:40 +01:00
TobiGr
fcc92c3e27 Merge remote-tracking branch 'Weblate/dev' into dev 2020-11-08 00:38:30 +01:00
Mukhamadjonov
3e91b5a793 Translated using Weblate (Uzbek (latin))
Currently translated at 7.4% (45 of 603 strings)
2020-11-07 22:39:48 +01:00
Vasilis K
42e5cc3bef Translated using Weblate (Greek)
Currently translated at 100.0% (603 of 603 strings)
2020-11-07 22:39:48 +01:00
Éfrit
16c61a1919 Translated using Weblate (French)
Currently translated at 100.0% (603 of 603 strings)
2020-11-07 22:39:47 +01:00
Weblate
c2b4b0490b Added translation using Weblate (Uzbek (latin)) 2020-11-07 22:00:26 +01:00
Mukhamadjonov
a310a06e3c Added translation using Weblate (Uzbek (latin)) 2020-11-07 22:00:22 +01:00
Prasanta-Hembram
9228511527 Translated using Weblate (Santali)
Currently translated at 7.9% (48 of 603 strings)
2020-11-07 08:13:43 +01:00
Gontzal Manuel Pujana Onaindia
bbc4174501 Translated using Weblate (Basque)
Currently translated at 16.6% (6 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/eu/
2020-11-07 08:13:42 +01:00
Oymate
5f3196b74c Translated using Weblate (Bengali)
Currently translated at 77.9% (470 of 603 strings)
2020-11-07 08:13:42 +01:00
Vasilis K
725bd8029f Translated using Weblate (Greek)
Currently translated at 99.6% (601 of 603 strings)
2020-11-07 08:13:41 +01:00
Gontzal Manuel Pujana Onaindia
479ab5df0e Translated using Weblate (Basque)
Currently translated at 100.0% (603 of 603 strings)
2020-11-07 08:13:39 +01:00
xxkfqz
18c45ad30b Translated using Weblate (Russian)
Currently translated at 100.0% (603 of 603 strings)
2020-11-07 08:13:38 +01:00
Vasilis K
6f32f098eb Translated using Weblate (Greek)
Currently translated at 92.0% (555 of 603 strings)
2020-11-06 12:23:03 +01:00
Michalis Nikolaidis
e8289d3912 Translated using Weblate (Greek)
Currently translated at 92.0% (555 of 603 strings)
2020-11-06 12:23:03 +01:00
pjammo
472d9322ce Translated using Weblate (Italian)
Currently translated at 22.2% (8 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/it/
2020-11-05 17:14:08 +01:00
Nyatsuki
0233ffafb6 Translated using Weblate (Japanese)
Currently translated at 16.6% (6 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ja/
2020-11-05 17:14:07 +01:00
Oymate
468ee4756f Translated using Weblate (Bengali)
Currently translated at 73.6% (444 of 603 strings)
2020-11-05 17:14:06 +01:00
Milo Ivir
abf9365bbe Translated using Weblate (Croatian)
Currently translated at 99.0% (597 of 603 strings)
2020-11-05 17:14:04 +01:00
Oymate
1e0789162f Translated using Weblate (Bengali (Bangladesh))
Currently translated at 61.3% (370 of 603 strings)
2020-11-05 17:14:04 +01:00
fieldfile
31f407f4e8 Translated using Weblate (Ukrainian)
Currently translated at 94.3% (569 of 603 strings)
2020-11-05 17:14:04 +01:00
Nyatsuki
77330ffc50 Translated using Weblate (Japanese)
Currently translated at 100.0% (603 of 603 strings)
2020-11-05 17:14:03 +01:00
Stypox
6f132f3fed Merge pull request #4556 from Isira-Seneviratne/Switch_to_Java_8_Date_Time_API
Switch to the Java 8 Date/Time API.
2020-11-05 13:02:04 +01:00
Stypox
c193b4f07c Merge pull request #4499 from Isira-Seneviratne/Replace_AsyncTasks_with_ReactiveX
Use RxJava instead of AsyncTask.
2020-11-05 12:39:33 +01:00
Isira Seneviratne
c745b845c5 Switch to the Java 8 Date/Time API. 2020-11-05 15:02:51 +05:30
Isira Seneviratne
3b69e0dd25 Use RxJava instead of AsyncTask in MissionAdapter. 2020-11-05 11:06:51 +05:30
Isira Seneviratne
8ec55ef394 Use RxJava instead of AsyncTask in LicenseFragmentHelper. 2020-11-05 11:06:51 +05:30
Isira Seneviratne
ef5084036c Use RxJava instead of AsyncTask to check for new app versions. 2020-11-05 11:06:50 +05:30
Tobias Groza
7dd317e530 Merge pull request #4759 from Stypox/yt-import
Change YouTube subscription import instructions to Google takeout
2020-11-04 16:52:43 +01:00
Prasanta-Hembram
e5db3ed9b7 Translated using Weblate (Santali)
Currently translated at 7.6% (46 of 603 strings)
2020-11-04 01:23:34 +01:00
aqwer-T
3a00dc5b5f Translated using Weblate (Lithuanian)
Currently translated at 0.0% (0 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/lt/
2020-11-04 01:23:33 +01:00
Oymate
2d848020fc Translated using Weblate (Bengali)
Currently translated at 64.0% (386 of 603 strings)
2020-11-04 01:23:33 +01:00
Stjepan
70123d19fe Translated using Weblate (Croatian)
Currently translated at 98.5% (594 of 603 strings)
2020-11-04 01:23:33 +01:00
aqwer-T
ea3770260a Translated using Weblate (Lithuanian)
Currently translated at 52.2% (315 of 603 strings)
2020-11-04 01:23:32 +01:00
Vladislav
eea1a80de6 Translated using Weblate (Russian)
Currently translated at 99.3% (599 of 603 strings)
2020-11-04 01:23:32 +01:00
Tobias Groza
4889775ae6 Merge pull request #4790 from TeamNewPipe/promote_custom_repo
Update readme and add custom repo info
2020-11-03 22:02:24 +01:00
opusforlife2
355effd93d Mention custom repo and generally update section
Added custom repo as additional install method, and added comparison between them all. Also removed the outdated part.
2020-11-03 16:56:04 +00:00
Stypox
f1583b6e0c Merge pull request #4587 from vkay94/separate-player-gesture-logic-ui
Separate player gesture logic and UI
2020-11-02 16:36:50 +01:00
vkay94
347566c311 Player gestures: Add multi-double-tap logic 2020-11-02 15:50:34 +01:00
Stypox
1f73572dd3 Fix playlist select dialog and do some refactoring 2020-11-02 14:24:39 +01:00
Prasanta-Hembram
2bfb83c4cd Translated using Weblate (Santali)
Currently translated at 7.4% (45 of 603 strings)
2020-11-02 12:36:09 +01:00
zeritti
ceed1c4962 Translated using Weblate (Czech)
Currently translated at 100.0% (603 of 603 strings)
2020-11-02 12:36:09 +01:00
Juraj Liso
2b5b9d3599 Translated using Weblate (Slovak)
Currently translated at 100.0% (603 of 603 strings)
2020-11-02 12:36:08 +01:00
Franco
96e3709b7b Translated using Weblate (Spanish)
Currently translated at 100.0% (603 of 603 strings)
2020-11-02 12:36:08 +01:00
Stypox
239fc2f6f8 Change youtube subscription import instructions 2020-11-02 11:08:38 +01:00
Stypox
4c77e5cdd2 Merge pull request #4643 from XiangRongLin/colorize_notification
Add option to not colorize notification
2020-11-01 22:24:16 +01:00
Xiang Rong Lin
974f8f692c Add option to not colorize notification 2020-11-01 22:13:00 +01:00
Tobias Groza
e97d0b9a69 Merge pull request #3817 from Isira-Seneviratne/Use_Java_8_APIs
Use Java 8 APIs.
2020-11-01 16:30:50 +01:00
Isira Seneviratne
b0b0a75c87 Use Collection.removeIf() instead of using Iterator.remove() to remove elements conditionally. 2020-11-01 14:44:07 +05:30
Isira Seneviratne
abcacf8c74 Use Comparator's comparing(), nullsLast() and reversed() methods. 2020-11-01 14:44:04 +05:30
Isira Seneviratne
290428b981 Enable support for core library desugaring. 2020-11-01 14:44:02 +05:30
Prasanta Hembram
37d1541d6b Added Santali language 2020-11-01 13:46:51 +05:30
Tobias Groza
1500ce7490 Merge pull request #4710 from TacoTheDank/more-cleanup
More miscellaneous little fixes and improvements
2020-10-31 23:17:23 +01:00
TacoTheDank
a48529872d Fix a few Kotlin style issues 2020-10-31 15:57:49 -04:00
TacoTheDank
31cffa68c5 Push conditionals inside branch expressions 2020-10-31 15:57:26 -04:00
TacoTheDank
6909d1e527 Simplify an if else 2020-10-31 15:57:01 -04:00
TacoTheDank
972235bfba Add missing app:iconSpaceReserved 2020-10-31 15:56:46 -04:00
TacoTheDank
6db560fd2c Use FragmentActivity for AboutActivity's viewpager2 2020-10-31 15:54:39 -04:00
TacoTheDank
1a64d8aec9 Replace a ContextCompat with LayoutInflater.from 2020-10-31 15:54:19 -04:00
TacoTheDank
1e1fb32558 Fix some version checks to use android.os.Build 2020-10-31 15:54:02 -04:00
XiangRongLin
008eb5ba4a Convert notification actions to a custom preference (#4652) 2020-10-31 11:58:33 +01:00
J. Lavoie
f46e0acc89 Translated using Weblate (Finnish)
Currently translated at 100.0% (603 of 603 strings)
2020-10-31 10:38:59 +01:00
Davit Mayilyan
b615ef5810 Translated using Weblate (Armenian)
Currently translated at 16.7% (101 of 603 strings)
2020-10-31 10:38:59 +01:00
Berkay Gündüz
d773279de8 Translated using Weblate (Turkish)
Currently translated at 100.0% (603 of 603 strings)
2020-10-31 10:38:58 +01:00
zmni
56d721651a Translated using Weblate (Indonesian)
Currently translated at 100.0% (603 of 603 strings)
2020-10-31 10:38:57 +01:00
JohnFai
ee17abff92 Translated using Weblate (Chinese (Traditional, Hong Kong))
Currently translated at 27.1% (164 of 603 strings)
2020-10-31 10:38:57 +01:00
J. Lavoie
952bb1a2eb Translated using Weblate (Italian)
Currently translated at 100.0% (603 of 603 strings)
2020-10-31 10:38:57 +01:00
J. Lavoie
c287813e00 Translated using Weblate (French)
Currently translated at 100.0% (603 of 603 strings)
2020-10-31 10:38:56 +01:00
J. Lavoie
eab4fd80d7 Translated using Weblate (Spanish)
Currently translated at 100.0% (603 of 603 strings)
2020-10-31 10:38:56 +01:00
SiD ViCiO
5c8f8869d4 Translated using Weblate (Spanish)
Currently translated at 100.0% (603 of 603 strings)
2020-10-31 10:38:56 +01:00
J. Lavoie
4954dfe107 Translated using Weblate (German)
Currently translated at 100.0% (603 of 603 strings)
2020-10-31 10:38:56 +01:00
Tobias Groza
4eb8094fb8 Merge pull request #4695 from mimi89999/dev
Add missing screenshots
2020-10-30 18:04:32 +01:00
mimi89999
1dd2423a0b Add missing screenshots 2020-10-30 17:26:11 +01:00
Ville Rantanen
6fcf989c62 Translated using Weblate (Finnish)
Currently translated at 100.0% (603 of 603 strings)
2020-10-30 14:34:04 +01:00
J. Lavoie
67d1a4f643 Translated using Weblate (Finnish)
Currently translated at 100.0% (603 of 603 strings)
2020-10-30 14:34:03 +01:00
J. Lavoie
3df9433baf Translated using Weblate (German)
Currently translated at 100.0% (603 of 603 strings)
2020-10-30 14:21:03 +01:00
C. Rüdinger
b12d568147 Translated using Weblate (German)
Currently translated at 100.0% (603 of 603 strings)
2020-10-30 14:21:02 +01:00
Weblate
8691e035a0 Added translation using Weblate (English (United Kingdom)) 2020-10-29 13:06:34 +01:00
vkay94
2683043762 Player gestures: separate logic and UI 2020-10-29 12:46:34 +01:00
Boris Petrov
be5aa59f61 Translated using Weblate (French)
Currently translated at 19.4% (7 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-10-29 00:57:55 +01:00
Franco
9398dfb7cf Translated using Weblate (Spanish)
Currently translated at 16.6% (6 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/es/
2020-10-29 00:57:54 +01:00
simo
ff6d2b30e4 Translated using Weblate (Arabic)
Currently translated at 52.7% (19 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ar/
2020-10-29 00:57:54 +01:00
Michal L
29bb999a32 Translated using Weblate (Polish)
Currently translated at 36.1% (13 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pl/
2020-10-29 00:57:53 +01:00
nalinalini
9320507e26 Translated using Weblate (Hindi)
Currently translated at 0.0% (0 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/hi/
2020-10-29 00:57:52 +01:00
Paulo Almeida
181fc4fa0a Translated using Weblate (Portuguese (Brazil))
Currently translated at 16.6% (6 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_BR/
2020-10-29 00:57:52 +01:00
Allan Nordhøy
4f3dd4b662 Translated using Weblate (Norwegian Bokmål)
Currently translated at 93.3% (563 of 603 strings)
2020-10-29 00:57:52 +01:00
nalinalini
7b09de99ea Translated using Weblate (Hindi)
Currently translated at 77.9% (470 of 603 strings)
2020-10-29 00:57:51 +01:00
Milo Ivir
f9f0da18e1 Translated using Weblate (Croatian)
Currently translated at 98.5% (594 of 603 strings)
2020-10-29 00:57:51 +01:00
Michal L
ba0fdb9478 Translated using Weblate (Polish)
Currently translated at 100.0% (603 of 603 strings)
2020-10-29 00:57:49 +01:00
simo
8c684bca22 Translated using Weblate (Arabic)
Currently translated at 100.0% (603 of 603 strings)
2020-10-29 00:57:49 +01:00
Boris Petrov
1266a75549 Translated using Weblate (French)
Currently translated at 100.0% (603 of 603 strings)
2020-10-29 00:57:48 +01:00
TobiGr
3871d5aed7 Merge branch 'master' into dev 2020-10-28 15:14:48 +01:00
Tobias Groza
25d555126d Merge pull request #4675 from B0pol/hotfix
Release 0.20.2 (956)
2020-10-28 07:39:44 +01:00
Tobias Groza
f529d15d7a Update fastlane/metadata/android/en-US/changelogs/956.txt
Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com>
2020-10-28 07:35:04 +01:00
TobiGr
9eda30fc71 Bump extractor version 2020-10-28 07:34:34 +01:00
Tobias Groza
dfd6424d9c Merge pull request #4655 from B0pol/polish
polish strings
2020-10-28 07:26:38 +01:00
Weblate
fdc961f2de Added translation using Weblate (Odia) 2020-10-27 15:17:51 +01:00
nalinalini
a6d4000d24 Added translation using Weblate (Odia) 2020-10-27 15:17:40 +01:00
bopol
e1024e59c3 Release 0.20.2 (956) 2020-10-27 14:47:23 +01:00
Edoardo Regni
990164802d Translated using Weblate (Dutch (Belgium))
Currently translated at 2.7% (1 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/nl_BE/
2020-10-27 13:51:38 +01:00
Ajeje Brazorf
34f18fbdb3 Translated using Weblate (Sardinian)
Currently translated at 100.0% (603 of 603 strings)
2020-10-27 13:51:38 +01:00
Bjorn Roesbeke
17e24bb038 Translated using Weblate (Dutch (Belgium))
Currently translated at 100.0% (603 of 603 strings)
2020-10-27 13:51:37 +01:00
Edoardo Regni
df7e2b7734 Translated using Weblate (Dutch (Belgium))
Currently translated at 100.0% (603 of 603 strings)
2020-10-27 13:51:37 +01:00
Vojtěch Šamla
1ddef06bd2 Translated using Weblate (Czech)
Currently translated at 98.6% (595 of 603 strings)
2020-10-27 13:51:36 +01:00
pjammo
18bd910bf0 Translated using Weblate (Italian)
Currently translated at 100.0% (603 of 603 strings)
2020-10-27 13:51:36 +01:00
Bjorn Roesbeke
0db44f6e33 Translated using Weblate (Dutch)
Currently translated at 100.0% (603 of 603 strings)
2020-10-27 13:51:36 +01:00
bopol
7aac3d38f0 Update Extractor version 2020-10-26 18:59:06 +01:00
Stypox
e406b6f780 Fix NullPointerException in queue handling 2020-10-26 18:15:59 +01:00
bopol
2dad9666a9 polish strings, fix build error 2020-10-26 17:01:55 +01:00
TobiGr
063abf1688 Update checkstyle 2020-10-25 21:29:07 +01:00
Tobias Groza
a86f8e9a22 Merge pull request #4592 from Isira-Seneviratne/Use_DrawableCompat
Use DrawableCompat.
2020-10-25 21:13:02 +01:00
Edoardo Regni
0ce6d4fe92 Translated using Weblate (Dutch (Belgium))
Currently translated at 99.8% (602 of 603 strings)
2020-10-25 20:40:57 +01:00
zmni
886f6c721c Translated using Weblate (Indonesian)
Currently translated at 99.8% (602 of 603 strings)
2020-10-25 20:40:57 +01:00
Gontzal Manuel Pujana Onaindia
9d7d089279 Translated using Weblate (Basque)
Currently translated at 99.3% (599 of 603 strings)
2020-10-25 20:40:56 +01:00
Isira Seneviratne
0bd624dfa9 Use DrawableCompat. 2020-10-25 21:01:53 +05:30
Eric
8c29760d93 Translated using Weblate (Chinese (Simplified))
Currently translated at 63.8% (23 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/
2020-10-25 16:16:26 +01:00
SeungCheol Han
9b893d841d Translated using Weblate (Korean)
Currently translated at 5.5% (2 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ko/
2020-10-25 16:16:25 +01:00
Yaron Shahrabani
e8c0163153 Translated using Weblate (Hebrew)
Currently translated at 13.8% (5 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/he/
2020-10-25 16:16:25 +01:00
nautilusx
256568d966 Translated using Weblate (German)
Currently translated at 16.6% (6 of 36 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/
2020-10-25 16:16:24 +01:00
ssantos
34bed47a52 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:24 +01:00
Edoardo Regni
9b0996fade Translated using Weblate (Dutch (Belgium))
Currently translated at 99.8% (602 of 603 strings)
2020-10-25 16:16:23 +01:00
Azizov Aga
7c1028df5d Translated using Weblate (Azerbaijani)
Currently translated at 26.5% (160 of 603 strings)
2020-10-25 16:16:20 +01:00
Milo Ivir
eaea60e0cb Translated using Weblate (Croatian)
Currently translated at 90.5% (546 of 603 strings)
2020-10-25 16:16:19 +01:00
Allan Nordhøy
efab05dcfc Translated using Weblate (Swedish)
Currently translated at 93.2% (562 of 603 strings)
2020-10-25 16:16:19 +01:00
Yaron Shahrabani
d79f77f7e0 Translated using Weblate (Hebrew)
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:18 +01:00
Jeff Huang
f0d459d490 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:18 +01:00
Eric
e269c073ac Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:17 +01:00
Samuel Carvalho de Araújo
85d5609144 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:17 +01:00
Emin Tufan Çetin
671c593db1 Translated using Weblate (Turkish)
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:16 +01:00
simo
8b14c7a2cb Translated using Weblate (Arabic)
Currently translated at 99.0% (597 of 603 strings)
2020-10-25 16:16:16 +01:00
Josu
23862419eb Translated using Weblate (Basque)
Currently translated at 97.8% (590 of 603 strings)
2020-10-25 16:16:15 +01:00
ssantos
43d54db4dd Translated using Weblate (Portuguese)
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:14 +01:00
AioiLight
b8b0060440 Translated using Weblate (Japanese)
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:14 +01:00
Mitosagi
64d79ceb30 Translated using Weblate (Japanese)
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:13 +01:00
Nikita Epifanov
25f7b44d48 Translated using Weblate (Russian)
Currently translated at 99.1% (598 of 603 strings)
2020-10-25 16:16:13 +01:00
Edoardo Regni
ada7e628da Translated using Weblate (Dutch)
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:13 +01:00
nautilusx
76f2338c3d Translated using Weblate (German)
Currently translated at 100.0% (603 of 603 strings)
2020-10-25 16:16:12 +01:00
Stypox
a0ed8036c0 Merge pull request #4594 from Isira-Seneviratne/Use_TextViewCompat
Use TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds().
2020-10-25 14:44:01 +01:00
TobiGr
863ce65b10 Fix Issue Template config 2020-10-24 20:44:22 +02:00
Weblate
85190b16cb Added translation using Weblate (Kashmiri) 2020-10-24 05:01:01 +02:00
TobiGr
abc6fd8b2a polish more 2020-10-23 23:22:00 +02:00
TobiGr
b6f603154e polish some stuff 2020-10-23 23:18:34 +02:00
Tobias Groza
90cb9d3de1 Merge pull request #4549 from Stypox/fix-showMiniPlayer
Fix IllegalStateException after onSaveInstanceState
2020-10-23 21:58:20 +02:00
Viktor K
d47c9a2e29 Translated using Weblate (German)
Currently translated at 99.8% (602 of 603 strings)
2020-10-23 19:49:48 +02:00
TobiGr
b7aea96ca0 Translated using Weblate (German)
Currently translated at 99.8% (602 of 603 strings)
2020-10-23 19:49:47 +02:00
nautilusx
a5879a4407 Translated using Weblate (German)
Currently translated at 99.8% (602 of 603 strings)
2020-10-23 19:49:47 +02:00
Tobias Groza
0452c69771 Merge pull request #4610 from mhmdanas/optimize-pngs
Optimize app PNGs
2020-10-23 19:37:23 +02:00
Tobias Groza
4eb9dff45e Merge pull request #4611 from TeamNewPipe/prevent_blank_issues
Create config.yaml to prevent blank issues
2020-10-23 19:18:25 +02:00
opusforlife2
b7c1e88b59 Create config.yaml to prevent blank issues 2020-10-23 14:37:59 +00:00
mhmdanas
23814330d9 Optimize app PNGs 2020-10-23 17:00:39 +03:00
Hosted Weblate
8bc75aacea Merge branch 'origin/dev' into Weblate. 2020-10-23 10:54:04 +02:00
Prasanta-Hembram
17576d223a Translated using Weblate (Santali)
Currently translated at 6.1% (37 of 600 strings)
2020-10-23 10:54:04 +02:00
mmagian
90e8f0ca63 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (600 of 600 strings)
2020-10-23 10:54:03 +02:00
TobiGr
adc4a811b7 Merge remote-tracking branch 'Weblate/dev' into dev 2020-10-23 10:52:51 +02:00
Tobias Groza
7c80233f26 Merge pull request #4345 from vkay94/fix-createplaylist
Fix PlaylistAppendDialog showing when no local playlists exist
2020-10-23 10:08:20 +02:00
Tobias Groza
f05ae2de35 Merge pull request #4606 from TeamNewPipe/refine_issue_templates
Refined instructions in the issue templates
2020-10-23 09:59:13 +02:00
opusforlife2
cf9da556a8 Refined instructions for feature request template 2020-10-23 07:55:31 +00:00
vkay94
32a142bf79 Fix PlaylistAppendDialog: Renamed method and replaced with Runnable 2020-10-23 09:44:26 +02:00
vkay94
2680d41a3d Fix PlaylistAppendDialog showing when no local playlists exist 2020-10-23 09:44:26 +02:00
opusforlife2
1550fc4398 Refined instructions for bug report template 2020-10-23 07:32:04 +00:00
Weblate
f2a85f3b7e Added translation using Weblate (Santali) 2020-10-22 20:40:29 +02:00
Milo Ivir
49c2b4c196 Translated using Weblate (Croatian)
Currently translated at 5.7% (2 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/hr/
2020-10-22 20:34:47 +02:00
Digiwizkid
a8281e174e Translated using Weblate (Bengali (India))
Currently translated at 58.8% (353 of 600 strings)
2020-10-22 20:34:47 +02:00
Shiv
d7f5c8bd55 Translated using Weblate (Hindi)
Currently translated at 78.6% (472 of 600 strings)
2020-10-22 20:34:46 +02:00
Rishi Dutt Shukla
b3337df88b Translated using Weblate (Hindi)
Currently translated at 78.6% (472 of 600 strings)
2020-10-22 20:34:46 +02:00
Yaron Shahrabani
d760616e55 Translated using Weblate (Hebrew)
Currently translated at 100.0% (600 of 600 strings)
2020-10-22 20:34:46 +02:00
Jeff Huang
914a4d32b4 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (600 of 600 strings)
2020-10-22 20:34:46 +02:00
David Braz
148f53e21e Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.8% (599 of 600 strings)
2020-10-22 20:34:45 +02:00
Vojtěch Šamla
5e7fa0f964 Translated using Weblate (Czech)
Currently translated at 100.0% (600 of 600 strings)
2020-10-22 20:34:45 +02:00
Vibo Lavida
0973ceb9d2 Translated using Weblate (Spanish)
Currently translated at 100.0% (600 of 600 strings)
2020-10-22 20:34:45 +02:00
bopol
5214bfe8cb Merge pull request #4554 from mitosagi/translate-numbers
Translates shortened notation of numbers
2020-10-22 19:05:53 +02:00
Isira Seneviratne
187aaafddc Use TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(). 2020-10-22 06:01:49 +05:30
opusforlife2
208cb405ca Merge pull request #4559 from TeamNewPipe/remove_coming_features
Removed "Coming features" because why??
2020-10-19 04:35:53 +00:00
opusforlife2
9b9d267cd4 Merge pull request #4553 from TacoTheDank/about-viewpager2
Migrate AboutActivity to ViewPager2
2020-10-18 10:12:20 +00:00
opusforlife2
6f90a27f9f Removed "Coming features" because why?? 2020-10-18 10:09:45 +00:00
Stypox
4e1dddc06d Merge pull request #4557 from Isira-Seneviratne/Use_multidex_for_all_build_types
Use multidex for all build types.
2020-10-18 12:09:42 +02:00
Hakim Oubouali
1f504d6f23 Translated using Weblate (Central Atlas Tamazight)
Currently translated at 28.6% (172 of 600 strings)
2020-10-18 11:29:15 +02:00
Hakim Oubouali
2db1fd813f Translated using Weblate (Berber)
Currently translated at 23.6% (142 of 600 strings)
2020-10-18 11:29:11 +02:00
Sérgio Marques
f39383a3d8 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (600 of 600 strings)
2020-10-18 11:29:08 +02:00
Ajeje Brazorf
b593bdbf1b Translated using Weblate (Sardinian)
Currently translated at 99.8% (599 of 600 strings)
2020-10-18 11:29:07 +02:00
PPNplus
4de93ba3c0 Translated using Weblate (Thai)
Currently translated at 47.0% (282 of 600 strings)
2020-10-18 11:29:07 +02:00
Azizov Aga
2eb7a91987 Translated using Weblate (Azerbaijani)
Currently translated at 22.3% (134 of 600 strings)
2020-10-18 11:29:06 +02:00
Garden Hose
94e4264c2a Translated using Weblate (Croatian)
Currently translated at 87.1% (523 of 600 strings)
2020-10-18 11:29:05 +02:00
Eric
e54d28f157 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (600 of 600 strings)
2020-10-18 11:29:05 +02:00
Ali Demirtas
6111c8bde0 Translated using Weblate (Turkish)
Currently translated at 100.0% (600 of 600 strings)
2020-10-18 11:29:04 +02:00
zmni
3bacdfd4fc Translated using Weblate (Indonesian)
Currently translated at 100.0% (600 of 600 strings)
2020-10-18 11:29:03 +02:00
Hakim Oubouali
65db645ff9 Translated using Weblate (Arabic)
Currently translated at 100.0% (600 of 600 strings)
2020-10-18 11:29:02 +02:00
random r
de2e2c45a5 Translated using Weblate (Italian)
Currently translated at 100.0% (600 of 600 strings)
2020-10-18 11:29:02 +02:00
Mitosagi
9b655e18e3 Translated using Weblate (Japanese)
Currently translated at 99.8% (599 of 600 strings)
2020-10-18 11:29:02 +02:00
Nikita Epifanov
fb4b9b5f76 Translated using Weblate (Russian)
Currently translated at 100.0% (600 of 600 strings)
2020-10-18 11:29:02 +02:00
Ali Demirtas
820b39840a Translated using Weblate (English)
Currently translated at 100.0% (600 of 600 strings)
2020-10-18 11:29:01 +02:00
mabroukb
4b1052eb70 Translated using Weblate (French)
Currently translated at 99.6% (598 of 600 strings)
2020-10-18 11:29:01 +02:00
nautilusx
c0eb3972a7 Translated using Weblate (German)
Currently translated at 100.0% (600 of 600 strings)
2020-10-18 11:29:01 +02:00
Isira Seneviratne
66ba8d56b7 Use multidex for all build types. 2020-10-18 14:14:27 +05:30
Stypox
a73baf32f1 Merge pull request #4547 from Isira-Seneviratne/Use_Core_KTX_functions
Use Core KTX functions.
2020-10-18 09:39:28 +02:00
Tobias Groza
333cf0a2f0 Merge pull request #4550 from Stypox/no-drag-thumbnails
Don't rearrange lists by dragging the thumbnails
2020-10-18 09:00:56 +02:00
mitosagi
8347d8700a Translate the numeric notation 2020-10-18 11:01:06 +09:00
TacoTheDank
09af0e2448 Migrate AboutActivity to viewpager2 2020-10-17 19:15:10 -04:00
Tobias Groza
001914764a Merge pull request #4530 from TeamNewPipe/weblate-widget
Add Weblate widget to README
2020-10-17 17:08:35 +02:00
Stypox
6938dd6267 Add Weblate widget to README 2020-10-17 16:41:39 +02:00
Stypox
941028ba6f Don't rearrange lists by dragging the thumbnails 2020-10-17 16:25:06 +02:00
Stypox
4ca7ed9f8c Fix IllegalStateException after onSaveInstanceState 2020-10-17 16:13:42 +02:00
Isira Seneviratne
03d99887c5 Use TextView.doOnTextChanged() extension. 2020-10-17 19:22:13 +05:30
Isira Seneviratne
293e2ff5e3 Use isVisible and isGone extensions for View. 2020-10-17 15:54:35 +05:30
Isira Seneviratne
55d242fa08 Use bundleOf(). 2020-10-17 15:38:45 +05:30
TobiGr
7e9fba2d96 Merge branch 'master' into dev 2020-10-16 22:33:58 +02:00
TobiGr
175652f23b Release 0.20.1 (955) 2020-10-16 22:20:23 +02:00
TobiGr
3329e0c4a1 Update extractor version
[YouTube] Fix search for some users
[YouTube] Fix random decryption exceptions
[SoundCloud] URLs that end with a slash are now parsed correctly
2020-10-16 22:20:16 +02:00
Tobias Groza
3c5ed2c885 Merge pull request #4453 from wb9688/clear-cookies
Add button in settings to clear reCAPTCHA cookies
2020-10-16 17:25:19 +02:00
Tobias Groza
c4af93c363 Merge pull request #4528 from TeamNewPipe/local-extractor
Add info on how to use a local NewPipe Extractor version
2020-10-16 17:24:35 +02:00
Sérgio Marques
e2685c4503 Translated using Weblate (Portuguese)
Currently translated at 100.0% (600 of 600 strings)
2020-10-16 16:55:13 +02:00
TobiGr
48b1d3fff8 Add info to build.gradle and settings.gradle on how to use a local
NewPipe extractor version.
2020-10-16 13:27:09 +02:00
Tobias Groza
6c4920949d Merge pull request #4517 from wb9688/disable-ktlint
Disable Ktlint for now
2020-10-15 17:54:48 +02:00
wb9688
69447b75af Disable Ktlint for now 2020-10-15 14:38:59 +02:00
Allan Nordhøy
e1104570a9 Pull request template reworked (#4317)
Co-authored-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com>
2020-10-14 21:30:30 +02:00
wb9688
2c23678fb9 Add button in settings to clear reCAPTCHA cookies 2020-10-14 14:39:08 +02:00
Tobias Groza
613070d39f Merge pull request #4471 from wb9688/format-xml
Format all XML resources
2020-10-14 13:36:32 +02:00
wb9688
6deae64f45 Delete old player notification layouts 2020-10-14 11:04:49 +02:00
wb9688
aced2b124c Format all XML resources 2020-10-14 11:04:48 +02:00
Hakim Oubouali
e6b08de2e8 Translated using Weblate (Central Atlas Tamazight)
Currently translated at 8.1% (49 of 600 strings)
2020-10-13 11:26:57 +02:00
random r
d2d02d0749 Translated using Weblate (Italian)
Currently translated at 11.4% (4 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/it/
2020-10-13 11:26:57 +02:00
MohammedSR Vevo
28d27801b2 Translated using Weblate (Kurdish)
Currently translated at 99.3% (596 of 600 strings)
2020-10-13 11:26:56 +02:00
Hakim Oubouali
be340dd275 Translated using Weblate (Central Atlas Tamazight)
Currently translated at 8.0% (48 of 600 strings)
2020-10-12 11:27:02 +02:00
TobiGr
58090fb3de Translated using Weblate (German)
Currently translated at 100.0% (600 of 600 strings)
2020-10-12 11:27:01 +02:00
Stypox
ae33c6cf18 Merge pull request #4476 from vkay94/two-finger-to-close-player
Two finger to close player gesture
2020-10-11 14:51:45 +02:00
vkay94
f8cd6afbf8 Two finger gesture: Less code lines 2020-10-11 13:56:30 +02:00
Tobias Groza
6fce06906d Merge pull request #4354 from Stypox/restriction-strings
Improve age restriction and yt restricted content strings
2020-10-11 12:14:13 +02:00
Stypox
84694a8bbd Improve age restriction and yt restricted content strings 2020-10-11 12:06:36 +02:00
chr56
1639e68424 Translated using Weblate (Chinese (Simplified))
Currently translated at 62.8% (22 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/
2020-10-11 11:25:51 +02:00
sivemortenfan
ff48fe8b49 Translated using Weblate (Malayalam)
Currently translated at 2.8% (1 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ml/
2020-10-11 11:25:50 +02:00
Milo Ivir
efe06267ec Translated using Weblate (Croatian)
Currently translated at 2.8% (1 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/hr/
2020-10-11 11:25:50 +02:00
Milo Ivir
53647ea5a8 Translated using Weblate (Croatian)
Currently translated at 86.8% (521 of 600 strings)
2020-10-11 11:25:50 +02:00
C. Rüdinger
7742de5af4 Translated using Weblate (German)
Currently translated at 100.0% (600 of 600 strings)
2020-10-11 11:25:49 +02:00
Stypox
724a260f71 Merge pull request #4413 from Stypox/delete-stream-state
Also delete stream state when deleting stream history
2020-10-10 22:29:33 +02:00
Stypox
cf75e40332 Merge pull request #4463 from opusforlife2/confirm_queue_delete_one_track
Ask for confirmation before clearing queue even if only 1 video in it
2020-10-10 22:01:55 +02:00
Stypox
3c67df263c Merge pull request #4276 from Isira-Seneviratne/Use_ContextCompat_methods
Use ContextCompat methods.
2020-10-10 21:51:34 +02:00
Stypox
c4ae72c3c1 Merge pull request #4450 from wb9688/fix-release-debug-settings
Fix compiling release build
2020-10-10 21:14:39 +02:00
vkay94
f6925fc5b8 Added two finger to close player gesture 2020-10-10 15:00:39 +02:00
Eric
18be9655d6 Translated using Weblate (Chinese (Simplified))
Currently translated at 62.8% (22 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/
2020-10-10 11:26:15 +02:00
S
6235b6123e Translated using Weblate (German)
Currently translated at 14.2% (5 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/
2020-10-10 11:26:13 +02:00
opusforlife2
b3555385e6 Ask for confirmation before clearing queue...
Even when there is only one video in it.
2020-10-09 14:46:42 +00:00
Hakim Oubouali
c9fbdb322b Translated using Weblate (Central Atlas Tamazight)
Currently translated at 7.6% (46 of 600 strings)
2020-10-09 11:26:02 +02:00
Mostafa Ahangarha
94bac7d8db Translated using Weblate (Persian)
Currently translated at 14.2% (5 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fa/
2020-10-09 11:26:01 +02:00
Thien Bui
f38119be96 Translated using Weblate (Vietnamese)
Currently translated at 11.4% (4 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/vi/
2020-10-09 11:26:01 +02:00
zeritti
bc1d2ba839 Translated using Weblate (Czech)
Currently translated at 5.7% (2 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/cs/
2020-10-09 11:26:00 +02:00
Nikita Epifanov
18f5b70b1f Translated using Weblate (Russian)
Currently translated at 5.7% (2 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ru/
2020-10-09 11:26:00 +02:00
Ajeje Brazorf
7df9b07305 Translated using Weblate (Sardinian)
Currently translated at 100.0% (600 of 600 strings)
2020-10-09 11:26:00 +02:00
Stjepan
cf01c1fd1f Translated using Weblate (Croatian)
Currently translated at 86.3% (518 of 600 strings)
2020-10-09 11:25:59 +02:00
Thien Bui
2ce6fe420b Translated using Weblate (Vietnamese)
Currently translated at 100.0% (600 of 600 strings)
2020-10-09 11:25:58 +02:00
Isira Seneviratne
f55381d689 Combine initNotificationChannel() and setUpUpdateNotificationChannel() into a single method. 2020-10-09 08:52:05 +05:30
Isira Seneviratne
c4084c4f97 Use ContextCompat.startForegroundService(). 2020-10-09 08:52:05 +05:30
Isira Seneviratne
58b720b004 Use ContextCompat.getSystemService() and the Context.getSystemService() extension function. 2020-10-09 08:52:05 +05:30
wb9688
f6d0c1f05e Fix compiling release build 2020-10-08 18:36:20 +02:00
Stypox
f4620be859 Merge pull request #4431 from opusforlife2/checkbox_example
Added an example of how to use Markdown checkbox
2020-10-08 16:02:04 +02:00
Hakim Oubouali
e2b3a98690 Translated using Weblate (Central Atlas Tamazight)
Currently translated at 6.3% (38 of 600 strings)
2020-10-08 11:25:19 +02:00
postsorino
4cd391d5ef Translated using Weblate (Greek)
Currently translated at 93.8% (563 of 600 strings)
2020-10-08 11:25:18 +02:00
Weblate
01c37c34dd Added translation using Weblate (Central Atlas Tamazight) 2020-10-08 10:37:37 +02:00
Stjepan
f4827cde0e Translated using Weblate (Croatian)
Currently translated at 85.1% (511 of 600 strings)
2020-10-07 16:11:05 +02:00
Stjepan
3e722295b0 Translated using Weblate (Croatian)
Currently translated at 83.0% (498 of 600 strings)
2020-10-07 15:11:13 +02:00
zmni
0d2eab3ad4 Translated using Weblate (Indonesian)
Currently translated at 5.7% (2 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/id/
2020-10-07 13:55:09 +02:00
Stypox
9e1bc631cf Merge pull request #4436 from wb9688/hide-leaks
Hide Leaks launcher icon
2020-10-07 13:26:12 +02:00
wb9688
ca9fbe2f11 Hide Leaks launcher icon 2020-10-07 12:56:22 +02:00
opusforlife2
2e28fad102 Added checkbox example 2020-10-07 07:40:55 +00:00
opusforlife2
69760200dd Added checkbox example 2020-10-07 07:39:49 +00:00
Mario Rossi
f945ee1288 Translated using Weblate (Neapolitan)
Currently translated at 5.6% (34 of 600 strings)
2020-10-07 09:24:11 +02:00
Eric
5e3486c481 Translated using Weblate (Chinese (Simplified))
Currently translated at 60.0% (21 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/
2020-10-07 09:24:11 +02:00
Jeff Huang
c15a943cf4 Translated using Weblate (Chinese (Traditional))
Currently translated at 62.8% (22 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hant/
2020-10-07 09:24:10 +02:00
Ortinomax
b8cb29c66c Translated using Weblate (French)
Currently translated at 14.2% (5 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-10-07 09:24:09 +02:00
Oğuz Ersen
003badcb5a Translated using Weblate (Turkish)
Currently translated at 5.7% (2 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/tr/
2020-10-07 09:24:08 +02:00
Eric
5b2493fa68 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (600 of 600 strings)
2020-10-07 09:24:08 +02:00
Stypox
bc342b9b33 Merge pull request #4367 from panoreak/remove-remember-popup-properties
Removed remember popup properties setting
2020-10-07 07:01:56 +02:00
Panorea
314615bfef Removed remember popup properties setting 2020-10-06 18:32:20 -04:00
Stypox
44e82217c1 Merge pull request #4425 from vkay94/enqueue-stream
Replace specific enqueue options with one
2020-10-06 22:37:19 +02:00
vkay94
cbf364f24f Enqueue: Renamed string resource 2020-10-06 21:17:52 +02:00
Weblate
44dfcb927b Added translation using Weblate (Neapolitan) 2020-10-06 20:36:17 +02:00
vkay94
12f615c6da Enqueue: Removed unneeded dialog-entries and strings + adjustments 2020-10-06 17:22:12 +02:00
vkay94
ed6fc4d848 Enqueue: Replaced specific StreamDialogEntry items with one
The enqueue options won't be shown in the dialogs if the Player service is not running. When it's running one item (enqueue stream) will be shown and enqueues the item into the Player type which is currently selected.
2020-10-06 14:38:48 +02:00
vkay94
cd515993f5 Enqueue: Add auto-select StreamDialogEntry for current PlayerType 2020-10-06 13:33:44 +02:00
Tobias Groza
a918eaac3f Add device info fields to bug report template (#4415) 2020-10-05 19:38:30 +02:00
Tobias Groza
9f63e2d39a Merge pull request #4410 from Stypox/notification-fixes
Notification fixes
2020-10-05 19:08:26 +02:00
Stypox
36248ff046 Also delete stream state when deleting stream history 2020-10-05 17:47:48 +02:00
Stypox
a88f5113e0 Hide player notification "when" time
It is useless to see how much time ago a player notification was created
2020-10-05 15:57:14 +02:00
Stypox
06fb89fae2 Fix crash on fast forward 2020-10-05 15:55:10 +02:00
RainSlide
733531356f Translated using Weblate (Chinese (Simplified))
Currently translated at 42.8% (15 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/
2020-10-05 15:44:24 +02:00
Marian Hanzel
3f8fb30066 Translated using Weblate (Slovak)
Currently translated at 2.8% (1 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/sk/
2020-10-05 15:44:23 +02:00
WaldiS
1a4a2d2b30 Translated using Weblate (Polish)
Currently translated at 31.4% (11 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pl/
2020-10-05 15:44:22 +02:00
David Braz
eb6d3b3f8d Translated using Weblate (Portuguese (Brazil))
Currently translated at 14.2% (5 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_BR/
2020-10-05 15:44:22 +02:00
San Kang
e8e3363d06 Translated using Weblate (Korean)
Currently translated at 84.0% (504 of 600 strings)
2020-10-05 15:44:21 +02:00
Tobias Groza
dd55ad61f4 Merge pull request #4338 from Isira-Seneviratne/Use_DisplayCutoutCompat
Use DisplayCutoutCompat in VideoPlayerImpl.
2020-10-05 08:33:41 +02:00
Guillaume Démurgé
2464bfd70b Translated using Weblate (French)
Currently translated at 11.4% (4 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
2020-10-04 22:01:35 +02:00
JoC
09bc36bb13 Translated using Weblate (Spanish)
Currently translated at 14.2% (5 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/es/
2020-10-04 22:01:34 +02:00
thami simo
39da89b556 Translated using Weblate (Arabic)
Currently translated at 20.0% (7 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ar/
2020-10-04 22:01:34 +02:00
thami simo
c23de4b3b0 Translated using Weblate (Arabic)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 22:01:33 +02:00
Mohammed Anas
7c79d7f5d7 Translated using Weblate (Arabic)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 20:52:43 +02:00
thami simo
710507da51 Translated using Weblate (Arabic)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 20:52:42 +02:00
Tobias Groza
10e95bf1b1 Merge pull request #4379 from opusforlife2/update_FR_template
Add check boxes to Feature Request template
2020-10-04 15:55:40 +02:00
Tobias Groza
66a893c84e Merge pull request #4378 from opusforlife2/update_issue_template
Replace long comments with check boxes in the Bug Report template
2020-10-04 15:55:22 +02:00
Stypox
dd6392e380 Replace per with for every 2020-10-04 15:47:20 +02:00
Tobias Groza
ea0a0c7c5a Merge pull request #4333 from TeamNewPipe/release/0.20.0
Release 0.20.0
2020-10-04 14:53:37 +02:00
opusforlife2
b8f7ba62c7 Use @Stypox 's suggestion
Co-authored-by: Stypox <stypox@pm.me>
2020-10-04 12:30:44 +00:00
opusforlife2
25b318ba00 Add check boxes
People seem to ignore instructions in comments
2020-10-04 12:24:56 +00:00
opusforlife2
9add51b59d Add checkboxes instead of long comments
People just seemed to ignore them.
2020-10-04 12:03:14 +00:00
Hosted Weblate
535a0504d8 Merge branch 'origin/dev' into Weblate. 2020-10-04 12:12:17 +02:00
Eric
365c49d6d2 Translated using Weblate (Chinese (Simplified))
Currently translated at 42.8% (15 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/
2020-10-04 12:11:08 +02:00
chr56
b70bea48f2 Translated using Weblate (Chinese (Traditional))
Currently translated at 8.5% (3 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hant/
2020-10-04 12:11:06 +02:00
Ajeje Brazorf
996f8644c4 Translated using Weblate (Sardinian)
Currently translated at 5.7% (2 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/sc/
2020-10-04 12:11:06 +02:00
ssantos
b3882ec6e3 Translated using Weblate (Portuguese (Portugal))
Currently translated at 48.5% (17 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt_PT/
2020-10-04 12:11:05 +02:00
Yaron Shahrabani
f87d447397 Translated using Weblate (Hebrew)
Currently translated at 2.8% (1 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/he/
2020-10-04 12:11:05 +02:00
ssantos
9d8570d0d2 Translated using Weblate (Portuguese)
Currently translated at 48.5% (17 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pt/
2020-10-04 12:11:04 +02:00
AioiLight
796755dad8 Translated using Weblate (Japanese)
Currently translated at 8.5% (3 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ja/
2020-10-04 12:11:03 +02:00
Hakim Oubouali
9387753995 Translated using Weblate (Berber)
Currently translated at 23.5% (141 of 600 strings)
2020-10-04 12:11:03 +02:00
Allan Nordhøy
618d36dc07 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:11:02 +02:00
ssantos
f11b0be483 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:11:01 +02:00
Allan Nordhøy
1b8b15b136 Translated using Weblate (Sardinian)
Currently translated at 99.8% (599 of 600 strings)
2020-10-04 12:11:01 +02:00
Allan Nordhøy
bb63673cce Translated using Weblate (Central Kurdish)
Currently translated at 99.6% (598 of 600 strings)
2020-10-04 12:11:00 +02:00
Allan Nordhøy
6770ad68d5 Translated using Weblate (Malayalam)
Currently translated at 94.6% (568 of 600 strings)
2020-10-04 12:11:00 +02:00
Allan Nordhøy
bfe90c58d1 Translated using Weblate (Nepali)
Currently translated at 93.1% (559 of 600 strings)
2020-10-04 12:11:00 +02:00
Allan Nordhøy
f1cbeb3c29 Translated using Weblate (Danish)
Currently translated at 67.5% (405 of 600 strings)
2020-10-04 12:10:59 +02:00
Allan Nordhøy
554ab4ea16 Translated using Weblate (Galician)
Currently translated at 94.8% (569 of 600 strings)
2020-10-04 12:10:58 +02:00
Allan Nordhøy
a2becac2e6 Translated using Weblate (Punjabi)
Currently translated at 75.6% (454 of 600 strings)
2020-10-04 12:10:58 +02:00
gamerboy
67a651f5e9 Translated using Weblate (Punjabi)
Currently translated at 75.6% (454 of 600 strings)
2020-10-04 12:10:58 +02:00
Allan Nordhøy
ac8efe19d8 Translated using Weblate (Albanian)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:57 +02:00
Allan Nordhøy
ffd65d5afa Translated using Weblate (Urdu)
Currently translated at 79.0% (474 of 600 strings)
2020-10-04 12:10:57 +02:00
Allan Nordhøy
e86677178f Translated using Weblate (Catalan)
Currently translated at 81.5% (489 of 600 strings)
2020-10-04 12:10:57 +02:00
Allan Nordhøy
3c49a3341a Translated using Weblate (Kurdish)
Currently translated at 94.1% (565 of 600 strings)
2020-10-04 12:10:56 +02:00
Allan Nordhøy
3433b2a73e Translated using Weblate (Finnish)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:56 +02:00
Allan Nordhøy
730988e7b7 Translated using Weblate (Swedish)
Currently translated at 95.1% (571 of 600 strings)
2020-10-04 12:10:56 +02:00
Yaron Shahrabani
2a3b89e596 Translated using Weblate (Hebrew)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:55 +02:00
Allan Nordhøy
f1a31bf58c Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:54 +02:00
Allan Nordhøy
f1b62a9056 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:54 +02:00
Allan Nordhøy
dd943d24c8 Translated using Weblate (Polish)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:54 +02:00
Oğuz Ersen
801320a3f3 Translated using Weblate (Turkish)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:54 +02:00
Allan Nordhøy
222ed2debd Translated using Weblate (Indonesian)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:53 +02:00
Allan Nordhøy
7aab782c5f Translated using Weblate (Arabic)
Currently translated at 99.5% (597 of 600 strings)
2020-10-04 12:10:53 +02:00
Allan Nordhøy
3836f2f353 Translated using Weblate (Czech)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:53 +02:00
Allan Nordhøy
5bfaa9a5db Translated using Weblate (Esperanto)
Currently translated at 91.1% (547 of 600 strings)
2020-10-04 12:10:53 +02:00
Allan Nordhøy
95581771d6 Translated using Weblate (Slovak)
Currently translated at 98.3% (590 of 600 strings)
2020-10-04 12:10:53 +02:00
ssantos
db5e3f2479 Translated using Weblate (Portuguese)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:52 +02:00
Allan Nordhøy
b5a9631bcc Translated using Weblate (Korean)
Currently translated at 83.1% (499 of 600 strings)
2020-10-04 12:10:51 +02:00
Allan Nordhøy
4a2d62ece0 Translated using Weblate (Japanese)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:51 +02:00
Allan Nordhøy
c3836decee Translated using Weblate (Russian)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:51 +02:00
Allan Nordhøy
f7a030c895 Translated using Weblate (English)
Currently translated at 99.8% (599 of 600 strings)
2020-10-04 12:10:51 +02:00
Éfrit
f171a692d3 Translated using Weblate (English)
Currently translated at 99.8% (599 of 600 strings)
2020-10-04 12:10:51 +02:00
Allan Nordhøy
df5e73192b Translated using Weblate (Dutch)
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 12:10:50 +02:00
Allan Nordhøy
fc1447d614 Translated using Weblate (Hungarian)
Currently translated at 69.6% (418 of 600 strings)
2020-10-04 12:10:50 +02:00
Éfrit
77fd206b06 Translated using Weblate (French)
Currently translated at 99.8% (599 of 600 strings)
2020-10-04 12:10:50 +02:00
Allan Nordhøy
23bdc03490 Translated using Weblate (Spanish)
Currently translated at 99.8% (599 of 600 strings)
2020-10-04 12:10:49 +02:00
TobiGr
9fe4de5709 Added Portuguese (Portugal), Neapolitan and Sardinian 2020-10-04 12:01:16 +02:00
chr56
54fd601809 Translated using Weblate (Chinese (Simplified))
Currently translated at 40.0% (14 of 35 strings)

Translation: NewPipe/Metadata
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/
2020-10-04 06:20:00 +02:00
Isira Seneviratne
63d54e6570 Use DisplayCutoutCompat in VideoPlayerImpl. 2020-10-04 05:44:13 +05:30
Allan Nordhøy
71d027a966 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (600 of 600 strings)
2020-10-04 00:51:07 +02:00
Anxhelo Lushka
8b63aa2fe6 Translated using Weblate (Albanian)
Currently translated at 99.8% (599 of 600 strings)
2020-10-03 22:48:45 +02:00
TobiGr
5a35842c28 fix fastlane locale 2020-10-03 21:24:26 +02:00
Allan Nordhøy
d6a1ae3b3a Norwegian Bokmål fastlane support (#4374) 2020-10-03 21:17:56 +02:00
bopol
be5f4cb562 Rename full_description.fr.txt to full_description.txt 2020-10-03 18:29:52 +02:00
bopol
d8b5464833 Rename short_description.fr.txt to short_description.txt 2020-10-03 18:29:52 +02:00
Stypox
5e7bbcd3bc Add italian translation for fastlane 2020-10-03 18:29:52 +02:00
bopol
5383e53c4d fix typo in 0.20.0 french changelog 2020-10-03 18:29:52 +02:00
bopol
5b6fc713d6 translate fastlane metadata in french 2020-10-03 18:29:52 +02:00
TobiGr
272be025e1 Release 0.20.0 2020-10-03 18:29:52 +02:00
bopol
e4ab250729 add berber, bengali languages 2020-10-03 18:29:52 +02:00
TobiGr
4dcca9d5af Merge remote-tracking branch 'Weblate/dev' into dev 2020-10-02 21:23:33 +02:00
TobiGr
1988a08631 Translated using Weblate (Bengali)
Currently translated at 64.1% (385 of 600 strings)
2020-10-02 21:22:20 +02:00
Digiwizkid
34de0e569f Translated using Weblate (Bengali)
Currently translated at 64.1% (385 of 600 strings)
2020-10-02 21:22:20 +02:00
Kurd As
343d0fa09d Translated using Weblate (Central Kurdish)
Currently translated at 99.8% (599 of 600 strings)
2020-10-02 21:22:19 +02:00
TobiGr
8eb6686103 Translated using Weblate (Malay)
Currently translated at 68.6% (412 of 600 strings)
2020-10-02 21:22:19 +02:00
TobiGr
9e9687b5b8 Translated using Weblate (Belarusian)
Currently translated at 75.3% (452 of 600 strings)
2020-10-02 21:22:19 +02:00
TobiGr
ef888d1afe Translated using Weblate (Estonian)
Currently translated at 67.0% (402 of 600 strings)
2020-10-02 21:22:18 +02:00
TobiGr
0e70e1a37a Translated using Weblate (Punjabi)
Currently translated at 73.1% (439 of 600 strings)
2020-10-02 21:22:17 +02:00
TobiGr
06aaceb673 Translated using Weblate (Macedonian)
Currently translated at 64.3% (386 of 600 strings)
2020-10-02 21:22:16 +02:00
TobiGr
703a4b7858 Translated using Weblate (Bulgarian)
Currently translated at 62.0% (372 of 600 strings)
2020-10-02 21:22:16 +02:00
TobiGr
32ba2ba83d Translated using Weblate (Tamil)
Currently translated at 33.6% (202 of 600 strings)
2020-10-02 21:22:16 +02:00
TobiGr
272b03ed92 Translated using Weblate (Telugu)
Currently translated at 23.1% (139 of 600 strings)
2020-10-02 21:22:15 +02:00
TobiGr
ecf19214ee Translated using Weblate (Hindi)
Currently translated at 77.5% (465 of 600 strings)
2020-10-02 21:22:15 +02:00
TobiGr
f3eb0c497f Translated using Weblate (Croatian)
Currently translated at 82.6% (496 of 600 strings)
2020-10-02 21:22:15 +02:00
TobiGr
c1f29a7565 Translated using Weblate (Swedish)
Currently translated at 94.5% (567 of 600 strings)
2020-10-02 21:22:15 +02:00
TobiGr
fb745b9108 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 62.5% (375 of 600 strings)
2020-10-02 21:22:14 +02:00
TobiGr
9410bf40d3 Translated using Weblate (Persian)
Currently translated at 100.0% (600 of 600 strings)
2020-10-02 21:22:14 +02:00
Mostafa Ahangarha
c7a695cb04 Translated using Weblate (Persian)
Currently translated at 100.0% (600 of 600 strings)
2020-10-02 21:22:14 +02:00
TobiGr
b991d5cab6 Translated using Weblate (Romanian)
Currently translated at 65.6% (394 of 600 strings)
2020-10-02 21:22:12 +02:00
TobiGr
42fd318321 Translated using Weblate (Chinese (Traditional, Hong Kong))
Currently translated at 27.3% (164 of 600 strings)
2020-10-02 21:22:12 +02:00
TobiGr
903aeec383 Translated using Weblate (Basque)
Currently translated at 91.5% (549 of 600 strings)
2020-10-02 21:22:12 +02:00
ssantos
8768fe4dcf Translated using Weblate (Portuguese)
Currently translated at 96.0% (576 of 600 strings)
2020-10-02 21:22:11 +02:00
TobiGr
d8ba2ceed4 Translated using Weblate (Hungarian)
Currently translated at 69.6% (418 of 600 strings)
2020-10-02 21:22:11 +02:00
Tobias Groza
ef8a1bcf47 Merge pull request #4365 from B0pol/prettytime
Update to PrettyTime 4.0.6
2020-10-02 20:40:11 +02:00
bopol
2b1469e02e update to PrettyTime 4.0.6
fixes #4324
2020-10-03 19:04:44 +02:00
Tobias Groza
83ea91586b Merge pull request #4362 from Stypox/fix-queue
Random fixes and improvements
2020-10-02 16:48:04 +02:00
Stypox
dbb86d25e1 Fix video detail controls visibility set inconsistently 2020-10-02 16:03:43 +02:00
Tobias Groza
794c74e514 Merge pull request #4360 from avently/player-overlays
Player overlays now centered
2020-10-02 15:37:28 +02:00
Stypox
fbcdaa77e3 Initialize player notification asap
Otherwise Android's foreground services implementation would complain
2020-10-02 15:17:04 +02:00
Stypox
dbdc04c45e Make player close button always white 2020-10-02 14:53:16 +02:00
Stypox
a4bb22280f Prevent touches behind minimized player 2020-10-02 14:53:16 +02:00
Stypox
c0e1bbbfb6 Fix queue close image not following theme 2020-10-02 14:52:49 +02:00
TobiGr
196b9dc771 Remove unused string resource "enable_lock_screen_video_thumbnail_title" 2020-10-01 16:43:04 +02:00
TobiGr
09578b4e46 Remove unused string resource "enable_lock_screen_video_thumbnail_summary" 2020-10-01 16:43:04 +02:00
TobiGr
4d88dadf8c Remove unused string resource "play_btn_text" 2020-10-01 16:43:04 +02:00
TobiGr
d4fda5847d Remove unused string resource "next_video_title" 2020-10-01 16:43:04 +02:00
Tobias Groza
b1ea7d6cbc Merge pull request #4350 from 4D17Y4/commenter
Disabled commenter image view on LoadThumbnail set to false
2020-10-01 15:07:45 +02:00
Tobias Groza
4e7632949d Merge pull request #4347 from avently/player-rebind
Player rebind
2020-10-01 15:03:43 +02:00
Avently
26a8bd147b Now player's overlays are aware of insets 2020-10-01 03:10:51 +03:00
Avently
dd726fac02 Skipped interception of buttons in the player in some cases and made image view from playQueue visible 2020-10-01 03:10:42 +03:00
Tobias Groza
3a3ecc7775 Merge pull request #4353 from opusforlife2/tap_behind_queue
Prevent tapping behind queue in main player
2020-09-30 15:04:35 +02:00
Avently
6665d630ec Added comments and improved the code 2020-09-30 00:49:34 +03:00
opusforlife2
7706d7471a Do the same for tablet layout.
Signed-off-by: opusforlife2 <53176348+opusforlife2@users.noreply.github.com>
2020-09-30 02:17:04 +05:30
TobiGr
ed87d6b268 Deleted translation using Weblate (Neapolitan) 2020-09-29 21:57:04 +02:00
Tobias Groza
ed51c8b318 Merge pull request #4340 from Stypox/notification-settings-fix
Small adjustments to notification settings layout
2020-09-29 21:55:29 +02:00
TobiGr
6ffbb7b1ed Remove linebreaks from localizations of notification_actions_summary 2020-09-29 21:46:47 +02:00
Stypox
06764db118 Small adjustments to notification settings layout 2020-09-29 21:46:00 +02:00
TobiGr
4864fa3f2d Merge remote-tracking branch 'Weblate/dev' into dev 2020-09-29 21:08:17 +02:00
ssantos
2d25b6a1f4 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 21:07:53 +02:00
Ajeje Brazorf
be76b3d105 Translated using Weblate (Sardinian)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 21:07:52 +02:00
thami simo
81cbeb4b24 Translated using Weblate (Arabic)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 21:07:52 +02:00
Gontzal Manuel Pujana Onaindia
f0b658ba14 Translated using Weblate (Basque)
Currently translated at 91.5% (549 of 600 strings)
2020-09-29 21:07:52 +02:00
ssantos
295836fc7e Translated using Weblate (Portuguese)
Currently translated at 96.0% (576 of 600 strings)
2020-09-29 21:07:52 +02:00
opusforlife2
54e9858148 Prevent tapping behind queue in main player
(I have no idea what I just did. Shhh! Don't tell anyone. 🤫 )
2020-09-29 18:57:49 +00:00
TobiGr
b68f015825 Update extractor version 2020-09-29 20:25:28 +02:00
Aditya Srivastava
87ae26ede3 Disabled commenter image view on LoadThumbnail set to false 2020-09-29 21:17:39 +05:30
zmni
49615f81b4 Translated using Weblate (Indonesian)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 12:34:37 +02:00
Terry Louwers
87ce5140fa Translated using Weblate (Dutch)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 12:34:37 +02:00
Tobias Groza
3ba9fb375c Merge pull request #4349 from wb9688/fix-queue-with-no-next-videos
Fix auto-queue with no next videos
2020-09-29 12:18:57 +02:00
wb9688
f4bd20361a Fix auto-queue with no next videos 2020-09-29 10:43:17 +02:00
Oymate
54f8a17aac Translated using Weblate (Bengali)
Currently translated at 63.1% (379 of 600 strings)
2020-09-29 06:58:42 +02:00
Юрий Иванович Шмаровский
7a1e5026c4 Translated using Weblate (Belarusian)
Currently translated at 75.3% (452 of 600 strings)
2020-09-29 06:58:35 +02:00
Allan Nordhøy
323161c6de Translated using Weblate (Norwegian Bokmål)
Currently translated at 93.8% (563 of 600 strings)
2020-09-29 06:58:34 +02:00
Ville Rantanen
1ac4890893 Translated using Weblate (Finnish)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:34 +02:00
Isak Holmström
e9c88fecc5 Translated using Weblate (Swedish)
Currently translated at 94.5% (567 of 600 strings)
2020-09-29 06:58:32 +02:00
Yaron Shahrabani
33deaaefac Translated using Weblate (Hebrew)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:32 +02:00
Jeff Huang
bb6438ebe4 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:32 +02:00
chr56
d42af74afa Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:31 +02:00
Eric
ea1f2f4ad4 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:31 +02:00
Samuel Carvalho de Araújo
95b45651bb Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:30 +02:00
WaldiS
0d5730d33e Translated using Weblate (Polish)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:30 +02:00
Emin Tufan Çetin
0625a35ddf Translated using Weblate (Turkish)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:30 +02:00
Rex_sa
2d3271ee13 Translated using Weblate (Arabic)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:29 +02:00
Krysa Czech
6da2e80027 Translated using Weblate (Czech)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:28 +02:00
Marian Hanzel
439edbf85c Translated using Weblate (Slovak)
Currently translated at 98.5% (591 of 600 strings)
2020-09-29 06:58:26 +02:00
THANOS SIOURDAKIS
e0237a0b86 Translated using Weblate (Greek)
Currently translated at 93.5% (561 of 600 strings)
2020-09-29 06:58:24 +02:00
ssantos
e1845ba603 Translated using Weblate (Portuguese)
Currently translated at 94.8% (569 of 600 strings)
2020-09-29 06:58:22 +02:00
pjammo
1cf757d401 Translated using Weblate (Italian)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:20 +02:00
AioiLight
14985b1727 Translated using Weblate (Japanese)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:20 +02:00
Nikita Epifanov
6b2788be57 Translated using Weblate (Russian)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:19 +02:00
Ben De Meester
ac888f4cb2 Translated using Weblate (Dutch)
Currently translated at 99.5% (597 of 600 strings)
2020-09-29 06:58:18 +02:00
Bopol
df06cfc4c5 Translated using Weblate (French)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:17 +02:00
Laura Arjona Reina
dcba3a681c Translated using Weblate (Spanish)
Currently translated at 99.8% (599 of 600 strings)
2020-09-29 06:58:16 +02:00
Bruno Tendler
7fd49c22a8 Translated using Weblate (Spanish)
Currently translated at 99.8% (599 of 600 strings)
2020-09-29 06:58:16 +02:00
TobiGr
314287a6d9 Translated using Weblate (German)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:15 +02:00
BurningKarl
f5e7b8f229 Translated using Weblate (German)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:15 +02:00
C. Rüdinger
de84db070e Translated using Weblate (German)
Currently translated at 100.0% (600 of 600 strings)
2020-09-29 06:58:15 +02:00
Avently
c1d5a5cd98 Player will be rebound when needed, prev/next/queue buttons, preserving paused state
- each time something starts to play in any player VideoDetailFragment will be started (if not yet started) and mini player will show up. It makes possible to see a playing stream in mini player even if the stream was started without using fragment or after player service was closed somehow
- play/next/queue buttons will be updated in realtime when stream was added/removed from queue instead of waiting for a onPlay/onPause action to happen
- when popup or background players start the stream will start playing only if paused state wasn't requested. Which means, for example, if a user opens popup it will be started when START_PAUSED is false. If, for example, the stream was played in main player and then popup was started the stream will still be playing, but if it was paused it still be paused in popup (or background) in APPEND_ONLY mode (but will be playing on new queue initialization)
2020-09-29 06:22:53 +03:00
opusforlife2
160a04c3c7 Merge pull request #4288 from avently/performance-increase
Performance increase
2020-09-28 17:45:25 +00:00
Oymate
23bfc30c57 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 62.5% (375 of 600 strings)
2020-09-28 10:13:01 +02:00
Oymate
d9329bffd1 Added translation using Weblate (Bengali) 2020-09-28 10:10:43 +02:00
Oğuz Ersen
bafc1df988 Translated using Weblate (Turkish)
Currently translated at 100.0% (600 of 600 strings)
2020-09-27 23:28:04 +02:00
David Braz
30b8835919 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (600 of 600 strings)
2020-09-27 19:08:02 +02:00
RachelB
44b19e75f6 Translated using Weblate (Spanish)
Currently translated at 95.1% (571 of 600 strings)
2020-09-27 18:55:56 +02:00
Laura Arjona Reina
2a558ad11d Translated using Weblate (Spanish)
Currently translated at 95.1% (571 of 600 strings)
2020-09-27 18:55:56 +02:00
Hosted Weblate
123d8972e1 Merge branch 'origin/dev' into Weblate. 2020-09-27 17:19:59 +02:00
Ajeje Brazorf
e550a8ea27 Translated using Weblate (Sardinian)
Currently translated at 99.5% (597 of 600 strings)
2020-09-27 17:19:44 +02:00
Kurd As
8b29460fed Translated using Weblate (Central Kurdish)
Currently translated at 99.6% (598 of 600 strings)
2020-09-27 17:19:44 +02:00
Allan Nordhøy
e380d63c57 Translated using Weblate (Norwegian Bokmål)
Currently translated at 90.5% (543 of 600 strings)
2020-09-27 17:19:43 +02:00
Yaron Shahrabani
89b4f2c4d4 Translated using Weblate (Hebrew)
Currently translated at 100.0% (600 of 600 strings)
2020-09-27 17:19:42 +02:00
Oğuz Ersen
6c2f63f738 Translated using Weblate (Turkish)
Currently translated at 100.0% (600 of 600 strings)
2020-09-27 17:19:41 +02:00
zmni
77c612f0f5 Translated using Weblate (Indonesian)
Currently translated at 100.0% (600 of 600 strings)
2020-09-27 17:19:41 +02:00
THANOS SIOURDAKIS
2d06c01192 Translated using Weblate (Greek)
Currently translated at 85.3% (512 of 600 strings)
2020-09-27 17:19:40 +02:00
AioiLight
d13c19f05f Translated using Weblate (Japanese)
Currently translated at 100.0% (600 of 600 strings)
2020-09-27 17:19:40 +02:00
Bopol
3d2ba05c77 Translated using Weblate (French)
Currently translated at 100.0% (600 of 600 strings)
2020-09-27 17:19:39 +02:00
Florian
6898b9d9a4 Translated using Weblate (French)
Currently translated at 100.0% (600 of 600 strings)
2020-09-27 17:19:39 +02:00
TobiGr
a65aaa6b83 Translated using Weblate (German)
Currently translated at 99.1% (595 of 600 strings)
2020-09-27 17:19:39 +02:00
nautilusx
b3136c20c4 Translated using Weblate (German)
Currently translated at 99.1% (595 of 600 strings)
2020-09-27 17:19:38 +02:00
Tobias Groza
0ae3dfd9cc Merge pull request #4315 from comradekingu/patch-12
String improvements
2020-09-27 17:12:20 +02:00
Avently
0370fa6c00 Merged 'dev' branch 2020-09-27 18:02:31 +03:00
Allan Nordhøy
7ab323b00c Spelling: Back to browser 2020-09-27 14:53:24 +00:00
Tobias Groza
541eb70b9c Merge pull request #4272 from avently/small-fixes2
Small fixes of issues with old devices support, brightness, etc
2020-09-27 15:31:02 +02:00
Avently
e53e5ca20e Disabled nested scrolling of queue 2020-09-27 15:50:21 +03:00
Avently
609bf64856 Merged 'dev' branch 2020-09-27 15:04:20 +03:00
bopol
a9fafe91a5 Merge pull request #4326 from Stypox/appid-numbers
Allow numbers and uppercase letters in app package id
2020-09-27 12:00:55 +02:00
Hosted Weblate
0466b320dd Merge branch 'origin/dev' into Weblate. 2020-09-27 11:24:38 +02:00
MohammedSR Vevo
5b74d22d0a Translated using Weblate (Kurdish)
Currently translated at 97.9% (578 of 590 strings)
2020-09-27 11:24:29 +02:00
THANOS SIOURDAKIS
4152c7f956 Translated using Weblate (Greek)
Currently translated at 86.6% (511 of 590 strings)
2020-09-27 11:24:29 +02:00
Tobias Groza
d5f603303d Merge pull request #4259 from TeamNewPipe/pref_migration
Add settings migration, remove "Detail page" option from share dialog and minimize to background by default
2020-09-27 11:20:39 +02:00
Tobias Groza
fc9c073a60 Merge pull request #3178 from cool-student/notificationImprovements
Notification Improvements
2020-09-27 10:43:11 +02:00
Avently
9a0c2c40bd Refactoring and made the player returning from landscape & fullscreen on vertical video to portrait after clicking on fullscreen button 2020-09-27 06:39:42 +03:00
Avently
d0fc9fda71 Fixed player's ZOOM mode for KitKat devices 2020-09-27 04:25:06 +03:00
Avently
df9823988e Changes for tablets and device's orientation behavior
- the app will not rotate the screen to portrait after video completes, it will just exit from fullscreen mode
- ability to rotate the orientation via fullscreen button from landscape to portrait when device has locked orientation in landscape
- ability to enter/exit to/from fullscreen on tablets with unlocked global orientation in portrait mode
2020-09-27 04:11:38 +03:00
Ajeje Brazorf
eeb09c074c Translated using Weblate (Sardinian)
Currently translated at 100.0% (590 of 590 strings)
2020-09-26 22:42:32 +02:00
Allan Nordhøy
af0928e2bd Translated using Weblate (Norwegian Bokmål)
Currently translated at 87.9% (519 of 590 strings)
2020-09-26 22:42:31 +02:00
WaldiS
d9cf4de3f7 Translated using Weblate (Polish)
Currently translated at 100.0% (590 of 590 strings)
2020-09-26 22:42:31 +02:00
zeritti
2d6dd4b3be Translated using Weblate (Czech)
Currently translated at 100.0% (590 of 590 strings)
2020-09-26 22:42:30 +02:00
pjammo
160312393a Translated using Weblate (Italian)
Currently translated at 100.0% (590 of 590 strings)
2020-09-26 22:42:30 +02:00
AioiLight
e3ff9f9c86 Translated using Weblate (Japanese)
Currently translated at 100.0% (590 of 590 strings)
2020-09-26 22:42:30 +02:00
Nikita Epifanov
95570d796d Translated using Weblate (Russian)
Currently translated at 100.0% (590 of 590 strings)
2020-09-26 22:42:29 +02:00
Bopol
cd0d58a915 Translated using Weblate (French)
Currently translated at 100.0% (590 of 590 strings)
2020-09-26 22:42:29 +02:00
TobiGr
2f1007c725 Translated using Weblate (German)
Currently translated at 98.9% (584 of 590 strings)
2020-09-26 22:42:28 +02:00
Stypox
b53d5d8c00 Allow numbers and uppercase letters in app package id 2020-09-26 22:32:11 +02:00
TobiGr
3c4a4e5384 Set default value for "minimize_on_exit" to background for better UX. 2020-09-26 21:58:38 +02:00
TobiGr
0e5f85db95 Remove "Detail Page" open action from share dialog under certain circumstances
With the new application workflow and unified player, video detail page and video player are the same activity. So show only one of these options based on whether autoplay is enabled or not, and show both if using external player
2020-09-26 21:58:34 +02:00
TobiGr
ad3364671d Add migration concept for shared preferences 2020-09-26 21:43:58 +02:00
Avently
3add24b8aa Merged 'dev' branch 2020-09-26 02:42:26 +03:00
Tobias Groza
e0f02d4080 Merge pull request #4246 from avently/preloading
Disabled preloading when switching streams
2020-09-25 21:22:31 +02:00
Allan Nordhøy
00c4c10472 String improvements 2020-09-25 08:06:18 +00:00
Yaron Shahrabani
a2b8cc9dc2 Translated using Weblate (Hebrew)
Currently translated at 100.0% (590 of 590 strings)
2020-09-25 09:14:16 +02:00
Jeff Huang
3465002cbb Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (590 of 590 strings)
2020-09-25 09:14:15 +02:00
Eric
631cb73305 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (590 of 590 strings)
2020-09-25 09:14:15 +02:00
Samuel Carvalho de Araújo
b3b6384bef Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (590 of 590 strings)
2020-09-25 09:14:15 +02:00
Oğuz Ersen
941ca575fb Translated using Weblate (Turkish)
Currently translated at 100.0% (590 of 590 strings)
2020-09-25 09:14:14 +02:00
zmni
2d65c3595d Translated using Weblate (Indonesian)
Currently translated at 100.0% (590 of 590 strings)
2020-09-25 09:14:14 +02:00
Bopol
b3812d913a Translated using Weblate (French)
Currently translated at 100.0% (590 of 590 strings)
2020-09-25 09:14:13 +02:00
Tobias Groza
adcc420c81 Merge pull request #4310 from B0pol/duplicate
Translations improvements
2020-09-24 20:24:00 +02:00
bopol
b97ad99bb4 lint translations 2020-09-24 18:27:24 +02:00
bopol
e93a2850d6 Translations improvements :
- remove duplicated string (name) and avoid potential duplicate (autoplay_never_description -> Never, autoplay_always_description -> Always because they are just "Always" or "Never"). Fixes #4268
- leakCanary string removed (fixes #4233)
2020-09-24 15:24:59 +02:00
TobiGr
411d0691fa Merge remote-tracking branch 'Weblate/dev' into dev 2020-09-24 15:13:04 +02:00
Avently
c843e77183 Made notification thumbnail smaller 2020-09-23 15:20:25 +03:00
Kornelijus Tvarijanavičius
093d6e5336 Translated using Weblate (Lithuanian)
Currently translated at 44.6% (261 of 584 strings)
2020-09-23 01:40:55 +02:00
bopol
8a3c752d42 Merge pull request #4275 from B0pol/quality
change default quality
2020-09-22 20:53:30 +02:00
Stypox
b4e073cde7 Show replay icon in notification when player state is completed 2020-09-22 18:17:16 +02:00
Stypox
814efbf8df Remove ACTION_BUFFERING, update buffering only if needed
- ACTION_BUFFERING was just wrong: why should the user be able to trigger the internal onBuffering() state by pressing on the buffering button? So that was replaced by a null intent, doing nothing.
- Now updating notification in onBuffering() only when buffering actions are not already buffering, to prevent useless updates
2020-09-22 18:17:16 +02:00
Stypox
11e048abb1 Remove hardcoded and duplicate strings, use exoplayer ones 2020-09-22 18:17:09 +02:00
wrghig
34e7855af6 Translated using Weblate (Hungarian)
Currently translated at 73.1% (427 of 584 strings)
2020-09-21 06:28:23 +02:00
Parsa Akhbar
de54dc27ad Translated using Weblate (Persian)
Currently translated at 96.5% (564 of 584 strings)
2020-09-20 11:39:52 +02:00
Mostafa Ahangarha
790133978d Translated using Weblate (Persian)
Currently translated at 96.5% (564 of 584 strings)
2020-09-20 11:39:52 +02:00
zeritti
b914d67d9d Translated using Weblate (Czech)
Currently translated at 100.0% (584 of 584 strings)
2020-09-20 11:39:51 +02:00
Avently
518eb97e3a Variable width for caption button and hiding system UI after popup close 2020-09-19 22:52:59 +03:00
Avently
f41549ccf1 Added a comment and excluded automatic switch of orientation on tablets and Android TVs 2020-09-19 17:21:01 +03:00
Tobias Groza
b69e477ecd Merge pull request #4029 from Stypox/search-suggestions
Improve search suggestion experience when remote ones can't be fetched
2020-09-19 16:01:30 +02:00
Stypox
0062ff9cfa Fix deprecations, warnings and useless null checks in SearchFragment 2020-09-19 15:25:04 +02:00
Stypox
f8de72f59f Improve search suggestion experience when remote ones can't be fetched
Do not show anything in case of network error (it can simply be ignored).
Show a snackbar otherwise, which still allows writing things into the search box.
2020-09-19 15:22:54 +02:00
Stypox
7317737e90 Fix invisible queue close button 2020-09-19 13:44:07 +02:00
Avently
5b8eda4805 Increased performance of the UI. main thread is not as busy as before 2020-09-17 23:42:35 +03:00
Avently
886a949a00 Enable/disable video after screen on/off regardless of background playback setting 2020-09-17 22:30:03 +03:00
Avently
92e13dafe5 Correct exit from fullscreen in case of error or close from notification, 2020-09-17 19:01:20 +03:00
Avently
c9be812330 Fix for untouchable area 2020-09-16 23:41:49 +03:00
Stypox
59e7ebabfa Random adjustements to notification 2020-09-16 14:00:22 +02:00
thami simo
1afc48fce3 Translated using Weblate (Arabic)
Currently translated at 100.0% (584 of 584 strings)
2020-09-16 10:36:11 +02:00
Avently
a1e4ef9e8e Fix for multiple listeners of insets 2020-09-16 04:49:26 +03:00
Avently
5ada0ae2c7 Hiding controls when orientation changes to landscape 2020-09-15 22:10:38 +03:00
Avently
a5312c1341 Perfect shadow 2020-09-15 19:50:46 +03:00
Avently
150e156d26 Reimagined player positioning 2020-09-15 14:43:43 +03:00
Avently
6d38615ea8 Android 11: transparent navigation and status bars 2020-09-14 11:30:41 +03:00
Avently
011cc7d337 Android 11 initial support 2020-09-14 02:46:00 +03:00
bopol
b747d09836 change default quality 2020-09-13 14:01:01 +02:00
bopol
4b7311bafd Merge pull request #3826 from Stypox/unsupported-url-dialog
Show dialog with open options in case of an unsupported url
2020-09-12 23:54:51 +02:00
bopol
eeba9c0a5f Merge remote-tracking branch 'upstream/dev' into unsupported-url-dialog 2020-09-12 23:19:18 +02:00
Stypox
11d9a037f7 Merge pull request #4252 from opusforlife2/autoplay_to_autoqueue2
Change Autoplay to Autoqueue to reduce ambiguity
2020-09-11 22:11:13 +02:00
Avently
883e4fcd7c Small fixes of issues with old devices support, brightness, etc 2020-09-11 20:52:38 +03:00
Stypox
2017e6a3e3 Refactor MediaSessionManager 2020-09-10 20:36:52 +02:00
Stypox
bccfe500b3 Fix seekbar invisible or not updating
Have the notification recreate only when strictly necessary, and recreate it if there was a timeline change, fixing the seekbar not updating at all sometimes
2020-09-10 20:22:22 +02:00
Stypox
5846fbabce Change "image" to "thumbnail" 2020-09-10 19:47:07 +02:00
Stypox
52e89c1d1c Prevent seeking out of video duration in player 2020-09-10 19:47:02 +02:00
Stypox
1605e50cef Update notification when play queue is edited 2020-09-10 13:36:34 +02:00
Stypox
2215ce58a4 Merge pull request #3794 from budde25/download-same-file-crash
Fixes crash when a file is deleted then redownloaded
2020-09-09 15:41:06 +02:00
Stypox
a13e6b69e3 Merge branch 'dev' into pr3178 2020-09-08 23:58:10 +02:00
Stjepan
1d6370e11c Translated using Weblate (Croatian)
Currently translated at 86.9% (508 of 584 strings)
2020-09-08 23:19:45 +02:00
Stypox
bd34c7ede3 Make player foreground playback-specific in manifest 2020-09-08 22:00:28 +02:00
Stypox
bc8954fbba Fix notification content intent not being updated when needed 2020-09-08 22:00:28 +02:00
Stypox
9cf0bc6c82 Make notification creation and cancelling more consistent 2020-09-08 22:00:28 +02:00
Stypox
71b32fe641 Add notification costumization settings menu 2020-09-08 22:00:24 +02:00
Stypox
530f745e44 Merge pull request #4154 from avently/video-placement
Prevent jumping of the player and wrong padding on devices with cutout
2020-09-08 19:47:09 +02:00
opusforlife2
a5a2313851 Use new string for auto-queue toggle 2020-09-08 10:44:58 +00:00
opusforlife2
4e98c2e7f6 Add string for auto queue toggle 2020-09-08 10:43:11 +00:00
Stypox
14486782dc Merge pull request #3909 from TacoTheDank/deprecations-and-cleanup
Deprecations and cleanup
2020-09-07 20:51:24 +02:00
Avently
31814b70da Disabled preloading when switching streams 2020-09-07 19:34:10 +03:00
Stypox
408e819d32 Extract duplicate setActivityTitle code to own function 2020-09-07 15:28:38 +02:00
Antony
622676f9bc Translated using Weblate (Greek)
Currently translated at 85.2% (498 of 584 strings)
2020-09-07 11:36:12 +02:00
Stypox
5b631e0387 Revert to deprecated BEHAVIOR_SET_USER_VISIBLE_HINT in TabAdapter
Also added comment explaining why
2020-09-06 14:02:25 +02:00
TacoTheDank
06d54ef77e Clean up SDK version checks 2020-09-06 12:55:30 +02:00
TacoTheDank
6c5ef567ed Replace deprecated Html#fromHtml with HtmlCompat#fromHtml 2020-09-06 12:55:30 +02:00
TacoTheDank
f86b40302d Some general-purpose lint cleanup 2020-09-06 12:55:26 +02:00
TacoTheDank
273c287fbf Fix some lambdas 2020-09-06 12:52:43 +02:00
TacoTheDank
6cb16be5df Use enhanced 'for' loops 2020-09-06 12:52:43 +02:00
TacoTheDank
a4feb3fc09 Fix some deprecations 2020-09-06 12:52:43 +02:00
TacoTheDank
ba6c7de35a Use AndroidX preference 2020-09-06 12:52:42 +02:00
TacoTheDank
79e2bb382f Update ExoPlayer, OkHttp, use Kotlin JDK8 2020-09-06 12:48:35 +02:00
pitachips
0090256ded Translated using Weblate (Korean)
Currently translated at 87.3% (510 of 584 strings)
2020-09-05 22:36:11 +02:00
TobiGr
00ce077758 Translated using Weblate (Korean)
Currently translated at 87.3% (510 of 584 strings)
2020-09-05 22:36:11 +02:00
Stypox
a801d0994f Merge pull request #4223 from avently/small-fixes
Small fixes of issues with brightness, background playback, gestures
2020-09-05 20:51:37 +02:00
Stypox
628575dc5f Clean up MediaSessionManager 2020-09-04 18:44:09 +02:00
Avently
0a22f21410 Small fixes of issues with brightness, background playback, gestures 2020-09-04 05:39:55 +03:00
Stypox
97ff9e9c5b Merge branch 'dev' into pr3178 2020-09-03 21:56:48 +02:00
Stypox
8b3a09306b Various notification code improvements
Improve builder parameters
Reorder code and extract large icon function
service.startForeground() now is also provided with service type in android versions >= Q
2020-09-03 21:54:31 +02:00
Stypox
7766fd13fd Extract hardcoded strings into strings.xml and improve them 2020-09-03 21:54:31 +02:00
Stypox
c79997ebe3 Show hourglass icon when buffering 2020-09-03 21:54:28 +02:00
Tobias Groza
0fd1e2fcd9 Merge pull request #4038 from vmazoyer/remember_dl_pref
Remember last selected media type for downloads.
2020-09-03 20:11:36 +02:00
vmazoyer
99442b6e04 Remember last selected media type for downloads. 2020-09-03 19:47:34 +02:00
Avently
b8a35e9e4a Moved device-specific code into DeviceUtils 2020-09-03 15:48:17 +03:00
Avently
e833d415e3 Fixed wrong padding on devices with cutout on vertical videos 2020-09-03 15:48:17 +03:00
Avently
8030312924 Prevent jumping of the player on devices with cutout 2020-09-03 15:48:17 +03:00
Stypox
a84b54f940 Merge pull request #4127 from nmurali94/bugfix-keep-license-on-rotate
Restore license pop-up when orientation changes
2020-09-02 16:28:43 +02:00
TobiGr
c66c81294e Remove unused and redundant code. 2020-09-01 17:39:06 +02:00
Tobias Groza
bfdc215c65 Merge pull request #4155 from avently/gestures-interception
Skipping interception of some gestures
2020-09-01 16:51:34 +02:00
Kahina Messaoudi
e10c7beedb Translated using Weblate (Kabyle)
Currently translated at 31.8% (186 of 584 strings)
2020-08-29 00:15:27 +02:00
zeritti
18c3286364 Translated using Weblate (Czech)
Currently translated at 100.0% (584 of 584 strings)
2020-08-29 00:15:27 +02:00
Tobias Groza
8d2ec30818 Merge pull request #4120 from mhmdanas/replace-SubtitlesStream-getURL-with-getUrl
Use SubtitlesStream#getUrl instead of getURL
2020-08-26 22:15:44 +02:00
mhmdanas
e5ffddfc6b Use SubtitlesStream#getUrl instead of getURL 2020-08-26 23:04:18 +03:00
Hakim Oubouali
59fc1e4b5f Translated using Weblate (Berber)
Currently translated at 24.3% (142 of 584 strings)
2020-08-26 18:13:49 +02:00
ssantos
7ead581953 Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (584 of 584 strings)
2020-08-22 10:36:37 +02:00
Ivo Andonov
b860980df4 Translated using Weblate (Bulgarian)
Currently translated at 65.2% (381 of 584 strings)
2020-08-22 10:36:37 +02:00
Kim Nyberg
97a366d62e Translated using Weblate (Swedish)
Currently translated at 99.3% (580 of 584 strings)
2020-08-22 10:36:36 +02:00
ssantos
9ad68097d0 Translated using Weblate (Portuguese)
Currently translated at 100.0% (584 of 584 strings)
2020-08-22 10:36:36 +02:00
wb9688
331999fb95 Merge pull request #4158 from TobiGr/code-improvements
Remove duplicate code
2020-08-21 16:41:11 +02:00
Luna Jernberg
6519d7051d Translated using Weblate (Swedish)
Currently translated at 99.1% (579 of 584 strings)
2020-08-19 14:33:14 +02:00
TobiGr
552d585fca Extract common part from if 2020-08-18 13:28:13 +02:00
Avently
24c24d6c72 Skipping interception of some gestures 2020-08-17 20:42:05 +03:00
wb9688
b7f50c3e12 Merge pull request #4080 from avently/cpu-usage-improvement
Reduced CPU usage when playing a video by 7-10%
2020-08-17 09:46:07 +02:00
Avently
aed1687a45 Improved an animation logic 2020-08-16 22:44:27 +03:00
nmurali94
daa427dc15 Restore license pop up after orientation change 2020-08-16 12:23:40 +02:00
Tobias Groza
e9d4303fdb Merge pull request #4134 from avently/bottom-space
Set bottom padding of the main fragment when the mini player is visible
2020-08-16 12:15:08 +02:00
Tobias Groza
5485e994ee Merge pull request #4138 from XiangRongLin/checkstyle_final
Add checkstyle rule to show final local variable violations as warning
2020-08-16 11:55:46 +02:00
wb9688
87228673b4 Use final where possible 2020-08-16 10:25:09 +02:00
Xiang Rong Lin
d306513319 Add checkstyle rule to show final local variable violations as warning 2020-08-16 10:25:09 +02:00
Stypox
e08480f345 Completely remove old player notification 2020-08-15 22:03:32 +02:00
Tobias Groza
13c9096417 Merge pull request #4130 from Stypox/swipe-queueitem-fix
[regression] Close player in onPlaybackShutdown()
2020-08-15 20:25:54 +02:00
Avently
d3d65c8e3a Set bottom padding of the main fragment when the mini player is visible 2020-08-15 20:51:52 +03:00
Stypox
12ac5ef781 [regression] Close player in onPlaybackShutdown() 2020-08-15 15:58:25 +02:00
Stypox
adef9a8acf Rename notification functions: they are not background player only 2020-08-15 15:16:17 +02:00
Tobias Groza
5ef407d15f Merge pull request #4126 from gkeegan/contributor-discussions
Add need for contributors to discuss possible changes
2020-08-15 11:44:52 +02:00
Hakim Oubouali
970b636eb4 Translated using Weblate (Berber)
Currently translated at 17.9% (105 of 584 strings)
2020-08-15 00:56:30 +02:00
ssantos
fcf9131aae Translated using Weblate (Portuguese (Portugal))
Currently translated at 100.0% (584 of 584 strings)
2020-08-15 00:56:28 +02:00
sivemortenfan
7fd27fac45 Translated using Weblate (Malayalam)
Currently translated at 100.0% (584 of 584 strings)
2020-08-15 00:56:19 +02:00
Juraj Liso
6e17af91fb Translated using Weblate (Czech)
Currently translated at 98.4% (575 of 584 strings)
2020-08-15 00:56:18 +02:00
Juraj Liso
68555573ad Translated using Weblate (Slovak)
Currently translated at 97.9% (572 of 584 strings)
2020-08-15 00:56:18 +02:00
Keegan
fb9905a89e Add need for contributors to discuss possible changes
This was discussed in IRC, and should help prevent the occurrence of problems where people spend hours on a feature only for it to be rejected for miscellaneous reasons.
2020-08-14 11:27:06 -05:00
Hakim Oubouali
1e7504dc5a Added translation using Weblate (Berber) 2020-08-14 10:14:05 +02:00
Tobias Groza
d7af019511 Merge pull request #4115 from nmurali94/bugfix-remove-timestamp-from-livestream
Remove timestamp from url when sharing a live stream
2020-08-12 17:57:18 +02:00
nmurali94
04bb070afa Remove timestamp when sharing a live stream 2020-08-12 09:54:35 -04:00
Sérgio Marques
e693d80857 Added translation using Weblate (Portuguese (Portugal)) 2020-08-12 01:30:16 +02:00
Allan Nordhøy
45ae05f1b5 Translated using Weblate (Norwegian Bokmål)
Currently translated at 88.3% (516 of 584 strings)
2020-08-11 13:32:55 +02:00
Allan Nordhøy
05a83beb44 Translated using Weblate (Norwegian Bokmål)
Currently translated at 88.1% (515 of 584 strings)
2020-08-10 10:32:51 +02:00
Tobias Groza
8a1a42e83b Merge pull request #3948 from TobiGr/basic_resize
Add basic resize functionality
2020-08-08 21:34:12 +02:00
BenjaminForster
1b3f3cedb3 Translated using Weblate (Afrikaans)
Currently translated at 4.6% (27 of 584 strings)
2020-08-07 14:32:58 +02:00
TobiGr
f815ae5973 Translated using Weblate (Filipino)
Currently translated at 11.1% (65 of 584 strings)
2020-08-07 14:32:58 +02:00
David Rebolo Magariños
fb7035bf22 Translated using Weblate (Galician)
Currently translated at 100.0% (584 of 584 strings)
2020-08-07 14:32:57 +02:00
Deleted User
02bcbc3221 Translated using Weblate (Malay)
Currently translated at 72.0% (421 of 584 strings)
2020-08-07 14:32:54 +02:00
TobiGr
f0a51d4ab4 Translated using Weblate (Belarusian)
Currently translated at 77.7% (454 of 584 strings)
2020-08-07 14:32:53 +02:00
TobiGr
24fe8fe9a0 Translated using Weblate (Azerbaijani)
Currently translated at 10.2% (60 of 584 strings)
2020-08-07 14:32:53 +02:00
TobiGr
244e95d959 Translated using Weblate (Telugu)
Currently translated at 23.9% (140 of 584 strings)
2020-08-07 14:32:53 +02:00
Kim Nyberg
ad72c64e32 Translated using Weblate (Swedish)
Currently translated at 98.6% (576 of 584 strings)
2020-08-07 14:32:53 +02:00
Yaron Shahrabani
767ac6a51b Translated using Weblate (Hebrew)
Currently translated at 100.0% (584 of 584 strings)
2020-08-07 14:32:52 +02:00
TobiGr
3a6f87659a Translated using Weblate (Armenian)
Currently translated at 13.0% (76 of 584 strings)
2020-08-07 14:32:52 +02:00
Samuel Carvalho de Araújo
b7ac16c7d9 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (584 of 584 strings)
2020-08-07 14:32:52 +02:00
Emin Tufan Çetin
f9f84cbd89 Translated using Weblate (Turkish)
Currently translated at 100.0% (584 of 584 strings)
2020-08-07 14:32:52 +02:00
TobiGr
701c87eefa Translated using Weblate (Ukrainian)
Currently translated at 98.9% (578 of 584 strings)
2020-08-07 14:32:52 +02:00
karnak2016
5379cf0544 Translated using Weblate (Ukrainian)
Currently translated at 98.9% (578 of 584 strings)
2020-08-07 14:32:51 +02:00
TobiGr
6b5c37f17f Translated using Weblate (Greek)
Currently translated at 83.2% (486 of 584 strings)
2020-08-07 14:32:51 +02:00
Terry Louwers
50b2fad180 Translated using Weblate (Dutch)
Currently translated at 100.0% (584 of 584 strings)
2020-08-07 14:32:51 +02:00
ButterflyOfFire
b9cb65b24e Translated using Weblate (Kabyle)
Currently translated at 31.5% (184 of 584 strings)
2020-08-06 15:51:51 +02:00
Avently
d7574973e9 Reduced CPU usage when playing a video by 7-10% 2020-08-05 12:46:25 +03:00
Tobias Groza
ff48c93d59 Merge pull request #4050 from TeamNewPipe/popup-setting-text
Reduce redundancy in "Remeber popup size and position" setting
2020-08-04 23:23:03 +02:00
Tobias Groza
d2e6700dd1 Merge pull request #4066 from BoFFire/dev
Fixing name for Taqbaylit language
2020-08-03 19:17:11 +02:00
Selyan Sliman Amiri
05b8c3f35f Translated using Weblate (Kabyle)
Currently translated at 31.1% (182 of 584 strings)
2020-08-03 19:16:19 +02:00
ButterflyOfFire
70b643e7ba Fixing name for Taqbaylit language
Fixing name for Taqbaylit language
2020-08-03 19:01:51 +02:00
TobiGr
dce973a519 Add basic resize functionality
Addresses #3947
See 9e352df1ed
See https://developer.samsung.com/samsung-dex/modify-optimizing.html#Enabling-Multi-Window-support
2020-08-03 18:40:32 +02:00
Tobias Groza
eb2f75579a Merge pull request #3892 from wb9688/fix-local-playlist-tab
Fix crash when opening video in local playlist tab
2020-08-03 15:49:06 +02:00
Tobias Groza
773316ce4f Merge pull request #4061 from avently/unsupported_api
Removed java.util.Objects calls
2020-08-03 15:32:56 +02:00
wb9688
5fd7ae33b4 Replace getFragmentManager() with getFM() 2020-08-03 14:47:10 +02:00
wb9688
13a065f2dc Fix crash when opening video in local playlist tab 2020-08-03 14:47:10 +02:00
wb9688
1a8ff81087 Use AppCompatImageButton to not crash on 4.4 2020-08-03 14:17:12 +02:00
Tobias Groza
65637fce40 Merge pull request #3944 from Stypox/playlist-layout
Improve playlist header layout: align with info items
2020-08-03 14:15:30 +02:00
ButterflyOfFire
b11fa7a28e Translated using Weblate (Kabyle)
Currently translated at 6.5% (38 of 584 strings)
2020-08-03 13:04:58 +02:00
Avently
45408caf33 Removed java.util.Objects calls 2020-08-03 03:33:51 +03:00
Stypox
963ee4dbab Merge branch 'dev' into pr3178 2020-08-02 22:59:43 +02:00
TobiGr
3b46d5a440 Translated using Weblate (Catalan)
Currently translated at 85.2% (498 of 584 strings)
2020-08-02 13:20:01 +02:00
Kim Nyberg
212fddd8e1 Translated using Weblate (Swedish)
Currently translated at 98.2% (574 of 584 strings)
2020-08-02 13:20:01 +02:00
ktln
433485470e Translated using Weblate (Armenian)
Currently translated at 12.8% (75 of 584 strings)
2020-08-02 13:20:00 +02:00
TobiGr
e160a1f794 Translated using Weblate (Armenian)
Currently translated at 12.8% (75 of 584 strings)
2020-08-02 13:20:00 +02:00
WaldiS
7911b7e637 Translated using Weblate (Polish)
Currently translated at 100.0% (584 of 584 strings)
2020-08-02 13:19:59 +02:00
Oğuz Ersen
7fc5a77e7e Translated using Weblate (Turkish)
Currently translated at 99.6% (582 of 584 strings)
2020-08-02 13:19:59 +02:00
TobiGr
f0fb55640e Translated using Weblate (Romanian)
Currently translated at 69.5% (406 of 584 strings)
2020-08-02 13:19:59 +02:00
TobiGr
d5685f2255 Translated using Weblate (Slovenian)
Currently translated at 55.9% (327 of 584 strings)
2020-08-02 13:19:58 +02:00
Igor Nedoboy
a732233db6 Translated using Weblate (Russian)
Currently translated at 100.0% (584 of 584 strings)
2020-08-02 13:19:55 +02:00
Laszlo Almasi
a5918c29ee Translated using Weblate (Hungarian)
Currently translated at 72.9% (426 of 584 strings)
2020-08-02 13:19:55 +02:00
TobiGr
3b719803bb Translated using Weblate (Hungarian)
Currently translated at 72.9% (426 of 584 strings)
2020-08-02 13:19:54 +02:00
TobiGr
d77463c9f1 Translated using Weblate (German)
Currently translated at 100.0% (584 of 584 strings)
2020-08-02 13:19:53 +02:00
TobiGr
2d8fd9bedf Translated using Weblate (Hungarian)
Currently translated at 62.3% (364 of 584 strings)
2020-08-02 12:07:46 +02:00
Laszlo Almasi
b17a667a9d Translated using Weblate (Hungarian)
Currently translated at 62.3% (364 of 584 strings)
2020-08-02 12:07:46 +02:00
Tobias Groza
b7287a070b Make title and summary of "Remeber popup size and position" setting less redundant 2020-08-02 11:07:48 +02:00
Tobias Groza
fbb5c8cdd6 Update bug_report.md 2020-08-02 09:37:52 +02:00
Artyom
baaf2815e4 Translated using Weblate (Russian)
Currently translated at 100.0% (584 of 584 strings)
2020-08-01 19:03:30 +02:00
Tobias Groza
d8b5549fd9 Merge pull request #2907 from avently/unifiedplayer
Expandable player with unified UI
2020-08-01 12:53:19 +02:00
wb9688
6de03f2bf0 Fix crash when playing stream in background with shuffle in notification 2020-07-31 09:25:32 +02:00
wb9688
caf7c55069 Log only in debug build 2020-07-31 09:10:28 +02:00
wb9688
7d499ffba1 Use vector drawables for close and replay 2020-07-31 09:10:28 +02:00
cool-student
4abf6b2f5c Notification Improvements
- add MediaStyle notifications for Background and Popup playback
- reduce excessive notification updating ( / recreating of Notification.Builder object) when playing background / popup media
- add new buffering state indicator (can be disabled)
- upscale close icon / downscale replay icon
- add notification slot settings
- move notification settings to appearance
- fix Metadata (song title, artist and album art) sometimes not being set correctly
- other misc notification fixes

Co-authored-by: wb9688 <wb9688@users.noreply.github.com>
2020-07-31 09:10:28 +02:00
Mateo Coltura
a842b06301 Translated using Weblate (Flemish)
Currently translated at 73.6% (430 of 584 strings)
2020-07-30 23:12:37 +02:00
Oymate
0bca4925d7 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 32.7% (191 of 584 strings)
2020-07-30 23:12:37 +02:00
Éfrit
ae3953cbec Translated using Weblate (French)
Currently translated at 100.0% (584 of 584 strings)
2020-07-30 23:12:36 +02:00
Raymundo
a99667c54c Translated using Weblate (Spanish)
Currently translated at 100.0% (584 of 584 strings)
2020-07-30 23:12:35 +02:00
Ajeje Brazorf
465963a8c2 Translated using Weblate (Sardinian)
Currently translated at 99.4% (581 of 584 strings)
2020-07-30 01:08:02 +02:00
Digiwizkid
b9b4762faf Translated using Weblate (Bengali (India))
Currently translated at 61.6% (360 of 584 strings)
2020-07-30 01:07:50 +02:00
MohammedSR Vevo
a56b128a4b Translated using Weblate (Kurdish)
Currently translated at 99.3% (580 of 584 strings)
2020-07-30 01:07:49 +02:00
sudoLife
d43cc089fd Translated using Weblate (Lithuanian)
Currently translated at 42.9% (251 of 584 strings)
2020-07-30 01:07:49 +02:00
Jeff Huang
771513d287 Translated using Weblate (Chinese (Traditional))
Currently translated at 99.8% (583 of 584 strings)
2020-07-30 01:07:48 +02:00
Samuel Carvalho de Araújo
c387678217 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.8% (583 of 584 strings)
2020-07-30 01:07:48 +02:00
thami simo
847368718b Translated using Weblate (Arabic)
Currently translated at 100.0% (584 of 584 strings)
2020-07-30 01:07:48 +02:00
pjammo
458b3daac3 Translated using Weblate (Italian)
Currently translated at 99.8% (583 of 584 strings)
2020-07-30 01:07:47 +02:00
AioiLight
3ea5278b12 Translated using Weblate (Japanese)
Currently translated at 99.8% (583 of 584 strings)
2020-07-30 01:07:47 +02:00
sudoLife
20b9748a8c Translated using Weblate (Russian)
Currently translated at 100.0% (584 of 584 strings)
2020-07-30 01:07:46 +02:00
Artyom
79487adbec Translated using Weblate (Russian)
Currently translated at 100.0% (584 of 584 strings)
2020-07-30 01:07:46 +02:00
sudoLife
89f3fca6b1 Translated using Weblate (English)
Currently translated at 99.8% (583 of 584 strings)
2020-07-30 01:07:46 +02:00
Tobias Groza
f290b2bf5a Merge pull request #3982 from Stypox/fix-acra
Fix ACRA bug reports not containing stack trace
2020-07-29 17:58:52 +02:00
Stypox
04e7d13043 Remove deprecated calls to set Sender class to ACRA
setReportSenderFactoryClasses() is deprecated, now extensions (ReportSenderFactory is an extension) should be registered using AutoService: https://github.com/ACRA/acra/wiki/Custom-Extensions#by-annotation
2020-07-29 10:56:33 +02:00
Avently
e41218c46b Disable starting player service via media button when there is nothing to play (no active play queue) 2020-07-28 21:36:06 +03:00
Avently
8562fbdbbe Merge branch 'dev' 2020-07-28 21:35:01 +03:00
Anxhelo Lushka
c841d7a32b Translated using Weblate (Albanian)
Currently translated at 100.0% (584 of 584 strings)
2020-07-28 17:20:25 +02:00
Ville Rantanen
8827ae4d2c Translated using Weblate (Finnish)
Currently translated at 100.0% (584 of 584 strings)
2020-07-28 17:20:24 +02:00
chr56
2e1029e157 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (584 of 584 strings)
2020-07-28 17:20:24 +02:00
Rafael Gonçalves
a7dc0c2d55 Translated using Weblate (Portuguese (Brazil))
Currently translated at 98.8% (577 of 584 strings)
2020-07-28 17:20:24 +02:00
WaldiS
7f1749d853 Translated using Weblate (Polish)
Currently translated at 100.0% (584 of 584 strings)
2020-07-28 17:20:23 +02:00
zmni
b4a34d58db Translated using Weblate (Indonesian)
Currently translated at 100.0% (584 of 584 strings)
2020-07-28 17:20:23 +02:00
ssantos
4a50fcab2c Translated using Weblate (Portuguese)
Currently translated at 100.0% (584 of 584 strings)
2020-07-28 17:20:23 +02:00
Bernd N
c9ef089199 Translated using Weblate (German)
Currently translated at 100.0% (584 of 584 strings)
2020-07-28 17:20:14 +02:00
TobiGr
94ecf9a081 Merge remote-tracking branch 'Weblate/dev' into dev 2020-07-28 13:46:36 +02:00
Stypox
67aaa9a655 Make local playlist layout consistent with remote one 2020-07-28 13:10:28 +02:00
Tobias Groza
823f5640f7 Merge pull request #3984 from TobiGr/search_color
Fix color of correct / suggested search term
2020-07-28 13:03:51 +02:00
TobiGr
45d1c63895 Fix color of correct / suggested search term
Fixes TeamNewPipe/NewPipe#3973
2020-07-28 11:41:23 +02:00
Tobias Groza
d3b6781bb8 Update bug report template
DO NOT REPORT THAT CRASH ANY MORE. WE ARE GETTING SPAMMED11!!!1
2020-07-28 10:56:06 +02:00
Stypox
21d1f69d6d Do not init ACRA if inside its own process
https://github.com/ACRA/acra/wiki/Troubleshooting-Guide#applicationoncreate
2020-07-28 10:48:54 +02:00
Stypox
1b9f5989ef Fix empty stacktrace in bug report
ACRA has to be initialized after MultiDex
https://github.com/ACRA/acra/issues/619
https://github.com/ACRA/acra/wiki/Troubleshooting-Guide#legacy-multidex
2020-07-28 10:48:25 +02:00
Hosted Weblate
348e46ff3b Merge branch 'origin/dev' into Weblate. 2020-07-28 09:55:58 +02:00
TobiGr
7918e3a1aa Update version to 0.19.8 (953)
Update extractot version.
Fix extraction of YouTube's decryption function.
2020-07-28 01:07:13 +02:00
TobiGr
d6d8c7830c Merge branch 'dev' 2020-07-26 14:40:57 +02:00
TobiGr
f53a0f0d07 Update version to 0.19.7 (952) 2020-07-26 14:39:18 +02:00
TobiGr
17edd1c3d4 Add changelog 2020-07-26 14:38:49 +02:00
TobiGr
b0685c153a Update extractor version 2020-07-26 14:26:09 +02:00
Hosted Weblate
a5ca20ee4c Merge branch 'origin/dev' into Weblate. 2020-07-26 13:22:12 +02:00
Stypox
03685db2fc Improve playlist header layout: align with info items 2020-07-26 12:04:40 +02:00
Avently
68ed738dcd Renamed files 2020-07-25 09:45:33 +03:00
Avently
5293d17e32 Removed unused files, translations, styles, settings key 2020-07-25 09:39:42 +03:00
Avently
f2e4b69466 Another part of UI improvements for Android TV
- focus will be hidden right after start of a video; fullscreen works like this too
- back button will not needed to be pressed one more time like before
- prev & next buttons for playqueue will be hidden with play/pause button before video be ready to play
2020-07-25 07:00:53 +03:00
Avently
ec8b00042b Merged the latest code 2020-07-25 04:18:41 +03:00
Avently
08db1d59e5 Android TV: ability to select all buttons in the main player, as well as in the main fragment 2020-07-25 04:14:29 +03:00
Avently
7c79d421e8 Quality selector for external playback and better fullscreen mode for old devices 2020-07-24 00:43:09 +03:00
TobiGr
ade5e38fa5 Disable shrinkResources to fix F-Droid's reproducible build
For more information see https://f-droid.org/docs/Reproducible_Builds/#resource-shrinker
2020-07-23 21:19:47 +02:00
Tobias Groza
7385aa09a8 Merge pull request #3928 from wb9688/disable-shrink-resources
Disable shrinkResources
2020-07-23 18:02:44 +02:00
wb9688
185a5fad88 Disable shrinkResources 2020-07-23 13:24:48 +02:00
Hosted Weblate
a1e2477d14 Merge branch 'origin/dev' into Weblate. 2020-07-22 19:15:38 +02:00
Ajeje Brazorf
a1200a5fff Added translation using Weblate (Sardinian) 2020-07-22 19:15:35 +02:00
Avently
91a0257c8f Fixes for Android API <21 2020-07-22 17:19:32 +03:00
Tobias Groza
53ffc82fe2 Merge pull request #3920 from chdir/invisible_focus_fix
Fix lingering focus highlight overlay
2020-07-22 14:28:47 +02:00
Alexander--
801267df18 Add @NonNull annotation to method argument
Co-authored-by: Tobias Groza <TobiGr@users.noreply.github.com>
2020-07-22 07:57:04 -04:00
Alexander--
6e73e0b395 Use View.isShown() to avoid focus overlay glitches
A View can become focused while being invisible, if it's
parent is invisible. Use global draw listener and
View.isShown() to catch such cases.
2020-07-22 06:21:25 +06:59
Avently
7aa8a5c368 Fixed a situation when background playback could use a video stream instead of an audio stream 2020-07-22 02:20:58 +03:00
Avently
3ecbbea7cb Better TV support, icons, activity_main refactoring
- on Android TV you'll be able to navigate with D-pad in main fragment and in the player. But not between them for now
- play/pause/next/previous buttons are smaller now
- replaced ic_list with previous version of it
- activity_main looks better which helps with Android TV support
2020-07-22 01:20:30 +03:00
Avently
77cd3182f1 Removed unused line 2020-07-21 01:53:59 +03:00
Avently
c7ccf9bab8 AndroidTvUtils -> DeviceUtils 2020-07-21 01:43:49 +03:00
Avently
06e70abb86 Merged the latest changes 2020-07-21 01:37:36 +03:00
TobiGr
88c86e88b0 Update extractor version 2020-07-20 20:34:02 +02:00
Hosted Weblate
2d6cf48532 Merge branch 'origin/dev' into Weblate. 2020-07-18 15:48:16 +02:00
Tobias Groza
19e152a54b Merge pull request #3689 from wb9688/next-stream
Remove calls to getNextStream()
2020-07-18 11:59:04 +02:00
Tobias Groza
2898bead66 Merge pull request #3902 from wb9688/null-description
Check for description == null
2020-07-18 11:54:10 +02:00
Tobias Groza
381c329441 Merge pull request #3884 from wb9688/use-androidx-annotation
Use androidx.annotation.NonNull instead of io.reactivex.annotations.NonNull
2020-07-18 11:51:08 +02:00
Hosted Weblate
a3de3705f7 Merge branch 'origin/dev' into Weblate. 2020-07-18 10:16:37 +02:00
Mario Rossi
dc3dc6b77f Added translation using Weblate (Neapolitan) 2020-07-18 10:16:35 +02:00
wb9688
e028a63f30 Check for description == null 2020-07-18 10:01:44 +02:00
Avently
d196f8b4b2 New icons 2020-07-16 01:15:24 +03:00
wb9688
4274827dbe Use relatedItems instead of info.getRelatedStreams() 2020-07-15 18:52:36 +02:00
wb9688
7a30f4a7d2 Remove calls to getNextStream() 2020-07-14 21:27:59 +02:00
wb9688
d0c03a0211 Use androidx.annotation.NonNull instead of io.reactivex.annotations.NonNull 2020-07-14 21:15:29 +02:00
Avently
787b136d13 NonNull instead of NotNull annotations 2020-07-14 22:08:12 +03:00
Avently
08412d6108 Mini player slide to botom fix, buttons size fix 2020-07-14 21:52:55 +03:00
Avently
d8f7db4715 Made checkStyle happy 2020-07-14 20:21:32 +03:00
Avently
bff238774e Small fixes of issues 2020-07-13 23:28:39 +03:00
Avently
d2aaa6f691 Merged the latest changes 2020-07-13 04:17:21 +03:00
Tobias Groza
c900ef036c Merge pull request #3863 from TeamNewPipe/release_0.19.6
Release 0.19.6
2020-07-12 20:25:05 +02:00
Avently
b2164ce5fc Marked many (too many) variables as final 2020-07-12 03:59:47 +03:00
TobiGr
d088d432c5 Release NewPipe 0.19.6 (951) 2020-07-11 21:47:19 +02:00
TobiGr
c9fafbe198 Add changelog 2020-07-11 21:47:19 +02:00
TobiGr
2d909b0514 Remove untranslatable translations 2020-07-11 21:47:19 +02:00
TobiGr
c2a012553d Use %1$d instead of %1$s in deleted_downloads string
We don't pass a String, but an Integer
2020-07-11 21:47:19 +02:00
TobiGr
085f0266ac Fix Linter (translations) 2020-07-11 20:52:20 +02:00
Tobias Groza
7ede2daa3c Merge pull request #3861 from TeamNewPipe/languages
add the new languages translated in NewPipe
2020-07-08 22:45:16 +02:00
bopol
713c53d170 add bengali (india) and arabic (lybia) 2020-07-08 21:34:34 +02:00
TobiGr
110b3a6a8f Add some new languages to the language selector
ckb - Central Kurdish
jv - Javanese
kab - Kabyle
2020-07-07 22:32:14 +02:00
Tobias Groza
e12e6dd7a7 Merge pull request #3441 from wb9688/nextpage
Next page stuff
2020-07-07 21:19:27 +02:00
wb9688
e183fc6118 Bump NPE version 2020-07-07 21:04:08 +02:00
wb9688
dd57e246b8 Use getNextPage() instead of getNextPageUrl() 2020-07-07 21:03:24 +02:00
Tobias Groza
f4a4172369 Merge pull request #3471 from Royosef/DisplaySearchSuggestion
Display search suggestion: did you mean & showing result for
2020-07-07 20:57:02 +02:00
TobiGr
b96d1714b5 Highlight search suggestion 2020-07-07 20:23:41 +02:00
TobiGr
dbd809b040 Merge remote-tracking branch 'Weblate/dev' into dev 2020-07-07 18:41:55 +02:00
Tobias Groza
ff4e6b139d Merge pull request #3579 from TobiGr/error_md_export
Add Markdown export of crash logs
2020-07-07 00:01:12 +02:00
Tobias Groza
af098aaac8 Merge pull request #3843 from kapodamy/drop-writting-application-metadata
Drop writting application metadata in muxed files
2020-07-06 23:55:06 +02:00
Digiwizkid
5d7e62c736 Translated using Weblate (Bengali (India))
Currently translated at 61.0% (352 of 577 strings)
2020-07-06 12:56:56 +02:00
Prajwol Pradhan
e2ead011f5 Translated using Weblate (Nepali)
Currently translated at 99.8% (576 of 577 strings)
2020-07-06 12:56:54 +02:00
Allan Nordhøy
a067c950e1 Translated using Weblate (Norwegian Bokmål)
Currently translated at 89.0% (514 of 577 strings)
2020-07-06 12:56:54 +02:00
Yaron Shahrabani
3369618cfa Translated using Weblate (Hebrew)
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:54 +02:00
Jeff Huang
4e9b6520e5 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:53 +02:00
Eric
a074203fae Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:53 +02:00
Samuel Carvalho de Araújo
42092e3f28 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:53 +02:00
WaldiS
c07b34e298 Translated using Weblate (Polish)
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:53 +02:00
Emin Tufan Çetin
ef5f181328 Translated using Weblate (Turkish)
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:52 +02:00
ssantos
a7ea2fcf92 Translated using Weblate (Portuguese)
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:52 +02:00
AioiLight
e81730715c Translated using Weblate (Japanese)
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:52 +02:00
Lesya Novaselskaya
c09f2ad482 Translated using Weblate (Russian)
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:52 +02:00
B0pol
84aef8b5b5 Translated using Weblate (French)
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:51 +02:00
nautilusx
8fac3e8221 Translated using Weblate (German)
Currently translated at 100.0% (577 of 577 strings)
2020-07-06 12:56:51 +02:00
Prajwol Pradhan
5874ed781d Translated using Weblate (Nepali)
Currently translated at 99.8% (576 of 577 strings)
2020-07-06 12:56:49 +02:00
Ishwor Ghimire
d8f29bd7a7 Translated using Weblate (Nepali)
Currently translated at 99.8% (576 of 577 strings)
2020-07-06 12:56:48 +02:00
kapodamy
8120b6aaaa checkstyle's amend 2020-07-05 23:55:40 -03:00
Stypox
13a0d1de70 Replace search query without searching on suggestion panel long click 2020-07-05 22:01:35 +02:00
Stypox
20e828be51 Improve suggestion panel 2020-07-05 22:01:35 +02:00
wb9688
ccd82fb8b8 Improve search suggestion code 2020-07-05 22:01:35 +02:00
Roy Yosef
0711650ff8 Fix search suggestions not working on resume
* add searchSuggestionString, isCorrectedSearch fields to state and load onResume
2020-07-05 22:01:35 +02:00
Roy Yosef
4194ac2226 Display search suggestion: did you mean & showing result for 2020-07-05 22:01:35 +02:00
Stypox
248e2d7ee0 Merge pull request #3506 from Royosef/PlaylistTab
Add playlist tab to main page
2020-07-05 21:06:23 +02:00
Tobias Groza
1daa654051 Merge pull request #3845 from B0pol/peertube_instance
add privacytools.io peertube instance to manifest
2020-07-05 14:37:11 +02:00
bopol
d751434979 add privacytools.io peertube instance to manifest 2020-07-04 11:39:00 +02:00
Stypox
8cc21920b7 Move local/remote playlist merge() to PlaylistLocalItem class
In order not to have a utils class just for one function
2020-07-04 11:38:22 +02:00
Stypox
248212588d Fix style issues 2020-07-04 11:38:22 +02:00
Roy Yosef
13c0fdef08 Final declarations, naming & redundant code
* add final declarations where missing
* fix typo "onSelectedLisener" to "onSelectedListener"
* rename "baseEqual" to "baseEquals"
* replace getPlaylistsObserver code with functions pointers
* remove duplicate code in constructors
* remove useless null checks
2020-07-04 11:37:38 +02:00
Roy Yosef
dfc27b2480 Add playlist tab to main page
Add bookmarked playlist as tab in the main page (by Settings > Content > Content of main page)
2020-07-04 11:35:45 +02:00
kapodamy
b2d78d380b update WebMWriter.java 2020-07-03 20:51:45 -03:00
Tobias Groza
faa6cb5c7d Merge pull request #3841 from B0pol/update_inv_instances
update invidious instances
2020-07-03 15:38:10 +02:00
kapodamy
452977abdf Drop "writing/muxed by" metadata
* All muxers (mp4, webm and ogg) are affected
* solve some checkstyle's errors (building was blocked)

Mp4FromDashWriter:
* drop "writing application"
* drop "handler name"

OggFromWebMWriter:
* drop "writing application" for OPUS and VORBIS header

WebMWriter:
* Drop "Muxing application"
* Drop "Writing application"
2020-07-03 02:07:42 -03:00
Hosted Weblate
93570b2f59 Merge branch 'origin/dev' into Weblate. 2020-07-03 00:18:10 +02:00
Ville Rantanen
073f5c2c8c Translated using Weblate (Finnish)
Currently translated at 100.0% (576 of 576 strings)
2020-07-03 00:18:06 +02:00
bopol
1b4313f847 update extractor version 2020-07-02 23:17:38 +02:00
Tobias Groza
07cead7e99 Merge pull request #3404 from mauriciocolli/feed-add-filter-sub-list
Add filter to the feed group dialog to show only ungrouped subscriptions
2020-07-02 22:53:11 +02:00
bopol
f128751aba update invidious instances 2020-07-02 21:41:23 +02:00
Tobias Groza
9516d9da17 Merge pull request #3837 from Stypox/audio-sync
Fix audio/video desync caused by floating point cumulative errors
2020-07-02 21:29:18 +02:00
Hosted Weblate
e9aafc2a56 Merge branch 'origin/dev' into Weblate. 2020-07-02 17:34:57 +02:00
Digiwizkid
a91a6575e0 Translated using Weblate (Bengali (India))
Currently translated at 50.3% (290 of 576 strings)
2020-07-02 17:34:56 +02:00
Milo Ivir
5bd4093dfb Translated using Weblate (Croatian)
Currently translated at 86.6% (499 of 576 strings)
2020-07-02 17:34:54 +02:00
WaldiS
f9890e2016 Translated using Weblate (Polish)
Currently translated at 100.0% (576 of 576 strings)
2020-07-02 17:34:54 +02:00
BenjaminForster
00529fe134 Added translation using Weblate (Afrikaans) 2020-07-02 17:34:51 +02:00
Stypox
5e9dce7d39 Merge pull request #3774 from eames-palmer/status-bar-color
Update status color to match toolbar color
2020-07-01 08:39:32 +02:00
Tobias Groza
734680b9f0 Merge pull request #3373 from mauriciocolli/feed-add-search-sub-list
Add search for subscription picker in the feed group dialog
2020-07-01 00:16:01 +02:00
Tobias Groza
d0b5345252 Merge pull request #3822 from Stypox/fix-queue-colors
Fix queue channel name color for some devices
2020-07-01 00:13:29 +02:00
Tobias Groza
c2b4a44a59 Merge pull request #3828 from wb9688/checkstyle-fix
Do not include Checkstyle in any APK
2020-06-30 23:19:33 +02:00
Stypox
38c79bbc11 Fix audio/video desync caused by floating point cumulative errors 2020-06-30 22:41:09 +02:00
Digiwizkid
0d7028a36c Translated using Weblate (Bengali (India))
Currently translated at 36.1% (208 of 576 strings)
2020-06-30 19:32:06 +02:00
Digiwizkid
b63f687491 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 30.9% (178 of 576 strings)
2020-06-30 19:32:02 +02:00
Digiwizkid
952b636569 Added translation using Weblate (Bengali (India)) 2020-06-30 12:20:19 +02:00
Jasper Eames Palmer
e14ba48244 Update non-service status bar colors to match toolbar colors 2020-06-29 22:30:09 -07:00
Hosted Weblate
720c8c31ec Merge branch 'origin/dev' into Weblate. 2020-06-29 13:30:45 +02:00
Allan Nordhøy
4e8407ed8f Translated using Weblate (Norwegian Bokmål)
Currently translated at 89.2% (514 of 576 strings)
2020-06-29 13:30:43 +02:00
Enol P
26c5f69161 Translated using Weblate (Asturian)
Currently translated at 51.0% (294 of 576 strings)
2020-06-29 13:30:43 +02:00
Anonim Qwerty
078ae15794 Translated using Weblate (Ukrainian)
Currently translated at 98.9% (570 of 576 strings)
2020-06-29 13:30:42 +02:00
ssantos
16ae90dc9f Translated using Weblate (German)
Currently translated at 100.0% (576 of 576 strings)
2020-06-29 13:30:42 +02:00
TobiGr
3de5afc68e Add Markdown export of crash logs
Add app language as additional debug information to reports
2020-06-28 16:07:22 +02:00
wb9688
a7e8f5087e Do not include Checkstyle in any APK 2020-06-28 14:59:44 +02:00
Stypox
5cc60ed760 Show dialog with open options in case of an unsupported url 2020-06-28 13:33:08 +02:00
Mauricio Colli
2e6e75cd4e Add filter to the feed group dialog to show only ungrouped subscriptions 2020-06-27 11:58:40 -03:00
Mauricio Colli
9f3b35634a Fix subscription picker items flickering in the feed group dialog
The adapter could not tell the items were the same because the
subscription class was missing some methods (i.e. equals and hashcode),
so a full rebind was being done.
2020-06-27 11:25:31 -03:00
Mauricio Colli
c24dfc63dc Add search for subscription picker in the feed group dialog 2020-06-27 11:25:25 -03:00
Stypox
c029929850 Fix queue channel name color for some devices 2020-06-27 16:11:25 +02:00
Tobias Groza
d9100913d5 Merge pull request #3787 from budde25/fix-popup-queue
Fixes enqueue resuming paused videos
2020-06-27 11:56:08 +02:00
Avently
a7fbe05a73 Changes for review 2020-06-27 06:25:50 +03:00
Tobias Groza
e03d970bc2 Merge pull request #3406 from B0pol/playlist_peertube
Add possibility to open PeerTube links in NP for some instances (without needing to share to NP)
2020-06-26 18:53:49 +02:00
Tobias Groza
fe4516ea23 Merge pull request #3752 from Redirion/exoupdate
Update to ExoPlayer 2.11.6
2020-06-26 18:33:53 +02:00
Jwtiyar Nariman
039b47b872 Translated using Weblate (Central Kurdish)
Currently translated at 100.0% (576 of 576 strings)
2020-06-25 14:41:53 +02:00
Robin
0a57a8a7f3 2.11.6 2020-06-25 09:26:59 +02:00
Jwtiyar Nariman
8c823f3a2d Added translation using Weblate (Central Kurdish) 2020-06-24 11:12:52 +02:00
Éfrit
33f3a4f455 Translated using Weblate (French)
Currently translated at 100.0% (576 of 576 strings)
2020-06-24 04:41:44 +02:00
Zackz
2ecf8044d7 Translated using Weblate (Javanese)
Currently translated at 10.9% (63 of 576 strings)
2020-06-22 19:41:47 +02:00
Zackz
c9a1eb55b5 Added translation using Weblate (Javanese) 2020-06-21 18:02:36 +02:00
Ayoub Rejal
76bb1fd61e Translated using Weblate (Arabic (Libya))
Currently translated at 6.7% (39 of 576 strings)
2020-06-19 17:41:46 +02:00
ButterflyOfFire
1275b26ba0 Translated using Weblate (Kabyle)
Currently translated at 4.3% (25 of 576 strings)
2020-06-19 17:41:45 +02:00
Andreas Westrell
a470a4af9b Translated using Weblate (Swedish)
Currently translated at 99.1% (571 of 576 strings)
2020-06-19 17:41:45 +02:00
Marian Hanzel
487c9ebbd4 Translated using Weblate (Slovak)
Currently translated at 96.1% (554 of 576 strings)
2020-06-19 17:41:43 +02:00
Ethan Budd
c796e2ae3c Fixes crash when a file is deleted then redownloaded 2020-06-18 22:43:06 -05:00
Ayoub Rejal
746cab92f0 Added translation using Weblate (Arabic (Libya)) 2020-06-18 17:17:41 +02:00
Ethan Budd
33266a96ff fixes enqueue resuming paused videos 2020-06-17 22:15:50 -05:00
Hosted Weblate
2816889d8d Merge branch 'origin/dev' into Weblate. 2020-06-17 14:25:36 +02:00
ButterflyOfFire
58e177b3e4 Added translation using Weblate (Kabyle) 2020-06-17 14:25:34 +02:00
wb9688
5cfd8bbb56 Merge pull request #3704 from Stypox/keep-failed-streams
Do not remove items generating errors form queue
2020-06-15 15:16:26 +02:00
wb9688
e6fe6fd645 Merge pull request #3437 from TheLastGimbus/fast-rewind-forward-in-background-activity
Fast rewind forward in background activity
2020-06-15 15:06:58 +02:00
TheLastGimbus
63e167b38e Add buttons also in landscape mode 2020-06-14 23:22:31 +02:00
TheLastGimbus
abe77c4783 Change to final 2020-06-14 19:52:58 +02:00
TheLastGimbus
72af51fe9d Add speed button to top bar 2020-06-14 15:16:04 +02:00
TheLastGimbus
36b4134838 Remove speed buttons from bottom menu 2020-06-14 15:15:38 +02:00
Hosted Weblate
cf6ee26fdb Merge branch 'origin/dev' into Weblate. 2020-06-14 12:41:48 +02:00
Oymate
858111e623 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 30.5% (176 of 576 strings)
2020-06-14 12:41:42 +02:00
Oğuz Ersen
367e625804 Translated using Weblate (Turkish)
Currently translated at 100.0% (576 of 576 strings)
2020-06-14 12:41:42 +02:00
Freddy Morán Jr
ae4d9c7f80 Translated using Weblate (Spanish)
Currently translated at 100.0% (576 of 576 strings)
2020-06-14 12:41:42 +02:00
nautilusx
6c6ee41346 Translated using Weblate (German)
Currently translated at 99.8% (575 of 576 strings)
2020-06-14 12:41:41 +02:00
Tobias Groza
9ef7688f9e Merge pull request #3772 from adinilfeld/copy-video-title
Copy video title
2020-06-13 16:38:14 +02:00
Jasper Eames Palmer
7d6e226c2b Update status color to match toolbar color 2020-06-11 19:29:15 -07:00
adinilfeld
17d1346a8a made ClipboardManager final 2020-06-11 09:36:57 -07:00
adinilfeld
59e0c10c42 inverted if-else statement 2020-06-11 09:36:05 -07:00
adinilfeld
0d29e66092 removed unnecessary setLongClickable 2020-06-11 09:33:05 -07:00
wb9688
caa000f447 Merge pull request #3759 from Stypox/fix-search
Fix search crash: adapter array index out of bounds
2020-06-11 13:06:30 +02:00
adinilfeld
267e114354 added a copyToClipboard method to ShareUtils, and modified CommentsMiniInfoItemHolder and VideoDetailFragment to use the new method. 2020-06-10 15:14:08 -07:00
adinilfeld
b5375396d2 allowed user to copy video title to clipboard (from detail screen) 2020-06-10 14:17:43 -07:00
adinilfeld
e34f666b70 set an OnLongClickListener 2020-06-10 14:11:06 -07:00
Theophine Savio Theodore
19334b4f96 Translated using Weblate (Malayalam)
Currently translated at 100.0% (576 of 576 strings)
2020-06-10 21:41:40 +02:00
Theophine Savio Theodore
1fa609e539 Translated using Weblate (Malayalam)
Currently translated at 100.0% (576 of 576 strings)
2020-06-09 21:03:02 +02:00
Ville Rantanen
d9ce25a721 Translated using Weblate (Finnish)
Currently translated at 100.0% (576 of 576 strings)
2020-06-09 16:22:19 +02:00
thami simo
5b8fc25da6 Translated using Weblate (Arabic)
Currently translated at 100.0% (576 of 576 strings)
2020-06-09 16:22:16 +02:00
Hosted Weblate
c70968dcf1 Merge branch 'origin/dev' into Weblate. 2020-06-08 14:14:35 +02:00
Ville Rantanen
77147510fb Translated using Weblate (Finnish)
Currently translated at 83.5% (481 of 576 strings)
2020-06-08 14:14:33 +02:00
Freddy Morán Jr
7092577482 Translated using Weblate (Spanish)
Currently translated at 100.0% (576 of 576 strings)
2020-06-08 14:14:29 +02:00
Stypox
3e70050056 Fix search crash: adapter array index out of bounds 2020-06-07 21:28:54 +02:00
Tobias Groza
1f23c814e5 Merge pull request #3698 from B0pol/openWebsite
avoid duplicate: use openUrlInBrowser instead of openWebsite
2020-06-06 18:44:24 +02:00
Robin
145e0a0b7b Update to ExoPlayer 2.11.5 2020-06-06 15:29:52 +02:00
pitachips
e68e787e7a Translated using Weblate (Korean)
Currently translated at 84.3% (486 of 576 strings)
2020-06-05 19:41:39 +02:00
WaldiS
903308d285 Translated using Weblate (Polish)
Currently translated at 100.0% (576 of 576 strings)
2020-06-04 02:41:47 +02:00
zmni
a4d8388b2e Translated using Weblate (Indonesian)
Currently translated at 100.0% (576 of 576 strings)
2020-06-04 02:41:46 +02:00
Hosted Weblate
3e83f9f956 Merge branch 'origin/dev' into Weblate. 2020-06-01 19:41:43 +02:00
Anxhelo Lushka
4063221313 Translated using Weblate (Albanian)
Currently translated at 100.0% (577 of 577 strings)
2020-06-01 19:41:39 +02:00
zeritti
c3c8d80919 Translated using Weblate (Czech)
Currently translated at 100.0% (577 of 577 strings)
2020-06-01 19:41:39 +02:00
notramo
3ae71c73c4 Translated using Weblate (Hungarian)
Currently translated at 60.6% (350 of 577 strings)
2020-06-01 19:41:38 +02:00
Stypox
b3db8c9549 Do not remove items generating errors form queue 2020-05-31 14:06:22 +02:00
bopol
596eb4a0f9 Merge branch 'dev' into playlist_peertube 2020-05-31 12:26:46 +02:00
bopol
6b0381b903 avoid duplicate: use openUrlInBrowser instead of openWebsite 2020-05-31 12:17:54 +02:00
TobiGr
049c8f70cd Release version 0.19.5 (950) 2020-05-30 10:43:10 +02:00
TobiGr
353bf69550 Add changelog for 0.19.5 (950) 2020-05-30 10:42:39 +02:00
Tobias Groza
cdb989ede3 Merge pull request #3679 from wb9688/fix-android-10
Enable requestLegacyExternalStorage
2020-05-30 10:32:46 +02:00
Tobias Groza
74079e4238 Merge pull request #3680 from wb9688/fix-kiosks
Open the correct kiosk
2020-05-30 10:28:24 +02:00
wb9688
c89746214c Open the correct kiosk 2020-05-30 08:14:54 +02:00
wb9688
1d97db3ef9 Enable requestLegacyExternalStorage 2020-05-30 08:05:40 +02:00
Tobias Groza
b2a5ff5f9d Merge pull request #3669 from TeamNewPipe/release_0.19.4
Release 0.19.4
2020-05-29 19:13:09 +02:00
Stypox
f47ef2b5ea Add 0.19.4 (940) fastlane changelog 2020-05-29 18:55:01 +02:00
Stypox
bd7ec3b692 Bump to 0.19.4 (940) 2020-05-29 18:55:01 +02:00
TobiGr
52895e7b6b Increase JVM memory to fix release build 2020-05-29 18:55:01 +02:00
Stypox
a6a82c6477 Regression: fix icon size in main player 2020-05-29 15:32:44 +02:00
Tobias Groza
af66ed94b2 Merge pull request #3662 from B0pol/localisation-fixes
Localisation fixes (Fix crashes, lint)
2020-05-29 08:02:19 +02:00
Hosted Weblate
e43fdf5ef9 Merge branch 'origin/dev' into Weblate. 2020-05-29 07:29:53 +02:00
Ishwor Ghimire
3984fc075f Translated using Weblate (Nepali)
Currently translated at 99.8% (576 of 577 strings)
2020-05-29 07:29:53 +02:00
Allan Nordhøy
ee2a159374 Translated using Weblate (Norwegian Bokmål)
Currently translated at 89.0% (514 of 577 strings)
2020-05-29 07:29:52 +02:00
Eric
57c9b29ba3 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (577 of 577 strings)
2020-05-29 07:29:52 +02:00
Samuel Carvalho de Araújo
927ea72337 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (577 of 577 strings)
2020-05-29 07:29:51 +02:00
Mostafa Ahangarha
123bdbd13b Translated using Weblate (Persian)
Currently translated at 96.1% (555 of 577 strings)
2020-05-29 07:29:51 +02:00
WaldiS
0baa5a2f04 Translated using Weblate (Polish)
Currently translated at 100.0% (577 of 577 strings)
2020-05-29 07:29:46 +02:00
Emin Tufan Çetin
7d98a70028 Translated using Weblate (Turkish)
Currently translated at 100.0% (577 of 577 strings)
2020-05-29 07:29:45 +02:00
Rex_sa
73b72ab01c Translated using Weblate (Arabic)
Currently translated at 99.8% (576 of 577 strings)
2020-05-29 07:29:45 +02:00
B0pol
e8cf71f41c Translated using Weblate (Esperanto)
Currently translated at 97.5% (563 of 577 strings)
2020-05-29 07:29:44 +02:00
ssantos
5f2d2a64d2 Translated using Weblate (Portuguese)
Currently translated at 100.0% (577 of 577 strings)
2020-05-29 07:29:44 +02:00
AioiLight
27bf3901de Translated using Weblate (Japanese)
Currently translated at 100.0% (577 of 577 strings)
2020-05-29 07:29:44 +02:00
TotalCaesar659
16d4fa03a5 Translated using Weblate (English)
Currently translated at 99.8% (576 of 577 strings)
2020-05-29 07:29:43 +02:00
Terry Louwers
bef579ec26 Translated using Weblate (Dutch)
Currently translated at 100.0% (577 of 577 strings)
2020-05-29 07:29:43 +02:00
Edoardo Regni
0cff10e02e Translated using Weblate (Dutch)
Currently translated at 100.0% (577 of 577 strings)
2020-05-29 07:29:41 +02:00
Terry Louwers
4c6f7238dd Translated using Weblate (Dutch)
Currently translated at 100.0% (577 of 577 strings)
2020-05-29 07:29:41 +02:00
bopol
583f1476d6 oops 2020-05-28 23:32:44 +02:00
bopol
b42bef32fd remove totally untranslated languages 2020-05-28 23:21:28 +02:00
bopol
8bb85ccf19 other translation linting stuff 2020-05-28 23:14:57 +02:00
bopol
3d88c2a5fa fix crash in hindi and pa languages 2020-05-28 22:59:14 +02:00
bopol
e350acaf08 remove unused plural string «comments»
on top of being unused, there were MANY problems for some languages: %s missing, only «one» quantity is translated…
2020-05-28 22:49:41 +02:00
bopol
172f70bef9 fix crash in polish, lint: remove translated translatable=false string 2020-05-28 22:22:29 +02:00
Tobias Groza
9d25c0bf8a Merge pull request #3509 from wb9688/upgrade-dependencies
Upgrade some dependencies
2020-05-28 22:07:04 +02:00
TobiGr
75b377aab3 Updatethe extractor version 2020-05-28 21:56:54 +02:00
TobiGr
3706f30b44 Merge remote-tracking branch 'Weblate/dev' into dev 2020-05-28 21:46:45 +02:00
wb9688
a9697a61ad Fix viewing licenses 2020-05-28 11:39:17 +02:00
wb9688
e16a2d7cb6 Upgrade jsoup 2020-05-28 11:39:17 +02:00
Arnis Jaundzeikars
f106e2945b Added translation using Weblate (Latvian) 2020-05-27 18:06:40 +02:00
pjammo
1ad7deddb1 Translated using Weblate (Italian)
Currently translated at 99.6% (575 of 577 strings)
2020-05-26 09:52:46 +02:00
wb9688
7b81e98581 Upgrade ACRA 2020-05-25 11:03:07 +02:00
wb9688
0cae58ce8e Upgrade LeakCanary 2020-05-25 11:03:07 +02:00
wb9688
7231150115 Upgrade some dependencies 2020-05-22 15:40:28 +02:00
Hosted Weblate
071986a4c9 Merge branch 'origin/dev' into Weblate. 2020-05-22 11:41:39 +02:00
Rahul Bali
39e7d43f10 Translated using Weblate (Hindi)
Currently translated at 82.4% (476 of 577 strings)
2020-05-22 11:41:37 +02:00
Yaron Shahrabani
aa1b17ae66 Translated using Weblate (Hebrew)
Currently translated at 100.0% (577 of 577 strings)
2020-05-22 11:41:37 +02:00
Anonymous
92bae88355 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.8% (172 of 577 strings)
2020-05-22 11:41:36 +02:00
Jeff Huang
067eaf363e Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (577 of 577 strings)
2020-05-22 11:41:36 +02:00
Samuel Carvalho de Araújo
00efc266d9 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (577 of 577 strings)
2020-05-22 11:41:36 +02:00
Oğuz Ersen
0b014185e3 Translated using Weblate (Turkish)
Currently translated at 100.0% (577 of 577 strings)
2020-05-22 11:41:36 +02:00
zmni
3eee7378de Translated using Weblate (Indonesian)
Currently translated at 100.0% (577 of 577 strings)
2020-05-22 11:41:36 +02:00
zeritti
c31428f6bc Translated using Weblate (Czech)
Currently translated at 100.0% (577 of 577 strings)
2020-05-22 11:41:35 +02:00
B0pol
163e561cf9 Translated using Weblate (French)
Currently translated at 100.0% (577 of 577 strings)
2020-05-22 11:41:35 +02:00
JoC
a32ded2829 Translated using Weblate (Spanish)
Currently translated at 100.0% (577 of 577 strings)
2020-05-22 11:41:35 +02:00
nautilusx
a5b7517fbd Translated using Weblate (German)
Currently translated at 99.8% (576 of 577 strings)
2020-05-22 11:41:34 +02:00
Tobias Groza
176d57b35a Merge pull request #3271 from Stypox/icons
Use vector drawables instead of PNGs for material icons
2020-05-21 19:32:43 +02:00
Stypox
927a1d58e2 Use drop down/up instead of expand icons in drawer
As per the material guidelines
2020-05-21 15:39:36 +02:00
Stypox
bbd0df08d3 Add shadow behind play icon in video detail fragment 2020-05-21 15:39:36 +02:00
Stypox
9e57195e14 Fix checkstyle issues
Also replace all tabs with 4 spaces
2020-05-21 15:39:36 +02:00
Stypox
05ab54c30d Fix invisible fullscreen button in popup player on API 19 2020-05-21 15:39:36 +02:00
Stypox
e3e2028153 Use AppCompatResources instead of ContextCompat 2020-05-21 15:39:36 +02:00
Stypox
883bcc735d Fix pause used instead of play in paused popup player when seeking
Also use `setBackgroundResource` to automatically obtain PNG drawables (from exoplayer)
2020-05-21 15:39:36 +02:00
Stypox
158727e2f2 Replace hardcoded white drawable with themed one 2020-05-21 15:39:36 +02:00
Stypox
899f69d120 Fix additional empty title on tab selection fragments in API 19 2020-05-21 15:39:36 +02:00
Stypox
b575046c05 Fix choice dialogs on API 19 by manually getting drawable 2020-05-21 15:39:36 +02:00
Stypox
b5c60d2be2 Update AndroidX to fix icon crashes in preferences on API 19
Also remove legacy libraries
Use `androidx.preference:preference` instead of `androidx.legacy:legacy-preference-v14` and remove `androidx.legacy:legacy-support-v4
2020-05-21 15:39:36 +02:00
Stypox
631dfee763 Readd ic_close and ic_replay PNGs: needed in notifications
The other icons used in notifications are taken from exoplayer's ones: `@drawable/exo_controls_*`
2020-05-21 15:39:36 +02:00
Stypox
d7f610113e Fix background player queue crashing on opening 2020-05-21 15:39:36 +02:00
Stypox
e0e4f6db2b Fix MainFragment tab icons did not follow theme color 2020-05-21 15:39:36 +02:00
Stypox
c27a26c0aa Rename ic_hot in ic_kiosk_hot and improve getKioskIcon() 2020-05-21 15:39:36 +02:00
Stypox
3dcd2468a2 Use app:srcCompat and derivatives intead of android: ones
To fix crashes on API 19
2020-05-21 15:39:36 +02:00
Stypox
ea43b28f74 Use vector drawables instead of PNGs for material icons
For all manually-created images PNG have been kept.
- rename all icon attrs to have a `ic_` prefix
- always use `_24dp` icons, because there is no real difference, since they are vector drawables
- always use the original name found on material.io for icon drawables, as to not create confusion and possibly duplicates. Icon names can still be different from real drawable names, though I have made some of them compliant to this or maybe more meaningul.
- remove duplicate `getIconByAttr()` in ThemeHelper (use `resolveResourceIdFromAttr()`
- use standard icons for `expand_more` and `expand_less` instead of triangles
- use `play_button_outline` instead of custom PNG as play button in VideoDetailFragment (questionable, as there is no shadow anymore)
2020-05-21 15:39:35 +02:00
bopol
a3e2a085b6 Merge pull request #3501 from B0pol/openInBrowser
Open in browser button now really opens in browser
2020-05-21 09:24:57 +02:00
Anonymous
635d51b60d Translated using Weblate (Hindi)
Currently translated at 82.4% (476 of 577 strings)
2020-05-20 12:31:02 +02:00
Rahul Bali
95eb1c0d95 Translated using Weblate (Hindi)
Currently translated at 82.4% (476 of 577 strings)
2020-05-20 12:31:01 +02:00
Rahul Bali
8aca43a7e6 Translated using Weblate (Hindi)
Currently translated at 81.9% (473 of 577 strings)
2020-05-20 12:25:58 +02:00
Anonymous
f6afe59788 Translated using Weblate (Hindi)
Currently translated at 81.9% (473 of 577 strings)
2020-05-20 12:25:57 +02:00
bopol
8e13161f64 fix checkstyle 2020-05-19 21:57:46 +02:00
bopol
97437b8af3 apply @stypox suggestions 2020-05-19 21:52:30 +02:00
bopol
9a938093e2 Open in browser button now really opens in browser 2020-05-19 21:51:47 +02:00
Hosted Weblate
3edcc9f9fd Merge branch 'origin/dev' into Weblate. 2020-05-19 17:02:04 +02:00
Oymate
55db408720 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.6% (171 of 577 strings)
2020-05-19 17:02:04 +02:00
Samuel Carvalho de Araújo
caef874814 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (577 of 577 strings)
2020-05-19 17:02:04 +02:00
Anonymous
1622639eca Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.6% (171 of 577 strings)
2020-05-19 17:02:00 +02:00
Oymate
4df89f4217 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.6% (171 of 577 strings)
2020-05-19 17:02:00 +02:00
Tobias Groza
079b98ed3f Merge pull request #3618 from Stypox/long-press-strings
Improve long-press menu strings
2020-05-19 08:38:00 +02:00
Stypox
a0526d2c9c Improve long-press menu strings 2020-05-19 08:24:04 +02:00
Stypox
169b1cbd32 Merge pull request #3613 from wb9688/fix-download-dialog-freeze
Fix download dialog freeze
2020-05-18 14:11:17 +02:00
wb9688
8968081e77 Remove not needed Checkstyle stuff 2020-05-18 13:40:01 +02:00
wb9688
93ba7510e1 Fix ListHelper ANR 2020-05-18 13:40:01 +02:00
Hosted Weblate
579bb743bb Merge branch 'origin/dev' into Weblate. 2020-05-18 13:17:56 +02:00
Rai Tsa
9e5e9ea612 Translated using Weblate (Finnish)
Currently translated at 58.0% (335 of 577 strings)
2020-05-18 13:17:54 +02:00
Thien Bui
2241a13cba Translated using Weblate (Vietnamese)
Currently translated at 99.8% (576 of 577 strings)
2020-05-18 13:17:54 +02:00
Isak Holmström
9c1fb0cb92 Translated using Weblate (Swedish)
Currently translated at 89.4% (516 of 577 strings)
2020-05-18 13:17:52 +02:00
Anonymous
4904514257 Translated using Weblate (Swedish)
Currently translated at 89.4% (516 of 577 strings)
2020-05-18 13:17:52 +02:00
Samuel Carvalho de Araújo
6d829c26a1 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (577 of 577 strings)
2020-05-18 13:17:52 +02:00
Stypox
c05467fb92 Merge pull request #3513 from Stypox/exoplayer
Update to ExoPlayer 2.11.4
2020-05-17 22:02:19 +02:00
Anonymous
d47f7f3348 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (577 of 577 strings)
2020-05-17 00:52:28 +02:00
Samuel Carvalho de Araújo
5931a84651 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (577 of 577 strings)
2020-05-16 04:41:32 +02:00
zeritti
5771783d11 Translated using Weblate (Czech)
Currently translated at 100.0% (577 of 577 strings)
2020-05-16 04:41:32 +02:00
Hosted Weblate
aae07a60bd Merge branch 'origin/dev' into Weblate. 2020-05-14 11:38:10 +02:00
MohammedSR Vevo
462d418ee0 Translated using Weblate (Kurdish)
Currently translated at 100.0% (577 of 577 strings)
2020-05-14 11:38:08 +02:00
Isak Holmström
ce63c2e1db Translated using Weblate (Swedish)
Currently translated at 89.4% (516 of 577 strings)
2020-05-14 11:38:07 +02:00
Isak Holmström
52baf8cbe5 Translated using Weblate (Swedish)
Currently translated at 89.4% (516 of 577 strings)
2020-05-14 11:38:07 +02:00
ssantos
1779b9ee1a Translated using Weblate (Portuguese)
Currently translated at 100.0% (577 of 577 strings)
2020-05-14 11:38:06 +02:00
B0pol
eae169236c Merge pull request #3581 from B0pol/gitignore
Add vscode / eclipse files to gitignore
2020-05-13 18:11:51 +00:00
bopol
ce0efba0d2 gitignore update 2020-05-13 19:54:02 +02:00
Tobias Groza
87c7ac3970 Merge pull request #3580 from wb9688/fix-email
Fix sending e-mail from crash reporter
2020-05-13 17:10:22 +02:00
bopol
0f8d196a52 Add vscode / eclipse files to gitignore 2020-05-13 11:07:02 +02:00
Stypox
6dc7dab154 Merge pull request #3565 from B0pol/retry-button-color
Change retry & subscribe buttons background color based on service color
2020-05-13 11:01:40 +02:00
wb9688
dd4cb23005 Fix sending e-mail from crash reporter 2020-05-13 09:42:08 +02:00
ButterflyOfFire
0589017f8c Translated using Weblate (Arabic)
Currently translated at 100.0% (577 of 577 strings)
2020-05-12 15:41:32 +02:00
bopol
55027a9b2b bump extractor version 2020-05-11 21:41:56 +02:00
bopol
0a984ca8c8 remove duplicate host in manifest 2020-05-11 21:41:56 +02:00
bopol
929d13bfea add support for some peertube instances
The one used for tests, popular instances and user wanted (e.g. la quadrature du net, video.lqdn.fr, or @TheAssassin instance, media-assassinate-you.net)
2020-05-11 21:41:56 +02:00
bopol
375e18bec8 subscribe button now match service's main color 2020-05-11 19:29:34 +02:00
WaldiS
b9de74f183 Translated using Weblate (Polish)
Currently translated at 100.0% (577 of 577 strings)
2020-05-11 08:54:43 +02:00
Oğuz Ersen
08ca69507f Translated using Weblate (Turkish)
Currently translated at 100.0% (577 of 577 strings)
2020-05-11 08:54:42 +02:00
JoC
65ca982342 Translated using Weblate (Spanish)
Currently translated at 100.0% (577 of 577 strings)
2020-05-11 08:54:42 +02:00
Igor Nedoboy
658281a92c Translated using Weblate (Russian)
Currently translated at 100.0% (577 of 577 strings)
2020-05-10 22:59:48 +02:00
Igor Nedoboy
a959f61367 Translated using Weblate (Russian)
Currently translated at 100.0% (577 of 577 strings)
2020-05-10 22:50:30 +02:00
Yaron Shahrabani
8e61f744ec Translated using Weblate (Hebrew)
Currently translated at 100.0% (577 of 577 strings)
2020-05-10 14:34:56 +02:00
Jeff Huang
73d3e52e29 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (577 of 577 strings)
2020-05-10 14:34:55 +02:00
Xiang Xu
49a134845c Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (577 of 577 strings)
2020-05-10 14:34:55 +02:00
Samuel Carvalho de Araújo
29807f3d39 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (577 of 577 strings)
2020-05-10 14:34:55 +02:00
WaldiS
29b79b7725 Translated using Weblate (Polish)
Currently translated at 99.8% (576 of 577 strings)
2020-05-10 14:34:54 +02:00
zmni
1cdb10a040 Translated using Weblate (Indonesian)
Currently translated at 100.0% (577 of 577 strings)
2020-05-10 14:34:54 +02:00
AioiLight
5f7851df72 Translated using Weblate (Japanese)
Currently translated at 100.0% (577 of 577 strings)
2020-05-10 14:34:54 +02:00
winqooq
3d9bc05d7a Translated using Weblate (Russian)
Currently translated at 99.4% (574 of 577 strings)
2020-05-10 14:34:53 +02:00
B0pol
c127428c59 Translated using Weblate (French)
Currently translated at 100.0% (577 of 577 strings)
2020-05-10 14:34:53 +02:00
nautilusx
7966d8403a Translated using Weblate (German)
Currently translated at 100.0% (577 of 577 strings)
2020-05-10 14:34:53 +02:00
bopol
80cc8a8e02 color retry button based on service color 2020-05-10 10:54:12 +02:00
Igor Nedoboy
ee4e205fef Translated using Weblate (Russian)
Currently translated at 99.4% (574 of 577 strings)
2020-05-10 02:07:05 +02:00
Hosted Weblate
ea443dc80c Merge branch 'origin/dev' into Weblate. 2020-05-09 16:13:01 +02:00
Senthil Kumar G
283645513d Translated using Weblate (Tamil)
Currently translated at 35.8% (206 of 574 strings)
2020-05-09 16:12:57 +02:00
Anonymous
81b99382b8 Translated using Weblate (Italian)
Currently translated at 100.0% (574 of 574 strings)
2020-05-09 16:12:57 +02:00
random r
ab74465e6c Translated using Weblate (Italian)
Currently translated at 100.0% (574 of 574 strings)
2020-05-09 16:12:57 +02:00
Tobias Groza
b3eadb557b Merge pull request #3337 from AioiLight/blocking-gesture-when-touch-from-navbar
Block the gesture when touch it from NavigationBar or StatusBar.
2020-05-09 10:43:15 +02:00
AioiLight
0abd2bcba6 Clean up code
Follow Checkstyle

Move to PlayerGestureListener from VideoPlayerImpl

Update app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java

Co-authored-by: wb9688 <46277131+wb9688@users.noreply.github.com>
2020-05-09 10:11:46 +02:00
Tobias Groza
9cf76a918e Merge pull request #3430 from Royosef/DisplayParentChannelDetails
Display parent channel details
2020-05-08 23:29:28 +02:00
wb9688
ae437b1510 Bump NewPipeExtractor 2020-05-08 18:07:52 +02:00
wb9688
1096ec1c09 Adjust sub-channel thumbnail size 2020-05-08 15:51:21 +02:00
wb9688
235394d96c Don't show sub-channel thumbnail by default 2020-05-08 15:51:21 +02:00
Anonymous
d25e1d801c Translated using Weblate (Italian)
Currently translated at 99.6% (572 of 574 strings)
2020-05-08 12:35:52 +02:00
random r
2dca5ab966 Translated using Weblate (Italian)
Currently translated at 99.6% (572 of 574 strings)
2020-05-08 12:35:52 +02:00
caltaojihun
89ab57b1c1 Translated using Weblate (Vietnamese)
Currently translated at 94.4% (542 of 574 strings)
2020-05-08 09:56:46 +02:00
caltaojihun
dc66e6a4bf Translated using Weblate (Vietnamese)
Currently translated at 79.7% (458 of 574 strings)
2020-05-08 06:49:55 +02:00
Hosted Weblate
5c2f2fd882 Merge branch 'origin/dev' into Weblate. 2020-05-07 23:24:06 +02:00
MohammedSR Vevo
5c3ddefbf9 Translated using Weblate (Kurdish)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 23:24:04 +02:00
thami simo
a8d3f45ea1 Translated using Weblate (Arabic)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 23:24:03 +02:00
ssantos
cc2c41ddc8 Translated using Weblate (Portuguese)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 23:24:03 +02:00
wb9688
b990f30a09 Merge pull request #3545 from Stypox/kore
Fix Kodi button showing up with unsupported services
2020-05-07 21:44:09 +02:00
Stypox
5c711322d4 In player hide kodi button if service unsupported 2020-05-07 21:11:34 +02:00
Roy Yosef
b7d4a4f604 Navigate to parent(uploader) channel from the uploader section on long click 2020-05-07 20:40:17 +02:00
Roy Yosef
cc8874b687 Fix PR review
Make all of the uploader section on stream page navigate to the channel page
Extract hard coded strings
Remove redundant spaces
Fix open streams from a channel
Rename "ParentChannel" to "SubChannel"
Config royosef:NewPipeExtractor in app/build.gradle
2020-05-07 20:40:17 +02:00
Roy Yosef
2d0bc05488 Add sub-channel details to channel fragment 2020-05-07 20:39:32 +02:00
Roy Yosef
1429774487 Add sub-channel details to video detail fragment 2020-05-07 20:39:32 +02:00
wb9688
2060312dc1 Merge pull request #3466 from B0pol/soundCloudComments
adapt CommentsInfoItemExtractorRefactoring
2020-05-07 16:06:15 +02:00
bopol
8b6728480f bump extractor version 2020-05-07 15:46:41 +02:00
Anxhelo Lushka
cecafdee29 Translated using Weblate (Albanian)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:28 +02:00
Senthil Kumar G
05f2af25af Translated using Weblate (Tamil)
Currently translated at 35.7% (205 of 574 strings)
2020-05-07 13:58:27 +02:00
Yaron Shahrabani
e3d826f6c4 Translated using Weblate (Hebrew)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:27 +02:00
Jeff Huang
02430bed90 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:27 +02:00
Samuel Carvalho de Araújo
3f7005ed9a Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:26 +02:00
WaldiS
586ee75833 Translated using Weblate (Polish)
Currently translated at 99.8% (573 of 574 strings)
2020-05-07 13:58:26 +02:00
Emin Tufan Çetin
1d903f11a8 Translated using Weblate (Turkish)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:25 +02:00
Muhammad Mauli Mubassari
578159b95c Translated using Weblate (Indonesian)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:25 +02:00
zeritti
5c95587284 Translated using Weblate (Czech)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:25 +02:00
Marian Hanzel
f7e9227ad2 Translated using Weblate (Slovak)
Currently translated at 94.0% (540 of 574 strings)
2020-05-07 13:58:24 +02:00
AioiLight
c11a4d6867 Translated using Weblate (Japanese)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:23 +02:00
Anonymous
6c2b0448a4 Translated using Weblate (Dutch)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:23 +02:00
Terry Louwers
bd0eb8cccf Translated using Weblate (Dutch)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:23 +02:00
nautilusx
09bb043952 Translated using Weblate (German)
Currently translated at 100.0% (574 of 574 strings)
2020-05-07 13:58:22 +02:00
Stypox
9ca6cfd637 Fix Kodi button showing up in unsupported services 2020-05-06 20:55:53 +02:00
Igor Nedoboy
3869a66fcc Translated using Weblate (Russian)
Currently translated at 100.0% (574 of 574 strings)
2020-05-06 13:33:14 +02:00
bopol
d1c94f5120 adapt CommentsInfoItemExtractorRefactoring 2020-05-05 15:03:59 +02:00
Igor Nedoboy
c55e9941ec Translated using Weblate (Russian)
Currently translated at 100.0% (574 of 574 strings)
2020-05-05 08:21:44 +02:00
Hosted Weblate
fa9a419d73 Merge branch 'origin/dev' into Weblate. 2020-05-04 17:49:25 +02:00
Software In Interlingua
ab4e0da6b4 Translated using Weblate (Interlingua)
Currently translated at 39.7% (228 of 573 strings)
2020-05-04 17:49:22 +02:00
Igor Nedoboy
073572681e Translated using Weblate (Russian)
Currently translated at 100.0% (573 of 573 strings)
2020-05-04 17:49:21 +02:00
wb9688
b630f269c4 Merge pull request #3511 from wb9688/ktlint
Ktlint
2020-05-04 15:13:07 +02:00
wb9688
40b1cd82b1 Merge pull request #2727 from vnagel/ageRestrictedContent
Restricted mode setting for youtube
2020-05-04 15:05:11 +02:00
Tobias Groza
abcbdef63b Merge pull request #3502 from wb9688/allow-translation
Allow time ago debug setting translation
2020-05-03 23:25:54 +02:00
Tobias Groza
dc8d1b0993 Merge pull request #3478 from TeamNewPipe/release_0.19.3
Release 0.19.3
2020-05-03 21:22:44 +02:00
Hosted Weblate
56d53d8805 Merge branch 'origin/dev' into Weblate. 2020-05-03 15:40:40 +02:00
Oymate
7433fe049c Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.6% (170 of 573 strings)
2020-05-03 15:40:40 +02:00
postsorino
bb2be49d3b Translated using Weblate (Greek)
Currently translated at 85.1% (488 of 573 strings)
2020-05-03 15:40:40 +02:00
Bruno Guerreiro
cd1b578e84 Translated using Weblate (Portuguese)
Currently translated at 100.0% (573 of 573 strings)
2020-05-03 15:40:40 +02:00
winqooq
c3df9b4105 Translated using Weblate (Russian)
Currently translated at 99.4% (570 of 573 strings)
2020-05-03 15:40:37 +02:00
TobiGr
243f3e21ec Release 0.19.3 (930) 2020-05-03 14:13:21 +02:00
TobiGr
375291380c Add changelog 2020-05-03 14:13:21 +02:00
TobiGr
d221194454 Merge remote-tracking branch 'Weblate/dev' into dev 2020-05-03 14:12:59 +02:00
TobiGr
6d94a54387 Update extractor to fix NPE in YouTube Muic search 2020-05-03 14:12:22 +02:00
Anonymous
910bde88c7 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.6% (170 of 573 strings)
2020-05-02 16:35:50 +02:00
Oymate
72916544ce Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.6% (170 of 573 strings)
2020-05-02 16:35:50 +02:00
Anonymous
a01975dfce Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.4% (169 of 573 strings)
2020-05-02 16:35:29 +02:00
Oymate
10708801ae Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.4% (169 of 573 strings)
2020-05-02 16:35:28 +02:00
Anonymous
ac096fb4e7 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.3% (168 of 573 strings)
2020-05-02 16:33:50 +02:00
Oymate
620c1397ba Translated using Weblate (Bengali (Bangladesh))
Currently translated at 29.3% (168 of 573 strings)
2020-05-02 16:33:50 +02:00
Anonymous
5b2f2f34f6 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 28.7% (165 of 573 strings)
2020-05-02 16:33:04 +02:00
Hosted Weblate
ae3861a29d Merge branch 'origin/dev' into Weblate. 2020-05-02 16:27:27 +02:00
Oymate
93e2145254 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 28.6% (164 of 573 strings)
2020-05-02 16:27:27 +02:00
pjammo
2b6290d275 Translated using Weblate (Italian)
Currently translated at 99.6% (571 of 573 strings)
2020-05-02 16:27:26 +02:00
Anonymous
f81af7acb3 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 28.6% (164 of 573 strings)
2020-05-02 16:27:23 +02:00
Oymate
f0170247a4 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 28.6% (164 of 573 strings)
2020-05-02 16:27:23 +02:00
TobiGr
3430874d11 Merge remote-tracking branch 'Weblate/dev' into dev 2020-05-02 16:21:56 +02:00
Tobias Groza
cb5e7532ab Merge pull request #3480 from wb9688/update-nanojson
Use our nanojson fork
2020-05-02 16:17:29 +02:00
Anonymous
5b928d679c Translated using Weblate (Bengali (Bangladesh))
Currently translated at 28.2% (162 of 573 strings)
2020-05-02 16:17:14 +02:00
Oymate
697b9694e5 Translated using Weblate (Bengali (Bangladesh))
Currently translated at 28.2% (162 of 573 strings)
2020-05-02 16:17:13 +02:00
wb9688
81c3e7e7f6 Use our nanojson fork 2020-05-02 16:03:15 +02:00
NITHIN
0517bba8ca Translated using Weblate (Malayalam)
Currently translated at 100.0% (573 of 573 strings)
2020-05-02 12:31:09 +02:00
MohammedSR Vevo
83c7244fe6 Translated using Weblate (Kurdish)
Currently translated at 100.0% (573 of 573 strings)
2020-05-02 12:31:09 +02:00
ssantos
68fd129042 Translated using Weblate (Portuguese)
Currently translated at 100.0% (573 of 573 strings)
2020-05-02 12:31:08 +02:00
pjammo
b697e8a616 Translated using Weblate (Italian)
Currently translated at 100.0% (573 of 573 strings)
2020-05-02 12:31:08 +02:00
B0pol
2b281fbde9 Translated using Weblate (French)
Currently translated at 100.0% (573 of 573 strings)
2020-05-02 12:31:07 +02:00
JoC
de8c4018c4 Translated using Weblate (Spanish)
Currently translated at 100.0% (573 of 573 strings)
2020-05-02 12:31:07 +02:00
Jeannette
9e8af96bbf Translated using Weblate (German)
Currently translated at 100.0% (573 of 573 strings)
2020-05-02 12:31:07 +02:00
wb9688
b0415a5289 Auto-format using Ktlint 2020-05-01 20:13:21 +02:00
wb9688
ff7344438b Optimize imports 2020-05-01 20:13:01 +02:00
wb9688
f5f8e5d279 Add Ktlint 2020-05-01 20:09:52 +02:00
Stypox
b4ddc8f96c Update to ExoPlayer 2.11.4 2020-05-01 15:03:54 +02:00
Theophine Savio Theodore
e556c8ee15 Translated using Weblate (Malayalam)
Currently translated at 100.0% (573 of 573 strings)
2020-04-30 02:16:11 +02:00
Anxhelo Lushka
2f9a0b3376 Translated using Weblate (Albanian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-30 02:16:06 +02:00
Isak Holmström
828f07b401 Translated using Weblate (Swedish)
Currently translated at 85.8% (492 of 573 strings)
2020-04-30 02:16:06 +02:00
Isak Holmström
36921b3426 Translated using Weblate (Swedish)
Currently translated at 85.8% (492 of 573 strings)
2020-04-30 02:16:06 +02:00
Edoardo Regni
3988c6491c Translated using Weblate (Dutch)
Currently translated at 100.0% (573 of 573 strings)
2020-04-30 02:16:05 +02:00
Igor Nedoboy
2cf558ec05 Translated using Weblate (Russian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-29 21:53:56 +02:00
Anonymous
6fbadbdd94 Translated using Weblate (Dutch)
Currently translated at 100.0% (573 of 573 strings)
2020-04-29 16:06:40 +02:00
Edoardo Regni
faa1d7effb Translated using Weblate (Dutch)
Currently translated at 100.0% (573 of 573 strings)
2020-04-29 16:06:40 +02:00
Anonymous
fe73a708d4 Translated using Weblate (Dutch)
Currently translated at 100.0% (573 of 573 strings)
2020-04-29 16:00:05 +02:00
Edoardo Regni
a5ca262faa Translated using Weblate (Dutch)
Currently translated at 100.0% (573 of 573 strings)
2020-04-29 16:00:05 +02:00
wb9688
8ebb1e29fa Allow time ago debug setting translation 2020-04-29 14:47:06 +02:00
Igor Nedoboy
1b44dc9522 Translated using Weblate (Russian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-28 21:43:06 +02:00
Theophine Savio Theodore
a66d468dc2 Translated using Weblate (Malayalam)
Currently translated at 81.5% (467 of 573 strings)
2020-04-28 05:27:35 +02:00
Igor Nedoboy
ca8beafc2d Translated using Weblate (Russian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-27 19:08:53 +02:00
Igor Nedoboy
639c589a4a Translated using Weblate (Russian)
Currently translated at 99.3% (569 of 573 strings)
2020-04-27 18:53:59 +02:00
Hosted Weblate
cd66836218 Merge branch 'origin/dev' into Weblate. 2020-04-27 16:26:09 +02:00
Rex_sa
98662baa26 Translated using Weblate (Arabic)
Currently translated at 100.0% (573 of 573 strings)
2020-04-27 16:26:09 +02:00
Theophine Savio Theodore
004e5794e3 Added translation using Weblate (Malayalam) 2020-04-27 16:26:05 +02:00
Tobias Groza
f4f4f062cf Merge pull request #3495 from Stypox/fix-rotation
Fix rotation
2020-04-27 09:18:08 +02:00
Stypox
d8d9c7e171 Fix crashes on rotation by checking for null 2020-04-27 09:01:24 +02:00
Hosted Weblate
ceff82732e Merge branch 'origin/dev' into Weblate. 2020-04-26 20:43:27 +02:00
Anxhelo Lushka
d94b1708a9 Translated using Weblate (Albanian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:27 +02:00
MohammedSR Vevo
46e1f16012 Translated using Weblate (Kurdish)
Currently translated at 99.8% (572 of 573 strings)
2020-04-26 20:43:27 +02:00
Milo Ivir
bbd014d409 Translated using Weblate (Croatian)
Currently translated at 88.1% (505 of 573 strings)
2020-04-26 20:43:26 +02:00
Jeff Huang
d553ee7c60 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:26 +02:00
WaldiS
2df6ab240d Translated using Weblate (Polish)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:26 +02:00
Emin Tufan Çetin
8a2b9dfd6a Translated using Weblate (Turkish)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:26 +02:00
Иван
1f7892d7a9 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:25 +02:00
vkhomenk
d11c537bea Translated using Weblate (Ukrainian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:25 +02:00
winqooq
2d4d237009 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:25 +02:00
zeritti
daeee6b616 Translated using Weblate (Czech)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:24 +02:00
StarFang208
eacb0b13b2 Translated using Weblate (Italian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:23 +02:00
Igor Nedoboy
dc5748059a Translated using Weblate (Russian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:23 +02:00
JoC
96d75f4bcb Translated using Weblate (Spanish)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:23 +02:00
winqooq
19bfdf3f9f Translated using Weblate (Russian)
Currently translated at 100.0% (573 of 573 strings)
2020-04-26 20:43:20 +02:00
Tobias Groza
4ea273b297 Merge pull request #3483 from B0pol/tv
Better detection of TV devices
2020-04-26 12:55:13 +02:00
Vincent Nagel
72c9845174 removed unnecessary method call 2020-04-25 21:39:53 -05:00
bopol
77597b329e store isTv value to prevent calculating it again and again 2020-04-26 00:36:45 +02:00
bopol
f62f00b4ad Fix crash on Android 4.4 and surely other sdk versions 2020-04-25 23:38:34 +02:00
TheLastGimbus
1975973ff2 Update progress bar on fast forward/rewind 2020-04-25 15:46:56 +02:00
bopol
00262b4a49 Better detection of TV devices
Some devices were not detected as TV even though they are
2020-04-25 12:04:44 +02:00
Hosted Weblate
de6cabe408 Merge branch 'origin/dev' into Weblate. 2020-04-25 02:11:39 +02:00
Mitosagi
d65552b59f Translated using Weblate (Japanese)
Currently translated at 100.0% (573 of 573 strings)
2020-04-25 02:11:37 +02:00
Florian
3755f48bce Translated using Weblate (French)
Currently translated at 100.0% (573 of 573 strings)
2020-04-25 02:11:36 +02:00
Anonymous
8fe75d2015 Translated using Weblate (French)
Currently translated at 100.0% (573 of 573 strings)
2020-04-25 02:11:36 +02:00
TobiGr
b0c0249ce6 Merge remote-tracking branch 'Weblate/dev' into dev 2020-04-24 18:27:25 +02:00
Lucas Araujo
17685f3d86 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (573 of 573 strings)
2020-04-24 17:04:09 +02:00
Anonymous
30f1c71569 Translated using Weblate (Indonesian)
Currently translated at 99.8% (572 of 573 strings)
2020-04-24 17:04:09 +02:00
zmni
137afba1b6 Translated using Weblate (Indonesian)
Currently translated at 99.8% (572 of 573 strings)
2020-04-24 17:04:09 +02:00
AioiLight
b27de5cac1 Translated using Weblate (Japanese)
Currently translated at 100.0% (573 of 573 strings)
2020-04-24 17:04:08 +02:00
nautilusx
8d43ae9805 Translated using Weblate (German)
Currently translated at 100.0% (573 of 573 strings)
2020-04-24 17:04:08 +02:00
Yaron Shahrabani
3cebb028f4 Translated using Weblate (Hebrew)
Currently translated at 100.0% (573 of 573 strings)
2020-04-24 11:39:27 +02:00
Hosted Weblate
28ab9d3515 Merge branch 'origin/dev' into Weblate. 2020-04-24 11:19:02 +02:00
Mladen Pejaković
f7739309e8 Translated using Weblate (Serbian)
Currently translated at 42.1% (240 of 569 strings)
2020-04-24 11:19:00 +02:00
Stypox
2db0d63c97 Merge pull request #3065 from GradyClark/dev
Added the ability to remove all watched videos from a local playlist
2020-04-23 23:52:28 +02:00
Stypox
437b86d1a7 Use centralized CompositeDisposable instead of custom Disposable
Also do not show any dialog if the user is aready removing watched videos in a local playlist
2020-04-23 23:35:00 +02:00
TobiGr
5ba1df52e0 Add Achinese (ACE) to the language selector 2020-04-23 23:24:52 +02:00
TobiGr
04ab753b26 Merge pull request Android TV support #2806
Closes #2806
2020-04-23 22:33:20 +02:00
TobiGr
bc4a598a55 Merge remote-tracking branch 'Weblate/dev' into dev 2020-04-23 21:11:50 +02:00
TobiGr
651cdec9b5 Fix button ripples in VideoDetailFragment 2020-04-22 22:35:41 +02:00
Hosted Weblate
346f9fbacd Merge branch 'origin/dev' into Weblate. 2020-04-21 22:05:03 +02:00
Anxhelo Lushka
0f493ae808 Translated using Weblate (Albanian)
Currently translated at 100.0% (569 of 569 strings)
2020-04-21 22:05:03 +02:00
Igor Nedoboy
a07f143759 Translated using Weblate (Russian)
Currently translated at 100.0% (569 of 569 strings)
2020-04-21 22:05:00 +02:00
Stypox
0ec22c7a6e Fix pause button is not focused on player control activation 2020-04-21 09:25:09 +02:00
Grady Clark
73611004a0 Code cleanup, and best practices 2020-04-21 01:57:23 -05:00
Grady Clark
776ddddc83 fixed naming and formatting issues 2020-04-21 01:03:42 -05:00
Vincent Nagel
f60cce54ea rename setting to "YouTube restricted mode" 2020-04-20 21:47:32 -05:00
Vincent Nagel
63087a4311 renamed to "restricted mode" 2020-04-20 21:46:40 -05:00
Vincent Nagel
5a193d50f6 remove duplicate line 2020-04-20 21:45:32 -05:00
Vincent Nagel
08a6e999b9 fix checkstyle errors 2020-04-20 21:45:32 -05:00
Vincent Nagel
e33cdca1ef added logging when context null in onPrefTreeClick 2020-04-20 21:45:32 -05:00
Vincent Nagel
9ede7a3c42 setupTabs() if ageRestrictedContent pref changed 2020-04-20 21:45:32 -05:00
Vincent Nagel
430d4e1ccd ageRestrictedContent cookie only sent for youtube
Now the age restricted content cookie is only sent when sending a
request to youtube. There's no need to remove the cookie when the
service changes because whether to add the cookie is determined by
looking at the url the request is being sent to.
2020-04-20 21:45:32 -05:00
Vincent Nagel
de4d6037d3 ageRestrictedContent first draft
Cookie updated whenever ageRestrictedContent setting is changed or
service is changed. Right now there is only a cookie for youtube, but
cookies for other services could be added in the future.

Problems with this approach: Even when the service is set to youtube,
the downloader doesn't only request youtube urls e.g. it also sends
reqeusts to i.ytimg.com, suggestqueries.google.com, and yt3.ggpht.com.
The ageRestrictedContent cookie is not normally sent when sending
requests to these other urls, so doing so might have unknown effects.
2020-04-20 21:45:32 -05:00
Tobias Groza
fc1fc6842b Merge pull request #3464 from wb9688/checkstyle-debug-only
Run Checkstyle only on debug builds
2020-04-20 20:22:12 +02:00
wb9688
0649b297f6 Run Checkstyle only on debug builds 2020-04-20 17:01:36 +02:00
Hosted Weblate
9a470b9d41 Merge branch 'origin/dev' into Weblate. 2020-04-20 14:46:28 +02:00
MohammedSR Vevo
47d1ab356d Translated using Weblate (Kurdish)
Currently translated at 99.8% (568 of 569 strings)
2020-04-20 14:46:27 +02:00
WaldiS
1ea5787486 Translated using Weblate (Polish)
Currently translated at 100.0% (569 of 569 strings)
2020-04-20 14:46:27 +02:00
thami simo
1d4695c109 Translated using Weblate (Arabic)
Currently translated at 100.0% (569 of 569 strings)
2020-04-20 14:46:27 +02:00
Gontzal Manuel Pujana Onaindia
b673f9dd7f Translated using Weblate (Basque)
Currently translated at 100.0% (569 of 569 strings)
2020-04-20 14:46:27 +02:00
Bruno Guerreiro
a1dd03472f Translated using Weblate (Portuguese)
Currently translated at 100.0% (569 of 569 strings)
2020-04-20 14:46:26 +02:00
Anxhelo Lushka
497e545024 Translated using Weblate (Albanian)
Currently translated at 100.0% (569 of 569 strings)
2020-04-20 14:46:22 +02:00
wb9688
6892fdb70b Merge pull request #3463 from B0pol/json
use nanojson instead of org.json
2020-04-20 14:02:36 +02:00
wb9688
aa1cc32d17 Open comment author on TV at long press 2020-04-20 13:37:35 +02:00
bopol
b22398ae6c use nanojson instead of org.json 2020-04-20 11:02:45 +02:00
Stypox
e6eddaff73 Merge pull request #3460 from wb9688/force-utf-8
Force UTF-8 encoding for Gradle
2020-04-20 10:18:56 +02:00
Tobias Groza
cd53518897 Merge pull request #3345 from mitosagi/error-with-bookmarks
Fix repeated exceptions in Bookmarked Playlists
2020-04-19 22:00:31 +02:00
wb9688
8e9b1b7213 Merge pull request #3414 from Stypox/recaptcha
Fix ReCaptcha Activity for another type of recaptcha page
2020-04-19 19:49:01 +02:00
wb9688
7a88fae2e2 Force UTF-8 encoding for Gradle 2020-04-19 19:33:46 +02:00
Tobias Groza
f066da23c5 Merge pull request #3456 from Stypox/enqueue-channel
Enqueue on long click on background/popup in channel
2020-04-19 11:41:12 +02:00
Stypox
34aa3d3e00 Enqueue on long click on background/popup in channel 2020-04-19 10:34:07 +02:00
Hosted Weblate
715119fd45 Merge branch 'origin/dev' into Weblate. 2020-04-16 21:55:01 +02:00
Allan Nordhøy
bde34fc4c4 Translated using Weblate (Norwegian Bokmål)
Currently translated at 90.6% (516 of 569 strings)
2020-04-16 21:55:00 +02:00
MohammedSR Vevo
07b4aa89d4 Translated using Weblate (Kurdish)
Currently translated at 99.4% (566 of 569 strings)
2020-04-16 21:54:59 +02:00
Isak Holmström
d60351114c Translated using Weblate (Swedish)
Currently translated at 83.1% (473 of 569 strings)
2020-04-16 21:54:59 +02:00
Yaron Shahrabani
c932a70bef Translated using Weblate (Hebrew)
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:58 +02:00
Jeff Huang
4641d7ee8c Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:58 +02:00
Xiang Xu
d4b3ee50f2 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:58 +02:00
Samuel Carvalho de Araújo
5392daa3ff Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:57 +02:00
Mostafa Ahangarha
a70e366fb4 Translated using Weblate (Persian)
Currently translated at 85.2% (485 of 569 strings)
2020-04-16 21:54:56 +02:00
Oğuz Ersen
dff14268db Translated using Weblate (Turkish)
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:55 +02:00
zmni
5517e157ad Translated using Weblate (Indonesian)
Currently translated at 98.9% (563 of 569 strings)
2020-04-16 21:54:54 +02:00
anonymous
bdf4ffc36b Translated using Weblate (Arabic)
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:54 +02:00
Vojtěch Šamla
71455c63c1 Translated using Weblate (Czech)
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:54 +02:00
Aaron Feng
b1ae2b1a41 Translated using Weblate (Chinese (Traditional, Hong Kong))
Currently translated at 30.0% (171 of 569 strings)
2020-04-16 21:54:53 +02:00
Jeannette L
8a31732ce2 Translated using Weblate (Italian)
Currently translated at 99.8% (568 of 569 strings)
2020-04-16 21:54:53 +02:00
AioiLight
e79aed7792 Translated using Weblate (Japanese)
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:52 +02:00
B0pol
973fc08f2d Translated using Weblate (French)
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:52 +02:00
JoC
00211e1fb2 Translated using Weblate (Spanish)
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:52 +02:00
C. Rüdinger
ce7286a72a Translated using Weblate (German)
Currently translated at 100.0% (569 of 569 strings)
2020-04-16 21:54:51 +02:00
Grady Clark
db335d5cec Removed redundant code
reorganized code
2020-04-16 12:58:16 -05:00
Stypox
ee5ce0c809 Save and restore cookies to/from preferences
So that the user does not have to solve a recaptcha every time he opens the app
2020-04-15 13:30:27 +02:00
Stypox
b8efef7c7a Remove duplicate check if cookies are already present 2020-04-15 13:30:27 +02:00
Stypox
e2cbf40957 Fix recaptcha activity for another type of recaptcha page
Try to get cookies from pages even when they start loading, because non-html pages like ones with `pbj=1` never stop loading.
Try to extract the cookie directly from the redirection url, by looking at the field "google_abuse=".
Add `GOOGLE_ABUSE_EXEMPTION=` to the youtube recaptcha cookies.
2020-04-15 13:30:27 +02:00
Stypox
d7d45fb8e2 Merge pull request #3415 from TeamNewPipe/fix/f-droid_build
Fix F-Droid build
2020-04-15 10:32:44 +02:00
TheLastGimbus
63afacc067 Add listeners in activity 2020-04-14 22:06:32 +02:00
TheLastGimbus
3175199787 Add fast-rewind/forward buttons in layout 2020-04-14 22:05:51 +02:00
Grady Clark
1d0c3de65f Merge branch 'dev' of https://github.com/TeamNewPipe/NewPipe into dev 2020-04-14 13:24:57 -05:00
Grady Clark
fe1646caa0 Changed "Remove Watched":
- Will now execute on the io thread
- Added confirmation dialog
  - Warning the user, and asking if they also want to remove partially watched videos
2020-04-14 13:15:07 -05:00
nautilusx
72710f075b Translated using Weblate (German)
Currently translated at 100.0% (569 of 569 strings)
2020-04-14 18:37:12 +02:00
Jeannette L
c7c01aedc2 Translated using Weblate (German)
Currently translated at 100.0% (569 of 569 strings)
2020-04-14 18:37:12 +02:00
C. Rüdinger
c2e2e76fd8 Translated using Weblate (German)
Currently translated at 100.0% (569 of 569 strings)
2020-04-14 18:37:11 +02:00
anonymous
f30a87e4e2 Translated using Weblate (German)
Currently translated at 100.0% (569 of 569 strings)
2020-04-14 18:37:11 +02:00
Igor Nedoboy
7a84cfd510 Translated using Weblate (Russian)
Currently translated at 100.0% (569 of 569 strings)
2020-04-14 10:43:22 +02:00
Jeannette L
7a5a773b07 Translated using Weblate (German)
Currently translated at 99.6% (567 of 569 strings)
2020-04-13 02:46:08 +02:00
Jeannette L
cf1488f6ce Translated using Weblate (German)
Currently translated at 99.6% (567 of 569 strings)
2020-04-13 02:43:01 +02:00
ce4
b02badba0c Translated using Weblate (German)
Currently translated at 98.7% (562 of 569 strings)
2020-04-13 02:40:54 +02:00
Jeannette L
772d84ea5a Translated using Weblate (German)
Currently translated at 99.6% (567 of 569 strings)
2020-04-13 02:40:30 +02:00
random r
ddaa66f080 Translated using Weblate (Italian)
Currently translated at 100.0% (569 of 569 strings)
2020-04-13 02:34:48 +02:00
Igor Nedoboy
8fd75833f0 Translated using Weblate (Russian)
Currently translated at 100.0% (569 of 569 strings)
2020-04-12 22:07:15 +02:00
Igor Nedoboy
1967d60813 Translated using Weblate (Russian)
Currently translated at 100.0% (569 of 569 strings)
2020-04-12 21:59:31 +02:00
Hosted Weblate
f38f265cf7 Merge branch 'origin/dev' into Weblate. 2020-04-12 16:45:50 +02:00
Isak Holmström
79f37ffee0 Translated using Weblate (Swedish)
Currently translated at 83.5% (468 of 560 strings)
2020-04-12 16:45:48 +02:00
Isak Holmström
d4b2a3c696 Translated using Weblate (Swedish)
Currently translated at 83.5% (468 of 560 strings)
2020-04-12 16:45:47 +02:00
Samuel Carvalho de Araújo
39ec365821 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (560 of 560 strings)
2020-04-12 16:45:46 +02:00
Tolstovka
bc423c471d Translated using Weblate (Ukrainian)
Currently translated at 93.3% (523 of 560 strings)
2020-04-12 16:45:44 +02:00
thami simo
a790f43566 Translated using Weblate (Arabic)
Currently translated at 100.0% (560 of 560 strings)
2020-04-12 16:45:43 +02:00
Gontzal Manuel Pujana Onaindia
9fbdc950d2 Translated using Weblate (Basque)
Currently translated at 100.0% (560 of 560 strings)
2020-04-12 16:45:41 +02:00
random r
8319963cbb Translated using Weblate (Italian)
Currently translated at 100.0% (560 of 560 strings)
2020-04-12 16:45:39 +02:00
Mitosagi
4341219497 Translated using Weblate (Japanese)
Currently translated at 100.0% (560 of 560 strings)
2020-04-12 16:45:39 +02:00
Igor Nedoboy
835504270d Translated using Weblate (Russian)
Currently translated at 100.0% (560 of 560 strings)
2020-04-12 16:45:38 +02:00
C. Rüdinger
daed42d208 Translated using Weblate (German)
Currently translated at 100.0% (560 of 560 strings)
2020-04-12 16:45:38 +02:00
Alexander--
850f51a156 When drawer opens, always place focus at it's start 2020-04-12 09:39:32 +06:59
TobiGr
d37b195708 Fix F-Droid build
Fixes the behaviour described in https://github.com/TeamNewPipe/NewPipe/pull/3265#issuecomment-612102349
2020-04-11 22:18:04 +02:00
Alexander--
54ceb85ebe Don't break navigation if player Views other than controls are focused 2020-04-11 16:04:38 +06:59
Alexander--
ef7a5bc753 Make channel info button focusable 2020-04-11 16:04:29 +06:59
wb9688
b7ef60eedd Merge pull request #3410 from wb9688/fix-restricted
Show error when video has age limit and setting is disabled
2020-04-11 09:44:25 +02:00
wb9688
70ede70ea8 Hide tabs when a video is age restricted 2020-04-11 09:30:12 +02:00
Alexander--
d1d942f3fd Fix Checkstyle violations in MediaSourceManager 2020-04-11 09:51:50 +06:59
Alexander--
53b3bda909 Comply with Checkstyle rules 2020-04-11 09:02:22 +06:59
Alexander--
ac5571a363 Merge remote-tracking branch 'newpipe/dev' into rebase 2020-04-11 08:30:40 +06:59
Alexander--
c42f5eca87 Merge remote-tracking branch 'newpipe/dev' into rebase 2020-04-11 08:24:05 +06:59
Tobias Groza
9cb6816b3c Merge pull request #3294 from mauriciocolli/fix-network-issues-detection
Fix detection of network related exceptions
2020-04-10 23:10:34 +02:00
Stypox
feab633e60 Merge pull request #3075 from harshlele/better-popup-resizing
Better popup resizing with pinch gestures
2020-04-10 22:26:59 +02:00
Stypox
a50e430cd9 Fix checkstyle issues and improve code formatting
Also calculate differently the moved distance of a pointer: use euclidean and not manhattan geometry
2020-04-10 22:12:45 +02:00
Harshal Lele
46918ee907 formatting changes 2020-04-10 22:10:32 +02:00
Harshal Lele
fe1889653e made formatting changes 2020-04-10 22:10:32 +02:00
Harshal Lele
9487b5367d changed popup resizing 2020-04-10 22:10:32 +02:00
Tobias Groza
6b47df75a7 Merge pull request #3412 from mauriciocolli/improve-drawer-title-size-handling
Improve size handling of the drawer header title
2020-04-10 22:04:53 +02:00
wb9688
bd9b2d54aa Merge pull request #3240 from wb9688/yt-music-search
YouTube Music search stuff
2020-04-10 19:04:49 +02:00
Mauricio Colli
506d1dc1f2 Improve size handling of the drawer header title
Some devices, specially with custom fonts that changed the font width,
weren't being correctly adjusted before.
2020-04-10 10:31:28 -03:00
wb9688
90f9819cbd Show error when video has age limit and setting is disabled 2020-04-10 15:29:48 +02:00
wb9688
9bbd03c14e Bump NewPipeExtractor version 2020-04-10 10:37:03 +02:00
wb9688
2852815e1a Use suggested layout for search filters 2020-04-10 10:35:54 +02:00
wb9688
41a100613f Add ability to translate YouTube Music search options 2020-04-10 10:35:54 +02:00
Stypox
63e489f134 Use ITEM_COUNT_UNKNOWN 2020-04-10 10:35:54 +02:00
Stypox
914d3c4a66 Use "mini" stream count alternatives for info items
Note: more_than_100_videos_mini and infinite_videos_mini are untranslatable
2020-04-10 10:35:54 +02:00
Stypox
2b47a1b06a Also use localizeStreamCount() in local items 2020-04-10 10:35:54 +02:00
Stypox
625419a7db Detect ITEM_COUNT_* in localizeStreamCount()
ITEM_COUNT_INFINITE and ITEM_COUNT_MORE_THAN_100.
Use localizeStreamCount in PlaylistFragment and PlaylistItemHolder
2020-04-10 10:35:54 +02:00
Stypox
2710d9de5b Add support for INFINITE_ and MORE_THAN_100_ITEMS in playlists 2020-04-10 10:35:53 +02:00
wb9688
e51314b104 Merge pull request #3300 from B0pol/content_not_supported
handle ContentNotSupportedException
2020-04-10 10:33:34 +02:00
bopol
4c128d837c handle ContentNotSupportedException for Channel Fragment (when an user has no video tab) 2020-04-10 09:12:29 +02:00
bopol
c392804f47 handle ContentNotSupportedException in ExtractorHelper.handleGeneralException() 2020-04-09 23:58:01 +02:00
bopol
cc7a25d9ce handle ContentNotSupportedException in BaseStateFragment
thus not supported soundcloud streams (e.g. hls streams) don't crash
anyore
2020-04-09 23:58:01 +02:00
wb9688
36b2bea25f Merge pull request #3395 from kapodamy/checkstyle-warnings
remove some warnings issued by checkstyle
2020-04-09 21:08:53 +02:00
Mauricio Colli
913796ff0f Use exception utils in network error detection throughout the app 2020-04-09 13:22:24 -03:00
Mauricio Colli
a1b9892c77 Move exception utils to a separate class and add tests for it 2020-04-09 13:22:18 -03:00
wb9688
03de4b29ea Suppress remaining Checkstyle errors 2020-04-09 17:24:43 +02:00
Hosted Weblate
35a706f745 Merge branch 'origin/dev' into Weblate. 2020-04-09 08:58:43 +02:00
Tobias Groza
65cd9751d8 Merge pull request #3288 from XiangRongLin/save-playback
Save and restore playback parameters into/from preferences
2020-04-08 21:38:53 +02:00
kapodamy
ff9a1ebb1b checkstyle
* drop unused methods
* split blobs
* make no final parameters
2020-04-08 12:08:01 -03:00
Hosted Weblate
b5df000e9d Merge branch 'origin/dev' into Weblate. 2020-04-08 14:09:42 +02:00
Claudio Maradonna
655522a3e5 Translated using Weblate (Italian)
Currently translated at 99.6% (558 of 560 strings)
2020-04-08 14:09:40 +02:00
wb9688
e4a4af34c5 Merge pull request #3276 from lnjX/fix/the-the-typo
ThemeHelper: Fix 'the the' typo
2020-04-07 09:25:00 +02:00
wb9688
b047e562ca Merge branch 'dev' into fix/the-the-typo 2020-04-07 09:17:10 +02:00
Tobias Groza
1600233c48 Merge pull request #3374 from mauriciocolli/fix-sort-button-visibility
Fix visibility of group sort button in the subscriptions fragment
2020-04-07 09:15:59 +02:00
Hosted Weblate
55c8bcd0e3 Merge branch 'origin/dev' into Weblate. 2020-04-07 05:23:56 +02:00
Software In Interlingua
2d0dadbd34 Translated using Weblate (Interlingua)
Currently translated at 35.5% (199 of 560 strings)
2020-04-07 05:23:54 +02:00
Tajnymag
49879bc9db Translated using Weblate (Czech)
Currently translated at 100.0% (560 of 560 strings)
2020-04-07 05:23:53 +02:00
Tobias Groza
2c453c7691 Merge pull request #3357 from opusforlife2/improve-bug-report-template
Made the bug report template less daunting
2020-04-06 21:51:07 +02:00
Tobias Groza
5166c22ce9 Fix webalte badge and link in readme
Update releases badge URL to point to releases instead of GitHub repo page
See WeblateOrg/weblate#3668
2020-04-06 21:01:40 +02:00
Mauricio Colli
225b9e1b15 Fix visibility of group sort button in the subscriptions fragment 2020-04-05 16:57:28 -03:00
ssantos
7a9d2c9a74 Translated using Weblate (Portuguese)
Currently translated at 100.0% (560 of 560 strings)
2020-04-05 19:41:29 +02:00
Xiang Rong Lin
3855e488cb Save and restore playback parameters into/from preferences
Playback parameters are speed, pitch and skip silence.
Remove parameters being passed on as intent to the player, since the parameters can be restored from the preferences instead.

# Conflicts:
#	app/src/main/java/org/schabi/newpipe/player/BasePlayer.java
2020-04-05 17:46:49 +02:00
Hosted Weblate
ce75747887 Merge branch 'origin/dev' into Weblate. 2020-04-05 17:08:38 +02:00
Bruno Arruda
c462766cb8 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.8% (559 of 560 strings)
2020-04-05 17:08:38 +02:00
anonymous
bb905b70df Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.8% (559 of 560 strings)
2020-04-05 17:08:35 +02:00
wb9688
5c8b9f6b4c Merge pull request #3370 from mauriciocolli/avoid-upload-date-update
Avoid unnecessary changes to the upload date of saved streams
2020-04-05 16:36:39 +02:00
Mauricio Colli
c726639484 Avoid unnecessary changes to the upload date of saved streams
The upload date was being updated regardless if the new one had more
precision or not, this caused items on the feed to jump around when the
user opened one of them.

This changes it to only update when the existent upload date is null or
the new one has a higher precision (i.e. is not an approximation).
2020-04-05 10:57:54 -03:00
Mahyuddin
100c7b8360 Translated using Weblate (Acehnese)
Currently translated at 7.3% (41 of 560 strings)
2020-04-05 11:34:48 +02:00
WaldiS
5502df89bb Translated using Weblate (Polish)
Currently translated at 100.0% (560 of 560 strings)
2020-04-05 11:34:47 +02:00
mitosagi
4491b66872 Make null sortable 2020-04-05 17:26:00 +09:00
Mahyuddin
9bc24728b4 Added translation using Weblate (Acehnese) 2020-04-05 09:47:16 +02:00
Hosted Weblate
a3a00ea052 Merge branch 'origin/dev' into Weblate. 2020-04-05 04:25:04 +02:00
Allan Nordhøy
1b1534add5 Translated using Weblate (Norwegian Bokmål)
Currently translated at 89.6% (502 of 560 strings)
2020-04-05 04:25:01 +02:00
Enol P
a54c8d4f55 Translated using Weblate (Asturian)
Currently translated at 51.9% (291 of 560 strings)
2020-04-05 04:25:01 +02:00
JoC
0cddd15203 Translated using Weblate (Spanish)
Currently translated at 100.0% (560 of 560 strings)
2020-04-05 04:25:00 +02:00
Tobias Groza
5653d443d9 Merge pull request #3344 from wb9688/checkfornewappversiontask-downloaderimpl
Use DownloaderImpl in CheckForNewAppVersionTask
2020-04-04 20:11:39 +02:00
wb9688
a5a497c4ea Clean up CheckForNewAppVersionTask 2020-04-04 19:34:13 +02:00
Hosted Weblate
d60feb466c Merge branch 'origin/dev' into Weblate. 2020-04-04 17:31:08 +02:00
Hemanta Sharma
a435167619 Translated using Weblate (Nepali)
Currently translated at 100.0% (560 of 560 strings)
2020-04-04 17:31:05 +02:00
Allan Nordhøy
99c823c763 Translated using Weblate (Norwegian Bokmål)
Currently translated at 89.1% (499 of 560 strings)
2020-04-04 17:31:04 +02:00
Jeff Huang
aebed13a40 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (560 of 560 strings)
2020-04-04 17:31:03 +02:00
AioiLight
1347bdd545 Translated using Weblate (Japanese)
Currently translated at 100.0% (560 of 560 strings)
2020-04-04 17:31:03 +02:00
AioiLight
562754c0b9 Merge branch 'dev' into blocking-gesture-when-touch-from-navbar 2020-04-04 23:52:06 +09:00
Tobias Groza
ec52e144e8 Merge pull request #3356 from B0pol/contributing.md
update contributing.md
2020-04-04 15:02:57 +02:00
Hosted Weblate
3e383a9f57 Merge branch 'origin/dev' into Weblate. 2020-04-04 14:23:24 +02:00
Hemanta Sharma
3a2444db0d Translated using Weblate (Nepali)
Currently translated at 100.0% (560 of 560 strings)
2020-04-04 14:23:21 +02:00
zeritti
14d01ae358 Translated using Weblate (Czech)
Currently translated at 100.0% (560 of 560 strings)
2020-04-04 14:23:19 +02:00
Éfrit
1f4b147ddd Translated using Weblate (French)
Currently translated at 100.0% (560 of 560 strings)
2020-04-04 14:23:19 +02:00
opusforlife2
12405f4059 Made the bug report template less daunting
The biggest problem was that the reporter needed to delete a lot of text to be able to give a clean report. Now most of that is comments.
2020-04-04 11:22:00 +00:00
B0pol
8d6965713c Update .github/CONTRIBUTING.md
Co-Authored-By: Tobias Groza <TobiGr@users.noreply.github.com>
2020-04-04 12:37:51 +02:00
bopol
fe2858bc75 update contributing.md 2020-04-04 12:14:32 +02:00
Tobias Groza
99dd6ae6aa Merge pull request #3349 from B0pol/update_changelog_0.19.2
mention view count added in 0.19.2 in changelog
2020-04-04 11:18:19 +02:00
Hosted Weblate
cb7ed4079f Merge branch 'origin/dev' into Weblate. 2020-04-04 09:17:37 +02:00
anonymous
89fbc055f4 Translated using Weblate (Nepali)
Currently translated at 99.8% (559 of 560 strings)
2020-04-04 09:17:35 +02:00
Hemanta Sharma
df12b838ad Translated using Weblate (Nepali)
Currently translated at 99.8% (559 of 560 strings)
2020-04-04 09:17:35 +02:00
Allan Nordhøy
055fa19c9b Translated using Weblate (Nepali)
Currently translated at 99.8% (559 of 560 strings)
2020-04-04 09:17:34 +02:00
Allan Nordhøy
d1b661506e Translated using Weblate (Norwegian Bokmål)
Currently translated at 88.9% (498 of 560 strings)
2020-04-04 09:17:33 +02:00
anonymous
180ddcceaa Translated using Weblate (Estonian)
Currently translated at 73.5% (412 of 560 strings)
2020-04-04 09:17:33 +02:00
Allan Nordhøy
512fad207b Translated using Weblate (Punjabi)
Currently translated at 80.3% (450 of 560 strings)
2020-04-04 09:17:33 +02:00
Allan Nordhøy
82d514d857 Translated using Weblate (Kurdish)
Currently translated at 99.4% (557 of 560 strings)
2020-04-04 09:17:32 +02:00
Allan Nordhøy
037fac7cd4 Translated using Weblate (Tamil)
Currently translated at 36.4% (204 of 560 strings)
2020-04-04 09:17:32 +02:00
Allan Nordhøy
ebad85664d Translated using Weblate (Telugu)
Currently translated at 24.4% (137 of 560 strings)
2020-04-04 09:17:32 +02:00
Allan Nordhøy
4b626c39fe Translated using Weblate (Persian)
Currently translated at 81.6% (457 of 560 strings)
2020-04-04 09:17:32 +02:00
Oğuz Ersen
81c539f150 Translated using Weblate (Turkish)
Currently translated at 100.0% (560 of 560 strings)
2020-04-04 09:17:31 +02:00
Emin Tufan Çetin
0e74d82777 Translated using Weblate (Turkish)
Currently translated at 100.0% (560 of 560 strings)
2020-04-04 09:17:31 +02:00
Allan Nordhøy
5ea34a3c07 Translated using Weblate (Slovak)
Currently translated at 93.9% (526 of 560 strings)
2020-04-04 09:17:31 +02:00
Igor Nedoboy
4f8c5c3c0a Translated using Weblate (Russian)
Currently translated at 100.0% (560 of 560 strings)
2020-04-04 09:17:30 +02:00
opusforlife2
37e45e0984 Translated using Weblate (English)
Currently translated at 99.8% (559 of 560 strings)
2020-04-04 09:17:30 +02:00
bopol
5683ad6666 mention view count added in 0.19.2 in changelog 2020-04-03 23:34:16 +02:00
Stypox
92ca1e6e09 Check if already running before removing watched 2020-04-03 20:41:21 +02:00
Stypox
6571fdbaa2 Fix checkstyle errors 2020-04-03 20:13:56 +02:00
Stypox
9c3f138b8e Use binary search to remove watched items from playlists 2020-04-03 19:51:29 +02:00
developer
0ac2865b74 Optimised 'removeWatchedStreams'
Removed merge mistake
Reordered code
Refactored 'removeWatchedWorker' to 'removeWatchedDisposable'
2020-04-03 19:50:12 +02:00
Grady Clark
98fc88dec6 Simplified the removal of watched videos, into the function removeWatchedStreams
Replaced unnecessary nested class.
Fixed formating issues
2020-04-03 19:49:41 +02:00
Grady Clark
8cab790030 - Will now use ReactiveX instead of AsyncTask, when removing watched videos.
- Removed redundant file 'local_playlist_control'
- Fixed grammer issue
2020-04-03 19:49:41 +02:00
Grady Clark
954399b255 Moved the 'Remove Watched' button to the three dot menu button. 2020-04-03 19:49:01 +02:00
Grady Clark
66c95f901d Added the ability to remove all watched videos from local playlists
Changes:
 - local_playlist_control.xml
   * A copy of playlist_control.xml
   * To hold the 'Remove Watched Videos' buttton

 - local_playlist_header.xml
   * Changed the include layout	to now include local_playlist_control.xml

 - strings.xml
   * added string 'remove_watched' with value 'Remove Watched'

 - LocalPlaylistFragment.java
   * Added the functionality to remove watched videos,
      to the 'Remove Watched Videos' button in local_playlist_control.xml.
      In the background via AsyncTask.
      This will also change the playlist's thumbnail, if the thumbnail video is removed.

Tested on:
 - Pixel
2020-04-03 19:47:31 +02:00
Tobias Groza
8265922d68 Merge pull request #3286 from opusforlife2/Update-Issue-and-PR-templates
Update Feature Request and PR templates
2020-04-03 19:04:04 +02:00
Tobias Groza
2403184845 Merge pull request #3282 from wb9688/checkstyle
Check code style with Checkstyle
2020-04-03 17:10:07 +02:00
wb9688
15a53d299d Revert some more changes 2020-04-03 15:48:38 +02:00
Hosted Weblate
24a1a5d680 Merge branch 'origin/dev' into Weblate. 2020-04-03 14:43:36 +02:00
Vojtěch Šamla
c1cfff1502 Translated using Weblate (Czech)
Currently translated at 100.0% (560 of 560 strings)
2020-04-03 14:43:33 +02:00
TobiGr
8b2599297b Release 0.19.2 (920) 2020-04-03 10:38:03 +02:00
Igor Nedoboy
1ed387dd54 Translated using Weblate (Russian)
Currently translated at 100.0% (560 of 560 strings)
2020-04-03 04:39:52 +02:00
Igor Nedoboy
9c795895ba Translated using Weblate (Russian)
Currently translated at 100.0% (560 of 560 strings)
2020-04-03 02:13:55 +02:00
Alexander--
3c193dca58 Merge remote-tracking branch 'newpipe/dev' into rebase 2020-04-03 06:56:52 +06:59
Hosted Weblate
ce2a8fbfab Merge branch 'origin/dev' into Weblate. 2020-04-03 00:39:15 +02:00
Igor Nedoboy
4bbcf44351 Translated using Weblate (Russian)
Currently translated at 99.2% (556 of 560 strings)
2020-04-03 00:39:12 +02:00
TobiGr
a9a43538be Merge remote-tracking branch 'Weblate/dev' into dev 2020-04-02 23:37:14 +02:00
Igor Nedoboy
905e4f16e2 Translated using Weblate (Russian)
Currently translated at 98.0% (549 of 560 strings)
2020-04-02 23:24:25 +02:00
anonymous
008489361d Translated using Weblate (Russian)
Currently translated at 98.0% (549 of 560 strings)
2020-04-02 23:24:23 +02:00
Igor Nedoboy
dfa7fb53b2 Translated using Weblate (Russian)
Currently translated at 98.0% (549 of 560 strings)
2020-04-02 23:24:22 +02:00
Tobias Groza
dc6604bcda Merge pull request #3265 from TeamNewPipe/apk_base_name
Change APK base name depending on the branch name for debug builds
2020-04-02 23:18:18 +02:00
Igor Nedoboy
63194ff292 Translated using Weblate (Russian)
Currently translated at 97.3% (545 of 560 strings)
2020-04-02 23:16:56 +02:00
anonymous
53a727955f Translated using Weblate (Russian)
Currently translated at 97.3% (545 of 560 strings)
2020-04-02 23:16:54 +02:00
Igor Nedoboy
a8fca89045 Translated using Weblate (Russian)
Currently translated at 97.3% (545 of 560 strings)
2020-04-02 23:16:54 +02:00
anonymous
1eff727722 Translated using Weblate (Russian)
Currently translated at 95.5% (535 of 560 strings)
2020-04-02 22:46:22 +02:00
AioiLight
d9c6f7acb6 Block the gesture when touch it from NavigationBar or StatusBar. 2020-04-03 05:11:36 +09:00
TobiGr
faefe957b0 Change APK base name depending on the branch name for debug builds 2020-04-02 21:45:28 +02:00
Tobias Groza
2fb8467673 Merge pull request #3334 from mauriciocolli/improve-drawer-height-handling
Make the drawer layout adapt to any status bar size
2020-04-02 21:42:35 +02:00
zmni
401422deb3 Translated using Weblate (Indonesian)
Currently translated at 99.2% (556 of 560 strings)
2020-04-02 20:49:16 +02:00
AioiLight
b52ed8e4c9 Translated using Weblate (Japanese)
Currently translated at 100.0% (560 of 560 strings)
2020-04-02 20:49:16 +02:00
wb9688
41061d0289 Use DownloaderImpl in CheckForNewAppVersionTask 2020-04-02 20:13:05 +02:00
wb9688
fed9197d23 Disable TodoComment in checkstyle.xml 2020-04-02 19:43:38 +02:00
wb9688
282d3dbf8c Disable MissingSwitchDefault in checkstyle.xml 2020-04-02 16:48:58 +02:00
wb9688
b6c6dc7282 Use Checkstyle for org.schabi.newpipe.streams as well 2020-04-02 16:48:57 +02:00
Mauricio Colli
45194061b3 Make the drawer layout adapt to any status bar size
This improves the drawer specifically for phones that have a notch.
2020-04-02 11:05:19 -03:00
wb9688
55480c8290 Disable VisibilityModifier in checkstyle.xml 2020-04-02 15:57:50 +02:00
wb9688
63bcc04eff Move things back to its original place 2020-04-02 15:57:50 +02:00
wb9688
fda5405e48 Improve code style to be more consistent 2020-04-02 15:57:50 +02:00
wb9688
819e52cab3 Check code style with Checkstyle 2020-04-02 15:57:50 +02:00
Kik Ki
ea917c82b6 Translated using Weblate (Thai)
Currently translated at 49.6% (278 of 560 strings)
2020-04-02 10:51:35 +02:00
Xiang Xu
65d5303765 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (560 of 560 strings)
2020-04-02 10:51:35 +02:00
CE4
08d37a4bef Translated using Weblate (German)
Currently translated at 100.0% (560 of 560 strings)
2020-04-02 10:51:35 +02:00
Tobias Groza
da2b059802 Merge pull request #3325 from kapodamy/int-overflow-2-fixes
Integer overflow fixes in downloader
2020-04-01 22:29:39 +02:00
kapodamy
62d934dd8e fix integer overflows
* available() method in ChunkFileInputStream.java
* free "ahead space" calculation in CircularFileWriter.java
2020-04-01 15:30:33 -03:00
kapodamy
96086b7733 code cleanup 2020-04-01 15:30:32 -03:00
Tobias Groza
182fc104bb Merge pull request #3259 from mauriciocolli/improve-drawer-layout
Improvements for the drawer header layout
2020-04-01 18:47:53 +02:00
Tobias Groza
06a897fba0 Merge pull request #3322 from Stypox/fix-mute-button
Fix mute button causing crashes on API 19
2020-04-01 18:30:10 +02:00
Jeff Huang
ff4b13245c Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (560 of 560 strings)
2020-04-01 09:10:33 +02:00
Stypox
00a8906128 Fix mute button causing crashes on API 19
Using rootView.getContext() because getApplicationContext() didn't work (it was probably missing information about theme)
2020-04-01 09:08:03 +02:00
opusforlife2
8b73d2d39f Translated using Weblate (English)
Currently translated at 99.8% (559 of 560 strings)
2020-03-31 18:15:23 +02:00
Vojtěch Šamla
e976b3e43e Translated using Weblate (Czech)
Currently translated at 100.0% (560 of 560 strings)
2020-03-31 14:04:56 +02:00
Jakub Gajdoš
1585ca7c85 Translated using Weblate (Slovak)
Currently translated at 94.2% (528 of 560 strings)
2020-03-31 14:04:56 +02:00
TobiGr
f7697007e5 Merge branch 'master' into dev 2020-03-31 12:33:16 +02:00
TobiGr
ba151a8b83 Release 0.19.1 2020-03-31 00:24:13 +02:00
TobiGr
a5153f5375 Improve database migration SQL statement 2020-03-31 00:20:13 +02:00
Tobias Groza
4899f01d6e Merge pull request #3307 from mauriciocolli/hotfix-db-migration
Hotfix for the latest database migration
2020-03-30 23:37:13 +02:00
Mauricio Colli
e6b3107997 Add tests for database migration to version 3 handling null values 2020-03-30 15:50:47 -03:00
Mauricio Colli
053440c4a8 Fix handling of null values in database migration to version 3
Some values prior to this version could be null, this wasn't handled
properly before.
2020-03-30 15:50:46 -03:00
CaptainCrumble
249e9c0b52 Translated using Weblate (Portuguese)
Currently translated at 100.0% (560 of 560 strings)
2020-03-30 17:33:56 +02:00
ssantos
099d5570f4 Translated using Weblate (Portuguese)
Currently translated at 100.0% (560 of 560 strings)
2020-03-30 17:33:54 +02:00
Alexander--
6a84f433ea Merge remote-tracking branch 'newpipe/dev' into rebase 2020-03-30 16:54:51 +06:59
chr56
12bf409e10 Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (560 of 560 strings)
2020-03-30 00:51:52 +02:00
ssantos
a01f1e64fe Translated using Weblate (German)
Currently translated at 100.0% (560 of 560 strings)
2020-03-30 00:11:01 +02:00
Tobias Groza
5f549a8fc6 Merge pull request #3289 from B0pol/grid_moreinfo
add upload date on stream grid items
2020-03-29 23:49:39 +02:00
WaldiS
eb144af0b9 Translated using Weblate (Polish)
Currently translated at 100.0% (560 of 560 strings)
2020-03-28 17:09:30 +01:00
ssantos
0d020d3a54 Translated using Weblate (Portuguese)
Currently translated at 90.7% (508 of 560 strings)
2020-03-28 17:09:29 +01:00
Terry Louwers
e1042e326d Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-28 17:09:29 +01:00
anonymous
f085e7d362 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-28 17:09:29 +01:00
bopol
b995f39206 add upload date on stream grid items
fixes #3175
2020-03-28 14:19:57 +01:00
opusforlife2
713bf58c44 Add reminder to link Issues/PRs 2020-03-28 11:49:46 +00:00
opusforlife2
a7af21958f Make feature request template easier to fill out 2020-03-28 10:54:20 +00:00
opusforlife2
8fed3df681 Update PULL_REQUEST_TEMPLATE.md
Minor modifications
2020-03-28 09:58:43 +00:00
Terry Louwers
0be78b1204 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 10:50:58 +01:00
anonymous
0a67ecbc3a Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 10:50:56 +01:00
Terry Louwers
c57b4ee965 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 10:50:31 +01:00
anonymous
d4db7b3fc1 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 10:50:29 +01:00
Terry Louwers
e9db964a70 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 10:48:08 +01:00
anonymous
90c8a714fc Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 10:48:06 +01:00
Terry Louwers
d958c0c68a Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 10:48:05 +01:00
Terry Louwers
377d02ab1a Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 10:46:46 +01:00
anonymous
2c0ad89a07 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 10:46:42 +01:00
Terry Louwers
101a8adbc2 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 09:34:55 +01:00
anonymous
5009fa461c Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 09:34:53 +01:00
Terry Louwers
f48f6ae5df Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 09:32:53 +01:00
Terry Louwers
be504212d0 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 09:32:51 +01:00
anonymous
0f075137c9 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 09:32:50 +01:00
Terry Louwers
8714664e00 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:56:24 +01:00
anonymous
bfaf938543 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:56:21 +01:00
Terry Louwers
b605bc086c Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:43:37 +01:00
anonymous
e394b16335 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:43:34 +01:00
Terry Louwers
0457423498 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:29:41 +01:00
anonymous
91d30dbb83 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:29:38 +01:00
Terry Louwers
63642a4d3e Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:26:41 +01:00
anonymous
1b64900c14 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:26:38 +01:00
Terry Louwers
2660178658 Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:25:08 +01:00
anonymous
3a0271cd4d Translated using Weblate (Dutch)
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:25:05 +01:00
Terry Louwers
76e2a2f032 Translated using Weblate (Dutch)
Currently translated at 99.6% (558 of 560 strings)
2020-03-27 08:14:47 +01:00
anonymous
932de969f0 Translated using Weblate (Dutch)
Currently translated at 99.6% (558 of 560 strings)
2020-03-27 08:14:42 +01:00
Terry Louwers
9082ab6ff7 Translated using Weblate (Dutch)
Currently translated at 99.6% (558 of 560 strings)
2020-03-27 08:14:41 +01:00
Terry Louwers
2461173e26 Translated using Weblate (Dutch)
Currently translated at 99.1% (555 of 560 strings)
2020-03-27 08:10:59 +01:00
Terry Louwers
48c2f8b91b Translated using Weblate (Dutch)
Currently translated at 99.1% (555 of 560 strings)
2020-03-27 08:10:55 +01:00
anonymous
6766b25414 Translated using Weblate (Dutch)
Currently translated at 99.1% (555 of 560 strings)
2020-03-27 08:10:55 +01:00
Terry Louwers
aacaf1b3fe Translated using Weblate (Dutch)
Currently translated at 98.3% (551 of 560 strings)
2020-03-27 08:03:08 +01:00
Daniele Lira Mereb
4cc154cbe1 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (560 of 560 strings)
2020-03-27 08:03:08 +01:00
anonymous
ca030dd5ed Translated using Weblate (Dutch)
Currently translated at 98.3% (551 of 560 strings)
2020-03-27 08:03:04 +01:00
Terry Louwers
f000409a90 Translated using Weblate (Dutch)
Currently translated at 98.3% (551 of 560 strings)
2020-03-27 08:03:03 +01:00
Mauricio Colli
697f0659e2 Distribute the service indicator views in the drawer header layout
People have voted, and that was the chosen design.
2020-03-26 19:21:32 -03:00
Mauricio Colli
5169ef1f00 Remove unused drawer header views and resources 2020-03-26 19:21:31 -03:00
Mauricio Colli
10faa45182 Align and enable autosizing for the app name text view in drawer header
- Use a proper drop up/down arrow icon.
- Move selected service views for better visibility.
- Show the selected service icon next to its name.
- Add a subtle fade background to the service name/icon for better
readability.
2020-03-26 19:21:30 -03:00
Linus Jahn
edff3c35f2 ThemeHelper: Fix 'the the' typo 2020-03-26 01:50:32 +01:00
Alexander--
3a611adc11 Prevent NavigationMenuView from gobbling up focus 2020-03-15 12:04:49 +06:59
Alexander--
381b491845 Prevent foocus from escaping open navigation drawer
When contents of NewPipe navigation drawer change, NavigationMenuView
(which is actually a RecyclerView) removes and re-adds all its adapter
children, which leads to temporary loss of focus on currently focused drawer
child. This situation was not anticipated by developers of original
support library DrawerLayout: while NavigationMenuView itself is able
to keep focus from escaping via onRequestFocusInDescendants(),
the implementation of that method in DrawerLayout does not pass focus
to previously focused View. In fact it does not pass focus correctly at all
because the AOSP implementation of that method does not call addFocusables()
and simply focuses the first available VISIBLE View, without regard
to state of drawers.
2020-03-15 09:37:29 +06:59
Alexander--
6aca344bf7 Merge remote-tracking branch 'newpipe/dev' into rebase 2020-03-15 09:08:01 +06:59
Alexander--
512046e300 Fix navigating to action bar buttons on API 28
Keyboard focus clusters prevent that from working, so
we simply remove all focus clusters.

While they are generally a good idea, focus clusters were created
with Chrome OS and it's keyboard-driven interface in mind - there is no
documented way to move focus between clusters using only IR remote.
As such, there are no negative consequences to disabling them on Android TV.
2020-03-14 14:47:02 +06:59
Alexander--
9cb3cf250c Intercept ActivityNotFoundException for ACTION_MANAGE_OVERLAY_PERMISSION 2020-03-12 05:32:20 +06:59
Alexander--
1cc5a67d82 Fix focus getting stuck by cycling within the same list item 2020-03-12 05:29:37 +06:59
Alexander--
fa6823599a Merge remote-tracking branch 'newpipe/dev' into rebase 2020-03-12 04:48:37 +06:59
Avently
398cbe9284 Better backstack, better tablet support, switching players confirmation, fix for background playback 2020-03-10 12:06:38 +03:00
Avently
d87e488c23 Fix for a ripple effect on a button 2020-02-29 22:13:07 +03:00
Avently
5c2ff9b777 Better implementation of old code 2020-02-29 02:57:54 +03:00
Alexander--
6a3a72eb06 NewPipeRecyclerView should allow scrolling down by default 2020-02-26 06:40:46 +06:59
Alexander--
56544802e8 Merge remote-tracking branch 'newpipe/dev' into rebase 2020-02-26 05:56:09 +06:59
Avently
6d7e37610c Vertical videos in portrait & fullscreen, UI enhancements for tablets and phones, fixes
- vertical videos now work ok in portrait and fullscreen mode at the same time
- auto pause on back press is disabled for large tablets
- large dragable area for swipe to bottom in fullscreen mode in place of top controls
- appbar will be scrolled to top when entering in fullscreen mode
2020-02-25 02:15:22 +03:00
Avently
a47e6dd8c5 AppBarLayout scrolling awesomeness, PlayQueue layout touches interception, player's controls' margin
- made scrolling in appBarLayout awesome
- PlayQueue layout was intercepting touches while it was in GONE visibility state. Now it's not gonna happen
- removed margin between two lines of player's controls
- when a user leaves the app with two back presses the app will not stop MainPlayer service if popup or background players play
2020-02-12 22:33:23 +03:00
Alexander--
5bd0c701c7 Merge remote-tracking branch 'newpipe/dev' into rebase 2020-02-11 08:01:05 +06:59
Alexander--
50a2771d87 Merge remote-tracking branch 'newpipe/dev' into rebase 2020-02-07 07:39:40 +06:59
Alexander--
e6df041613 Merge remote-tracking branch 'newpipe/dev' into rebase 2020-02-06 02:44:08 +06:59
Avently
f334a2740f Mini player, ExpandableSurfaceView with ZOOM support, popup
- mini player's title, image and author information will be updated in many situations but the main idea is that the info will be the same as currently playing stream. If nothing played then you'll see the info about currently opened stream in fragment. When MainPlayer service stops the info updates too
- made ExpandableSurfaceView to replace AspectRatioFrameLayout. The reason for that is to make possible to use aspect ratio mode ZOOM. It's impossible to show a stream inside AspectRatioFrameLayout with ZOOM mode and to fit the video view to a screen space at the same time. Now the new view able to do that and to show vertical videos in a slightly wide space for them
- refactored some methods to make the code more understandable
- made fixes for player view for landscape-to-landscape orientation change
- added Java docs
- adapted swipe tracking inside bottom sheet
- fixed PlayQueue crashes on clearing
- paddings for popup player now as small as possible
2020-02-05 08:59:30 +03:00
Alexander--
caa1de8aff Rename FireTvUtils to AndroidTvUtils and isFireTv() to isTV()
Because those methods are no longer exclusive to Amazon devices
2020-01-29 03:16:33 +06:59
Alexander--
fac13fb8cb Merge remote-tracking branch 'newpipe/dev' into rebase 2020-01-29 03:10:16 +06:59
Avently
26e487c01a Hotfix 2020-01-26 07:33:52 +03:00
Avently
cc438fdb7b Player's elements positioning is better for tablet and in multiWindow mode
- status bar got a fix for situation when a phone vendor did not provide status bar height for landscape orientation
- popup will not be init'd twice
- also fixed some non-reproduceable bugs
2020-01-17 17:37:53 +03:00
Avently
92ff98d99a New logic for handling global orientation
- added a button to manually change an orientation of a video
- adapted UI for an automatic global orientation too
2020-01-16 14:20:22 +03:00
Avently
d1609cba90 Enhancements to background playback and media button handling 2020-01-15 21:32:29 +03:00
Avently
0c394b123c Another fix of VideoDetailFragment 2020-01-13 19:24:28 +03:00
Avently
421b8214cb Fixes of VideoDetailFragment 2020-01-10 17:32:05 +03:00
Avently
6fc91312d2 Changed default autoplay type to "Only on WiFi" 2020-01-09 19:27:10 +03:00
Avently
22bb129bd9 Autoplay enhancement and new button at the top left corner
- added a video close button to the top left corner
- autoplay will not work if stream plays in background or popup players
2020-01-09 18:28:06 +03:00
Avently
4c57893312 New features and fixes
- added autoplay options inside settings: always, only on wifi, never
- now statusbar will be shown in fullscreen mode
- playlists, channels can be autoplayed too (if enabled)
- changed title of background activity to Play queue
- fixed a crash
2020-01-08 19:16:50 +03:00
Avently
a2d5314cf7 Fourth block of fixes for review
- wrote more methods to PlayQueue. Now it supports internal history of played items with ability to play previous() item. Also it has equals() to check whether queues has the same content or not
- backstack in fragment is more powerful now with help of PlayQueue's history and able to work great with playlists' PlayQueue and SinglePlayQueue at the same time
- simplified logic inside fragment. Easy to understand. New PlayQueue will be added in backstack from only one place; less number of setInitialData() calls
- BasePlayer now able to check PlayQueue and compare it with currently playing. And if it is the same queue it tries to not init() it twice. It gives possibility to have a great backstack in fragment since the same queue will not be played from two different instances and will not be added to backstack twice  with duplicated history inside
- better support of Player.STATE_IDLE
- worked with layouts of player and made them better and more universal
- service will be stopped when activity finishes by a user decision
- fixed a problem related to ChannelPlayQueue and PlaylistPlayQueue in initial start of fragment
- fixed crash in popup
2020-01-06 13:39:01 +03:00
Avently
e063967734 Third block of fixes for review
- audio-only streams plays the same way as video streams
- fullscreen mode for tablet with controls on the right place
- hidden controls while swiping mini player down
- mini player works better
2020-01-03 19:19:14 +03:00
Avently
4519dd010d Second block of fixes for review
- hide/show controls with respect of SystemUI. In fullscreen mode controls will stay away from NavigationBar
- notification from running service will be hidden if a user disabled background playback
- fixed incorrect handling of a system method in API 19
- better MultiWindow support
2020-01-03 08:05:31 +03:00
Alexander--
55d2637214 Merge remote-tracking branch 'newpipe/dev' into rebase 2020-01-01 12:55:05 +06:59
Avently
bc2dc8d933 First block of fixes for review
- popup player click event changed to show/hide buttons
- queue panel WORKS. Finally
- removed theme overriding in fragment
- added scroll to top after stream selection
- adjusted padding/margin of buttons in player
- player will itself in fullscreen after user hides it in fullscreen mode and then expands it again while video still playing
2019-12-31 19:06:39 +03:00
Avently
fc9b63298c Optimizations and fixes of rare situations
- popup after orientation change had incorrect allowed bounds for swiping
- popup could cause a crash after many quick switches to main player and back
- better method of setting fullscreen/non-fullscreen layout using thumbnail view. Also fixed thumbnail height in fullscreen layout
- global settings observer didn't work when a user closed a service manually via notification because it checked for service existing
- app will now exits from fullscreen mode when the user switches players
- playQueuePanel has visibility "gone" by default (not "invisible") because "invisible" can cause problems
2019-12-31 05:07:07 +03:00
Avently
c45514b989 All players in one place
- main, background, popup players now connected via one service, one view, one fragment, one activity and one gesture listener
- playback position is synchronized between players. Easy to switch from one to another
- expandable player at the bottom of the screen with cool animation and additional features like long click to open channel of a video, play/pause/close buttons and swipe down to dismiss
- in-player integrated buttons for opening in browser, playing with Kodi, sharing a video
- better background playback that can be activated in settings. Allows to automatically switch to audio-only mode when going to background and then switching to video-mode when returning to the app.
2019-12-30 00:15:01 +03:00
Alexander--
8c9015b57b Remove commented code 2019-12-10 21:21:35 +06:59
Alexander--
a0cb96abff Merge remote-tracking branch 'newpipe/dev' into rebase 2019-12-10 21:20:26 +06:59
Alexander--
3f51114129 Improve usability of settings on TV devices
* Add focus overlay to SettingsActivity
* Make screen "Contents of Main Page" navigable from remote
2019-12-01 12:43:38 +06:59
Alexander--
29136d633a Intercept ActivityNotFoundException for ACTION_CAPTIONING_SETTINGS 2019-12-01 12:43:38 +06:59
Alexander--
20bff1389e Disable touchScreenBlocksFocus on AppBarLayout
For some inexplicable reason this attribute got
enabled by default on Android 9, which effectively
prevents details screen from working
2019-12-01 12:41:11 +06:59
Alexander--
106e538d08 Excpicitly disable touchscreen requirement 2019-12-01 12:41:11 +06:59
Alexander--
dc7ae3917e Leanback launcher support 2019-12-01 12:41:11 +06:59
Alexander--
c0fb96a911 Release seekbar on any confirmation key, not just DPAD_CENTER 2019-12-01 12:41:11 +06:59
Alexander--
a1e02f7704 Default to landscape orientation for Android TV 2019-12-01 12:41:11 +06:59
Alexander--
436c75ca6c Make comment pic explicitly non-focusable 2019-12-01 12:41:11 +06:59
Alexander--
7d75950624 Disable srolling down comment list while comments are loading
Prevents comment list from losing focus to some outside View
when user tries to scroll down after reaching "end"
2019-12-01 12:41:11 +06:59
Alexander--
5f051a9766 More fixes to comment focus handling 2019-12-01 12:41:11 +06:59
Alexander--
5716cf8cb2 Add hints for focus transition from description 2019-12-01 12:41:11 +06:59
Alexander--
7bb5cacb0d Special MovementMethod for video description
Video descriptions can be very long. Some of them are
basically walls of text with couple of lines at top or bottom.
They are also not scrolled within TextView itself, - instead
NewPipe expects user to scroll their containing ViewGroup.
This renders all builtin MovementMethod implementations useless.

This commit adds a new MovementMethod, that uses requestRectangleOnScreen
to intelligently re-position the TextView within it's scrollable container.
2019-12-01 12:41:11 +06:59
Alexander--
9801cf50e3 Save/restore focused item 2019-12-01 12:41:11 +06:59
Alexander--
b5558a8b78 Remove FixedGridLayoutManager 2019-12-01 12:41:11 +06:59
Alexander--
a7c31e6bcc RecyclerView scroll fixes
* Move all focus-related work arouns to NewPipeRecyclerView
* Try to pass focus within closer parents first
* Do small arrow scroll if there are not more focusables in move direction
2019-12-01 12:41:11 +06:59
Alexander
6e76610f30 Eliminate bunch of ExoPlayer warnings 2019-12-01 12:41:11 +06:59
Alexander
6da2b399e8 Allow comment links (if any) to gain focus 2019-12-01 12:41:11 +06:59
Alexander
79c962fc88 More robust focus search in SuperScrollLayoutManager
FocusFinder has glitches when some of target Views have different size.
Fortunately LayoutManager can redefine focus search strategy to override
the default behavior.
2019-12-01 12:41:11 +06:59
Alexander
28fb864ed0 Focus video view thumbnail after it is loaded 2019-12-01 12:41:11 +06:59
Alexander
d23227d427 Implement global focus highlight 2019-12-01 12:41:11 +06:59
Alexander
eb6d26b6a4 Focus drawer when it opens
It is still buggy because of NavigationView (why the hell
is NavigationMenuView marked as focusable?) but at least initial
opening works as intended
2019-12-01 12:41:10 +06:59
Alexander
a8a28294d3 Support for seeking videos in directional navigation mode 2019-12-01 12:41:10 +06:59
Alexander
7db1ba40eb Do not allow focus to escape from open DrawerLayout
Upstream DrawerLayout does override addFocusables, but
incorrectly checks for isDrawerOpen instread of isDrawerVisible
2019-12-01 12:41:10 +06:59
Alexander
d8bd8d87ec Make player screen controls into buttons
Buttons are more likely to have "correct" styling and are
focusable/clickable out of box
2019-12-01 12:41:10 +06:59
Alexander
d29e0aa1a7 Improve usability of MainVideoActivity with directional navigation
* Hide player controls when back is pressed (only on TV devices)
* Do not hide control after click unless in touch mode
* Show player controls on dpad usage
* Notably increase control hide timeout when not in touch mode
2019-12-01 12:41:10 +06:59
Alexander
644ad110c0 Make description focusable, so TV users can scroll it 2019-12-01 12:41:10 +06:59
Alexander
6791de5fc0 Do not discriminate against non-Amazon TV boxes 2019-12-01 12:41:10 +06:59
Alexander
1bb96ef405 When child of CoordinatorLayout wants focus, show it!
The same logic is present in RecyclerView, ScrollView etc.
Android really should default to this behavior for all Views
with isScrollContainer = true
2019-12-01 12:41:10 +06:59
Alexander
7dc4ccf144 MainPlayer: make title and subtitle non-focusable
Focus isn't needed for marquee, only selection
2019-12-01 12:41:10 +06:59
Alexander
2b39438eba Fix scrolling in main screen grid
GridLayoutManager is buggy - https://issuetracker.google.com/issues/37067220:
it randomly loses or incorrectly assigns focus when being scrolled via
direction-based navigation. This commit reimplements onFocusSearchFailed()
on top of scrollBy() to work around that problem.

Ordinary touch-based navigation should not be affected.
2019-12-01 12:41:10 +06:59
Alexander
8952e2b0cd Close DrawerLayout on back button press 2019-12-01 12:41:10 +06:59
Alexander
4806ac62ee Correctly move focus from toolbar search bar to dropdown
We don't hide MainFragment when search is show, so FocusFinder
sometimes gives focus to (obscured) main content
2019-12-01 12:41:10 +06:59
Alexander
eaa1179572 Fix scrolling comments list
AppBarLayout mostly gets it, but we still need to uphold our own part -
expanding it back after focus returns to it
2019-12-01 12:41:10 +06:59
1802 changed files with 48844 additions and 27793 deletions

View File

@@ -1,68 +1,46 @@
NewPipe contribution guidelines
===============================
PLEASE READ THESE GUIDELINES CAREFULLY BEFORE ANY CONTRIBUTION!
## Crash reporting
Do not report crashes in the GitHub issue tracker. NewPipe has an automated crash report system that will ask you to
send a report via e-mail when a crash occurs. This contains all the data we need for debugging, and allows you to even
add a comment to it. You'll see exactly what is sent, the system is 100% transparent.
Report crashes through the automated crash report system of NewPipe.
This way all the data needed for debugging is included in your bugreport for GitHub.
You'll see exactly what is sent, be able to add your comments, and then send it.
## Issue reporting/feature requests
* Search the [existing issues](https://github.com/TeamNewPipe/NewPipe/issues) first to make sure your issue/feature
hasn't been reported/requested before
* Check whether your issue/feature is already fixed/implemented
* Check if the issue still exists in the latest release/beta version
* If you are an Android/Java developer, you are always welcome to fix/implement an issue/a feature yourself. PRs welcome!
* We use English for development. Issues in other languages will be closed and ignored.
* Please only add *one* issue at a time. Do not put multiple issues into one thread.
* When reporting a bug please give us a context, and a description how to reproduce it.
* Issues that only contain a generated bug report, but no description might be closed.
* **Already reported**? Browse the [existing issues](https://github.com/TeamNewPipe/NewPipe/issues) to make sure your issue/feature hasn't been reported/requested.
* **Already fixed**? Check whether your issue/feature is already fixed/implemented.
* **Still relevant**? Check if the issue still exists in the latest release/beta version.
* **Can you fix it**? If you are an Android/Java developer, you are always welcome to fix an issue or implement a feature yourself. PRs welcome! See [Code contribution](#code-contribution) for more info.
* **Is it in English**? Issues in other languages will be ignored unless someone translates them.
* **Is it one issue**? Multiple issues require multiple reports, that can be linked to track their statuses.
* **The template**: Fill it out, everyone wins. Your issue has a chance of getting fixed.
## Bug Fixing
* If you want to help NewPipe to become free of bugs (this is our utopic goal for NewPipe), you can send us an email to
tnp@newpipe.schabi.org to let me know that you intend to help. We'll send you further instructions. You may, on request,
register at our [Sentry](https://sentry.schabi.org) instance (see section "Crash reporting" for more information.
## Translation
* NewPipe can be translated via [Weblate](https://hosted.weblate.org/projects/newpipe/strings/). You can log in there
with your GitHub account.
* NewPipe is translated via [Weblate](https://hosted.weblate.org/projects/newpipe/strings/). Log in there with your GitHub account, or register.
* Add the language you want to translate if it is not there already: see [How to add a new language](https://github.com/TeamNewPipe/NewPipe/wiki/How-to-add-a-new-language-to-NewPipe) in the wiki.
## Code contribution
* Stick to NewPipe's style conventions (well, just look the other code and then do it the same way :))
* Do not bring non-free software (e.g., binary blobs) into the project. Also, make sure you do not introduce Google
* If you want to help out with an existing bug report or feature request, leave a comment on that issue saying you want to try your hand at it.
* If there is no existing issue for what you want to work on, open a new one describing your changes. This gives the team and the community a chance to give feedback before you spend time on something that is already in development, should be done differently, or should be avoided completely.
* Stick to NewPipe's style conventions of [checkStyle](https://github.com/checkstyle/checkstyle). It runs each time you build the project.
* Do not bring non-free software (e.g. binary blobs) into the project. Make sure you do not introduce Google
libraries.
* Stick to [F-Droid contribution guidelines](https://f-droid.org/wiki/page/Inclusion_Policy)
* Make changes on a separate branch, not on the master branch. This is commonly known as *feature branch workflow*. You
may then send your changes as a pull request on GitHub. Patches to the email address mentioned in this document might
not be considered, GitHub is the primary platform. (This only affects you if you are a member of TeamNewPipe)
* When submitting changes, you confirm that your code is licensed under the terms of the
[GNU General Public License v3](https://www.gnu.org/licenses/gpl-3.0.html).
* 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!
* Stick to [F-Droid contribution guidelines](https://f-droid.org/wiki/page/Inclusion_Policy).
* Make changes on a separate branch with a meaningful name, not on the _master_ branch or the _dev_ branch. This is commonly known as *feature branch workflow*. You may then send your changes as a pull request (PR) on GitHub.
* Please test (compile and run) your code before submitting changes! Ideally, provide test feedback in the PR description. Untested code will **not** be merged!
* 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 must rebase the dev branch manually and resolve the problems on your own. You can find help [on the wiki](https://github.com/TeamNewPipe/NewPipe/wiki/How-to-merge-a-PR). That makes the maintainers' jobs way easier.
* Please show intention to maintain your features and code after you contribute a PR. Unmaintained code is a hassle for core developers. If you do not intend to maintain features you plan to contribute, please rethink your submission, or clearly state that in the PR description.
* Respond if someone requests changes or otherwise raises issues about your PRs.
* Send PRs that only cover one specific issue/solution/bug. Do not send PRs that are huge and consist of multiple independent solutions.
* 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 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.
* Send PR that only cover one specific issue/solution/bug. Do not send PRs that are huge and consists of multiple
independent solutions.
## Communication
* WE DO NOW HAVE A MAILING LIST: [newpipe@list.schabi.org](https://list.schabi.org/cgi-bin/mailman/listinfo/newpipe).
* There is an IRC channel on Freenode which is regularly visited by the core team and other developers:
[#newpipe](irc:irc.freenode.net/newpipe). [Click here for Webchat](https://webchat.freenode.net/?channels=newpipe)!
* If you want to get in touch with the core team or one of our other contributors you can send an email to
tnp(at)schabi.org. Please do not send issue reports, they will be ignored and remain unanswered! Use the GitHub issue
tracker described above!
* Feel free to post suggestions, changes, ideas etc. on GitHub, IRC or the mailing list!
* The [#newpipe](irc:irc.freenode.net/newpipe) channel on freenode has the core team and other developers in it. [Click here for webchat](https://webchat.freenode.net/?channels=newpipe)!
* You can also use a Matrix account to join the Newpipe channel at [#freenode_#newpipe:matrix.org](https://matrix.to/#/#freenode_#newpipe:matrix.org).
* Post suggestions, changes, ideas etc. on GitHub or IRC.

View File

@@ -7,38 +7,59 @@ assignees: ''
---
<!--
Oh no, a bug! It happens. Thanks for reporting an issue with NewPipe.
Use this template to notify us if you found a bug.
To make it easier for us to help you please enter detailed information below.
Please note, we only support the latest version of NewPipe and the master branch. Make sure you have that version installed. If you don't, upgrade & reproduce the problem before opening the issue. The release page (https://github.com/TeamNewPipe/NewPipe/releases/latest) is the go-to place to get this version. In order to check your app version, open the left drawer and click on "About".
P.S.: Our contribution guidelines might be a nice document to read before you fill out the report :) You can find it at https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md
Oh no, a bug! It happens. Thanks for reporting an issue with NewPipe. To make it easier for us to help you please enter detailed information in the template we have provided below. If a section isn't relevant, just delete it, though it would be helpful to still provide as much detail as possible.
-->
### Version
<!-- Which version are you using? -->
-
<!-- IF YOU DON'T FILL IN THE TEMPLATE PROPERLY, YOUR ISSUE IS LIABLE TO BE CLOSED. If you feel tired/lazy right now, open your issue some other time. We'll wait. -->
<!-- The comments between these brackets won't show up in the submitted issue (as you can see in the Preview). -->
### Checklist
<!-- The first box has been checked for you to show you how it is done. -->
- [x] I am using the latest version - x.xx.x <!-- Check https://github.com/TeamNewPipe/NewPipe/releases -->
- [ ] I checked, but didn't find any duplicates (open OR closed) of this issue in the repo. <!-- Seriously, check. O_O -->
- [ ] I have read the contribution guidelines given at https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md.
- [ ] This issue contains only one bug. I will open one issue for every bug report I want to file.
### Steps to reproduce the bug
<!-- If you can't reproduce it, please try to give as many details as possible on how you think you got to the bug. -->
Steps to reproduce the behavior:
<!--
1. Go to '...'
2. Press on '....'
3. Swipe down to '....'
-->
<!-- If you can't cause the bug to show up again reliably (and hence don't have a proper set of steps to give us), please still try to give as many details as possible on how you think you encountered the bug. -->
### Expected behavior
Tell us what you expected to happen.
### Actual behaviour
Tell us what happens instead.
<!-- Tell us what happens with the steps given above. -->
### Expected behavior
<!-- Tell us what you expect to happen. -->
### Screenshots/Screen recordings
<!-- If applicable, add screenshots or a screen recording to help explain your problem. GitHub supports uploading them directly in the issue text box. If your file is too big for Github to accept, feel free to paste a link from an image/video hoster here instead. -->
<!-- DON'T POST SCREENSHOTS OF THE ERROR PAGE. Use the buttons given on the error page to paste the error as text in the Logs section below. -->
### Screenshots/Screen records
If applicable, add screenshots or a screen recording to help explain your problem. GitHub should support uploading them directly in the issue field. If your file is too big, feel free to paste a link from an image/video hoster here instead.
### Logs
If your bug includes a crash, please head over to the [incredible bugreport to markdown converter](https://teamnewpipe.github.io/CrashReportToMarkdown/). Copy the result. Paste it here:
<!-- If your bug includes a crash (where you're shown the Error Report page with a bunch of info), tap on "Copy formatted report" at the bottom and paste it here: -->
<!-- That's right, here! -->
<!-- Please fill this out when you do not provide a log generate by NewPipe -->
### Device info
- Android version/Custom ROM version:
- Device model:

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: false

View File

@@ -5,24 +5,42 @@ labels: enhancement
assignees: ''
---
<!-- Hey. Our contribution guidelines (https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md) might be an appropriate
document to read before you fill out the request :) -->
#### Is your feature request related to a problem? Please describe it
A clear and concise description of what the problem is.
Example: *I want to do X, but there is no way to do it.*
<!-- IF YOU DON'T FILL IN THE TEMPLATE PROPERLY, YOUR ISSUE IS LIABLE TO BE CLOSED. If you feel tired/lazy right now, open your issue some other time. We'll wait. -->
#### Describe the solution you'd like
A clear and concise description of what you want to happen.
<!-- The comments between these brackets won't show up in the submitted issue (as you can see in the Preview). -->
### Checklist
<!-- The first box has been checked for you to show you how it is done. -->
- [x] I checked, but didn't find any duplicates (open OR closed) of this issue in the repo. <!-- Seriously, check. O_O -->
- [ ] I have read the contribution guidelines given at https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md.
- [ ] This issue contains only one feature request. I will open one issue for every feature I want to request.
#### Describe the feature you want
<!-- A clear and concise description of what you wish should happen.
Example: *I think it would be nice if you add feature Y which makes X possible.*
#### (Optional) Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Example: *I considered Z, but that didn't turn out to be a good idea because...*
Optionally, also describe alternatives you've considered.
Example: *Z is also a good alternative. Not as good as Y, but at least...* or *I considered Z, but that didn't turn out to be a good idea because...* -->
#### Is your feature request related to a problem? Please describe it
<!-- A clear and concise description of what the problem is. Maybe the developers and the community could brainstorm and come up with a better solution to your problem. If they exist, link to related Issues and/or PRs for developers to keep track easier.
Example: *I want to do X, but there is no way to do it.* -->
#### Additional context
Add any other context or screenshots about the feature request here.
Example: *Here's a photo of my cat!*
<!-- Add any other context, like screenshots, about the feature request here.
Example: *Here's a photo of my cat!* -->
#### How will you/everyone benefit from this feature?
Convince us! How does it change your NewPipe experience and/or your life?
<!-- Convince us! How does it change your NewPipe experience and/or your life?
The better this paragraph is, the more likely a developer will think about working on it.
Example: *This feature will help us colonize the galaxy! -->

View File

@@ -1,26 +1,28 @@
<!-- Hey there. Thank you so much for improving NewPipe. Please take a moment to fill out the following suggestion on how to structure this PR description. Having roughly the same layout helps everyone considerably :)-->
<!-- Hey there. Thank you so much for improving NewPipe, and filling out the details. Having roughly the same layout helps everyone considerably :)-->
#### What is it?
- [ ] Bug fix
- [ ] Feature
- [ ] Bugfix (user facing)
- [ ] Feature (user facing)
- [ ] Codebase improvement (dev facing)
- [ ] Meta improvement to the project (dev facing)
#### Long description of the changes in your PR
<!-- While bullet points are the norm in this section, feel free to write a text instead if you can't fit it in a list -->
#### Description of the changes in your PR
<!-- While bullet points are the norm in this section, feel free to write free-form text instead of a list -->
- record videos
- create clones
- take over the world
#### Fixes the following issue(s)
<!-- Also add reddit or other links which are relevant to your change. -->
<!-- Also add any other links relevant to your change. -->
-
#### Relies on the following changes
<!-- Delete this if it doesn't apply to you. -->
-
#### Testing apk
<!-- Ensure that you have your changes on a new branch which has a meaningful name. This name will be used as a suffix for the app ID to allow installing and testing multiple versions of NewPipe. Do NOT name your branches like "patch-0" and "feature-1". For example, if your PR implements a bug fix for comments, an appropriate branch name would be "commentfix". -->
#### APK testing
<!-- Use a new, meaningfully named branch. The name is used as a suffix for the app ID to allow installing and testing multiple versions of NewPipe, e.g. "commentfix", if your PR implements a bugfix for comments. (No names like "patch-0" and "feature-1".) -->
debug.zip
#### Agreement
- [ ] I carefully read the [contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md) and agree to them.
#### Due diligence
- [ ] I read the [contribution guidelines](https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md).

8
.gitignore vendored
View File

@@ -10,3 +10,11 @@
*~
.weblate
*.class
# vscode / eclipse files
*.classpath
*.project
*.settings
bin/
.vscode/
*.code-workspace

View File

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

144
README.ko.md Normal file
View File

@@ -0,0 +1,144 @@
<p align="center"><a href="https://newpipe.schabi.org"><img src="assets/new_pipe_icon_5.png" width="150"></a></p>
<h2 align="center"><b>NewPipe</b></h2>
<h4 align="center">A libre lightweight streaming frontend for Android.</h4>
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://f-droid.org/wiki/images/0/06/F-Droid-button_get-it-on.png"></a></p>
<p align="center">
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="GitHub release"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>
<a href="https://www.gnu.org/licenses/gpl-3.0" alt="License: GPLv3"><img src="https://img.shields.io/badge/License-GPL%20v3-blue.svg"></a>
<a href="https://travis-ci.org/TeamNewPipe/NewPipe" alt="Build Status"><img src="https://travis-ci.org/TeamNewPipe/NewPipe.svg"></a>
<a href="https://hosted.weblate.org/engage/newpipe/" alt="Translation Status"><img src="https://hosted.weblate.org/widgets/newpipe/-/svg-badge.svg"></a>
<a href="http://webchat.freenode.net/?channels=%23newpipe" alt="IRC channel: #newpipe"><img src="https://img.shields.io/badge/IRC%20chat-%23newpipe-brightgreen.svg"></a>
<a href="https://www.bountysource.com/teams/newpipe" alt="Bountysource bounties"><img src="https://img.shields.io/bountysource/team/newpipe/activity.svg?colorB=cd201f"></a>
</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="#updates">Updates</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/FAQ/">FAQ</a> &bull; <a href="https://newpipe.schabi.org/press/">Press</a></p>
<hr>
*Read this in other languages: [English](README.md), [한국어](README.ko.md).*
<b>경고: 이 버전은 베타 버전이므로, 버그가 발생할 수도 있습니다. 만약 버그가 발생하였다면, 우리의 GITHUB 저장소에서 ISSUE를 열람하여 주십시오.</b>
<b>NEWPIPE 또는 이것의 FORK을 구글 플레이스토어에 올리는 것은 그들의 이용약관을 위반합니다.</b>
## Screenshots
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_01.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_01.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_02.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_02.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_03.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_03.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_04.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_04.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_05.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_05.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_06.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_06.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_07.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_07.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_08.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_08.png)
[<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/shot_09.png" width=160>](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_09.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)
[<img src="fastlane/metadata/android/en-US/images/tenInchScreenshots/shot_11.png" width=405>](fastlane/metadata/android/en-US/images/tenInchScreenshots/shot_11.png)
[<img src="fastlane/metadata/android/en-US/images/tenInchScreenshots/shot_12.png" width=405>](fastlane/metadata/android/en-US/images/tenInchScreenshots/shot_12.png)
## Description
NewPipe는 어떤 구글 프레임워크 라이브러리나, 유튜브 API를 사용하지 않습니다. 웹사이트는 단지 필요한 정보를 가져오기 위해 구문 분석 됩니다. 따라서 이 앱은 구글 서비스의 설치 없이 기기에서 사용될 수 있습니다. 또한, 카피레프트 자유 소프트웨어인 NewPipe를 사용하기 위해 유튜브 계정이 필요하지 않습니다.
### Features
* 영상 검색
* 영상의 일반적인 정보 표시
* 유튜브 영상 보기
* 유튜브 영상 듣기
* 팝업 모드 (floating player)
* 영상 공유
* 영상 다운로드
* 음성만 다운로드
* Kodi에서 영상 열람
* 다음/관련된 영상 표시
* 특정 언어로 유튜브 검색
* 연령 제한 컨텐츠 시청/차단
* 채널에 대한 일반적인 정보 표시
* 채널 검색
* 채널에서 영상 시청
* Orbot/Tor 지원 (아직 직접적이지 않음)
* 1080p/2K/4K 지원
* 기록 보기
* 채널 구독
* 기록 검색
* 재생목록 검색/시청
* 추가된 재생목록 시청
* 영상 추가
* 지역 재생목록
* 자막
* 실시간 방송 지원
* 댓글 표시
### Supported Services
NewPipe는 여러가지 서비스를 지원합니다. 우리의 [문서](https://teamnewpipe.github.io/documentation/)는 새로운 서비스가 앱과 추출기에 어떻게 추가될 수 있는지에 대한 더 많은 정보를 제공합니다. 만약 새로운 서비스를 추가하고자 한다면, 우리에게 연락해 주시기 바랍니다. 현재 지원되는 서비스:
* YouTube
* SoundCloud \[beta\]
* media.ccc.de \[beta\]
* PeerTube instances \[beta\]
## Updates
NewPipe 코드의 변경이 있을 때(기능 추가 또는 버그 수정으로 인해), 결국 릴리즈가 발생할 것입니다. 이것들의 형식은 x.xx.x 입니다.
이 새로운 버전을 얻기 위해서, 당신은:
1. 직접 디버그 APK를 생성할 수 있습니다. 이 방법은 당신의 기기에서 새로운 기능을 얻을 수 있는 가장 빠른 방법이지만, 꽤 많이 복잡합니다.
따라서 우리는 다른 방법들 중 하나를 사용하는 것을 추천합니다.
2. 우리의 커스텀 저장소를 F-Droid에 추가하고 우리가 릴리즈를 게시하는 대로 저곳에서 릴리즈를 설치할 수 있습니다.
이에 대한 설명서는 이곳에서 확인할 수 있습니다: https://newpipe.schabi.org/FAQ/tutorials/install-add-fdroid-repo/
3. 우리가 릴리즈를 게시하는 대로 [Github Releases](https://github.com/TeamNewPipe/NewPipe/releases)에서 APK를 다운받고 이것을 설치할 수 있습니다.
4. F-Droid를 통해 업데이트 할 수 있습니다. F-Droid는 변화를 인식하고, 스스로 APK를 생성하고, 이것에 서명하고, 사용자들에서 업데이트를 전달해야만 하기 때문에,
이것은 업데이트를 받는 가장 느린 방법입니다.
우리는 대부분의 사용자에게 2번쨰 방법을 추천합니다. 방법 2 또는 3을 사용하여 설치된 APK는 서로 호환되지만, 방법 4를 사용하여 설치된 것들과는 호환되지 않습니다. 이것은 방법 2 또는 3에서는 같은 (우리의)서명 키가 사용되지만, 방법 4에서는 다른 (F-Droid의)서명 키가 사용되기 때문입니다. 방법 1을 사용하여 디버그 APK를 생성하는 것에서는 키가 완전히 제외됩니다. 서명 키는 사용자가 앱에 악의적인 업데이트를 설치하는 것에 대해 속지 않도록 보장하는 것을 도와줍니다.
한편, 만약 어떠한 이유(예. NewPipe의 핵심 기능이 손상되었고 F-Droid가 아직 업데이트를 가지지 않는 경우) 때문에 소스를 바꾸길 원한다면,
우리는 다음과 같은 절차를 따르는 것을 권장합니다:
1. 당신의 기록, 구독, 그리고 재생목록을 유지할 수 있도록 Settings > Content > Export Database 를 통해 데이터를 백업하십시오.
2. NewPipe를 삭제하십시오.
3. 새로운 소스에서 APK를 다운로드하고 이것을 설치하십시오.
4. Step 1의 Settings > Content > Export Database 을 통해 데이터를 불러오십시오.
## Contribution
당신이 아이디어, 번역, 디자인 변경, 코드 정리, 또는 정말 큰 코드 수정에 대한 의견이 있다면, 도움은 항상 환영합니다.
더 많이 수행될수록 더 많이 발전할 수 있습니다!
만약 참여하고 싶다면, 우리의 [컨트리뷰션 공지](.github/CONTRIBUTING.md)를 참고하십시오.
<a href="https://hosted.weblate.org/engage/newpipe/">
<img src="https://hosted.weblate.org/widgets/newpipe/-/287x66-grey.png" alt="Translation status" />
</a>
## Donate
만약 NewPipe가 마음에 들었다면, 우리는 기부에 대해 기꺼이 환영합니다. bitcoin을 보내거나, Bountysource 또는 Liberapay를 통해 기부할 수 있습니다. NewPipe에 기부하는 것에 대한 자세한 정보를 원한다면, 우리의 [웹사이트](https://newpipe.schabi.org/donate)를 방문하여 주십시오.
<table>
<tr>
<td><img src="https://bitcoin.org/img/icons/logotop.svg" alt="Bitcoin"></td>
<td><img src="assets/bitcoin_qr_code.png" alt="Bitcoin QR code" width="100px"></td>
<td><samp>16A9J59ahMRqkLSZjhYj33n9j3fMztFxnh</samp></td>
</tr>
<tr>
<td><a href="https://liberapay.com/TeamNewPipe/"><img src="https://upload.wikimedia.org/wikipedia/commons/2/27/Liberapay_logo_v2_white-on-yellow.svg" alt="Liberapay" width="80px" ></a></td>
<td><a href="https://liberapay.com/TeamNewPipe/"><img src="assets/liberapay_qr_code.png" alt="Visit NewPipe at liberapay.com" width="100px"></a></td>
<td><a href="https://liberapay.com/TeamNewPipe/donate"><img src="assets/liberapay_donate_button.svg" alt="Donate via Liberapay" height="35px"></a></td>
</tr>
<tr>
<td><a href="https://www.bountysource.com/teams/newpipe"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/22/Bountysource.png/320px-Bountysource.png" alt="Bountysource" width="190px"></a></td>
<td><a href="https://www.bountysource.com/teams/newpipe"><img src="assets/bountysource_qr_code.png" alt="Visit NewPipe at bountysource.com" width="100px"></a></td>
<td><a href="https://www.bountysource.com/teams/newpipe/issues"><img src="https://img.shields.io/bountysource/team/newpipe/activity.svg?colorB=cd201f" height="30px" alt="Check out how many bounties you can earn."></a></td>
</tr>
</table>
## Privacy Policy
NewPipe 프로젝트는 미디어 웹 서비스를 사용하는 것에 대한 사적의, 익명의 경험을 제공하는 것을 목표로 하고 있습니다.
그러므로, 앱은 당신의 동의 없이 어떤 데이터도 수집하지 않습니다. NewPipe의 개인정보보호정책은 당신이 충돌 리포트를 보내거나, 또는 우리의 블로그에 글을 남길 때 어떤 데이터가 보내지고 저장되는지에 대해 상세히 설명합니다. 이 문서는 [여기](https://newpipe.schabi.org/legal/privacy/)에서 확인할 수 있습니다.
## License
[![GNU GPLv3 Image](https://www.gnu.org/graphics/gplv3-127x51.png)](http://www.gnu.org/licenses/gpl-3.0.en.html)
NewPipe는 자유 소프트웨어입니다: 당신의 마음대로 이것을 사용하고, 연구하고, 공유하고, 개선할 수 있습니다.
구체적으로 당신은 자유 소프트웨어 재단에서 발행되는, 버전 3 또는 (당신의 선택에 따라)이후 버전의,
[GNU General Public License](https://www.gnu.org/licenses/gpl.html) 하에서 이것을 재배포 및/또는 수정할 수 있습니다.

View File

@@ -4,10 +4,10 @@
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://f-droid.org/wiki/images/0/06/F-Droid-button_get-it-on.png"></a></p>
<p align="center">
<a href="https://github.com/TeamNewPipe/NewPipe" alt="GitHub release"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="GitHub release"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>
<a href="https://www.gnu.org/licenses/gpl-3.0" alt="License: GPLv3"><img src="https://img.shields.io/badge/License-GPL%20v3-blue.svg"></a>
<a href="https://travis-ci.org/TeamNewPipe/NewPipe" alt="Build Status"><img src="https://travis-ci.org/TeamNewPipe/NewPipe.svg"></a>
<a href="https://hosted.weblate.org/engage/NewPipe/" alt="Translation Status"><img src="https://hosted.weblate.org/widgets/NewPipe/-/svg-badge.svg"></a>
<a href="https://hosted.weblate.org/engage/newpipe/" alt="Translation Status"><img src="https://hosted.weblate.org/widgets/newpipe/-/svg-badge.svg"></a>
<a href="http://webchat.freenode.net/?channels=%23newpipe" alt="IRC channel: #newpipe"><img src="https://img.shields.io/badge/IRC%20chat-%23newpipe-brightgreen.svg"></a>
<a href="https://www.bountysource.com/teams/newpipe" alt="Bountysource bounties"><img src="https://img.shields.io/bountysource/team/newpipe/activity.svg?colorB=cd201f"></a>
</p>
@@ -16,9 +16,11 @@
<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/FAQ/">FAQ</a> &bull; <a href="https://newpipe.schabi.org/press/">Press</a></p>
<hr>
*Read this in other languages: [English](README.md), [한국어](README.ko.md).*
<b>WARNING: THIS IS A BETA VERSION, THEREFORE YOU MAY ENCOUNTER BUGS. IF YOU DO, OPEN AN ISSUE VIA OUR GITHUB REPOSITORY.</b>
<b>PUTTING NEWPIPE OR ANY FORK OF IT INTO GOOGLE PLAYSTORE VIOLATES THEIR TERMS OF CONDITIONS.</b>
<b>PUTTING NEWPIPE OR ANY FORK OF IT INTO THE GOOGLE PLAY STORE VIOLATES THEIR TERMS AND CONDITIONS.</b>
## Screenshots
@@ -69,11 +71,6 @@ NewPipe does not use any Google framework libraries, nor the YouTube API. Websit
* Livestream support
* Show comments
### Coming Features
* Cast to UPnP and Cast
* … and many more
### Supported Services
NewPipe supports multiple services. Our [docs](https://teamnewpipe.github.io/documentation/) provide more info on how a new service can be added to the app and the extractor. Please get in touch with us if you intend to add a new one. Currently supported services are:
@@ -85,17 +82,18 @@ NewPipe supports multiple services. Our [docs](https://teamnewpipe.github.io/doc
## Updates
When a change to the NewPipe code occurs (due to either adding features or bug fixing), eventually a release will occur. These are in the format x.xx.x . In order to get this new version, you can:
* Build a debug APK yourself. This is the fastest way to get new features on your device, but is much more complicated, so we recommend using one of the other methods.
* Download the APK from [releases](https://github.com/TeamNewPipe/NewPipe/releases) and install it.
* Update via F-droid. This is the slowest method of getting updates, as F-Droid must recognize changes, build the APK itself, sign it, then push the update to users.
1. Build a debug APK yourself. This is the fastest way to get new features on your device, but is much more complicated, so we recommend using one of the other methods.
2. Add our custom repo to F-Droid and install it from there as soon as we publish a release. The instructions are here: https://newpipe.schabi.org/FAQ/tutorials/install-add-fdroid-repo/
3. Download the APK from [Github Releases](https://github.com/TeamNewPipe/NewPipe/releases) and install it as soon as we publish a release.
4. Update via F-droid. This is the slowest method of getting updates, as F-Droid must recognize changes, build the APK itself, sign it, then push the update to users.
When you install an APK from one of these options, it will be incompatible with an APK from one of the other options. This is due to different signing keys being used. Signing keys help ensure that a user isn't tricked into installing a malicious update to an app, and are independent. F-Droid and GitHub use different signing keys, and building an APK debug excludes a key. The signing key issue is being discussed in issue [#1981](https://github.com/TeamNewPipe/NewPipe/issues/1981), and may be fixed by setting up our own repository on F-Droid.
We recommend method 2 for most users. APKs installed using method 2 or 3 are compatible with each other, but not with those installed using method 4. This is due to the same signing key (ours) being used for 2 and 3, but a different signing key (F-Droid's) being used for 4. Building a debug APK using method 1 excludes a key entirely. Signing keys help ensure that a user isn't tricked into installing a malicious update to an app.
In the meanwhile, if you want to switch sources for some reason (e.g. NewPipe's core functionality was broken and F-Droid doesn't have the update yet), we recommend following this procedure:
1. Back up your data via "Settings>Content>Export Database" so you keep your history, subscriptions, and playlists
1. Back up your data via Settings > Content > Export Database so you keep your history, subscriptions, and playlists
2. Uninstall NewPipe
3. Download the APK from the new source and install it
4. Import the data from step 1 via "Settings>Content>Import Database"
4. Import the data from step 1 via Settings > Content > Import Database
## Contribution
Whether you have ideas, translations, design changes, code cleaning, or real heavy code changes, help is always welcome.
@@ -103,6 +101,10 @@ The more is done the better it gets!
If you'd like to get involved, check our [contribution notes](.github/CONTRIBUTING.md).
<a href="https://hosted.weblate.org/engage/newpipe/">
<img src="https://hosted.weblate.org/widgets/newpipe/-/287x66-grey.png" alt="Translation status" />
</a>
## Donate
If you like NewPipe we'd be happy about a donation. You can either send bitcoin or donate via Bountysource or Liberapay. For further info on donating to NewPipe, please visit our [website](https://newpipe.schabi.org/donate).

View File

@@ -2,18 +2,21 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'checkstyle'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileSdkVersion 29
buildToolsVersion '29.0.3'
defaultConfig {
applicationId "org.schabi.newpipe"
resValue "string", "app_name", "NewPipe"
minSdkVersion 19
targetSdkVersion 28
versionCode 900
versionName "0.19.0"
targetSdkVersion 29
versionCode 960
versionName "0.20.6"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
@@ -26,19 +29,12 @@ android {
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
multiDexEnabled true
debuggable true
// suffix the app id and the app name with git branch name
def workingBranch = getGitWorkingBranch()
def normalizedWorkingBranch = workingBranch.replaceAll("[^A-Za-z]+", "").toLowerCase()
def normalizedWorkingBranch = workingBranch.replaceFirst("^[^A-Za-z]+", "").replaceAll("[^0-9A-Za-z]+", "")
if (normalizedWorkingBranch.isEmpty() || workingBranch == "master" || workingBranch == "dev") {
// default values when branch name could not be determined or is master or dev
applicationIdSuffix ".debug"
@@ -46,8 +42,19 @@ android {
} else {
applicationIdSuffix ".debug." + normalizedWorkingBranch
resValue "string", "app_name", "NewPipe " + workingBranch
archivesBaseName = 'NewPipe_' + normalizedWorkingBranch
}
}
// Keep the release build type at the end of the list to override 'archivesBaseName' of
// debug build. This seems to be a Gradle bug, therefore
// TODO: update Gradle version
release {
minifyEnabled true
shrinkResources false // disabled to fix F-Droid's reproducible build
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
archivesBaseName = 'app'
}
}
lintOptions {
@@ -58,8 +65,16 @@ android {
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
encoding 'utf-8'
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
// Required and used only by groupie
@@ -73,81 +88,154 @@ android {
}
ext {
androidxLibVersion = '1.0.0'
exoPlayerLibVersion = '2.10.8'
roomDbLibVersion = '2.1.0'
leakCanaryLibVersion = '1.5.4' //1.6.1
okHttpLibVersion = '3.12.6'
icepickLibVersion = '3.2.0'
stethoLibVersion = '1.5.0'
markwonVersion = '4.2.1'
icepickVersion = '3.2.0'
checkstyleVersion = '8.37'
stethoVersion = '1.5.1'
leakCanaryVersion = '2.5'
exoPlayerVersion = '2.11.8'
androidxLifecycleVersion = '2.2.0'
androidxRoomVersion = '2.3.0-alpha03'
groupieVersion = '2.8.1'
markwonVersion = '4.6.0'
googleAutoServiceVersion = '1.0-rc7'
}
configurations {
checkstyle
ktlint
}
checkstyle {
configFile rootProject.file('checkstyle.xml')
ignoreFailures false
showViolations true
toolVersion = checkstyleVersion
}
task runCheckstyle(type: Checkstyle) {
source 'src'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
exclude 'main/java/us/shandian/giga/**'
classpath = configurations.checkstyle
showViolations true
reports {
xml.enabled true
html.enabled true
}
}
def outputDir = "${project.buildDir}/reports/ktlint/"
def inputFiles = project.fileTree(dir: "src", include: "**/*.kt")
task runKtlint(type: JavaExec) {
inputs.files(inputFiles)
outputs.dir(outputDir)
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt"
}
task formatKtlint(type: JavaExec) {
inputs.files(inputFiles)
outputs.dir(outputDir)
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}
afterEvaluate {
preDebugBuild.dependsOn formatKtlint, runCheckstyle, runKtlint
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation "android.arch.persistence.room:testing:1.1.1"
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude module: 'support-annotations'
})
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
implementation 'com.github.TeamNewPipe:NewPipeExtractor:69e0624e3'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0'
implementation "frankiesardo:icepick:${icepickVersion}"
kapt "frankiesardo:icepick-processor:${icepickVersion}"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "androidx.legacy:legacy-support-v4:${androidxLibVersion}"
implementation "com.google.android.material:material:${androidxLibVersion}"
implementation "androidx.recyclerview:recyclerview:${androidxLibVersion}"
implementation "androidx.legacy:legacy-preference-v14:${androidxLibVersion}"
implementation "androidx.cardview:cardview:${androidxLibVersion}"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}"
ktlint "com.pinterest:ktlint:0.39.0"
implementation 'com.xwray:groupie:2.7.0'
implementation 'com.xwray:groupie-kotlin-android-extensions:2.7.0'
debugImplementation "com.facebook.stetho:stetho:${stethoVersion}"
debugImplementation "com.facebook.stetho:stetho-okhttp3:${stethoVersion}"
implementation 'androidx.lifecycle:lifecycle-livedata:2.0.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
debugImplementation "com.squareup.leakcanary:leakcanary-android:${leakCanaryVersion}"
implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:${leakCanaryVersion}"
implementation "com.squareup.leakcanary:plumber-android:${leakCanaryVersion}"
// Originally in NewPipeExtractor
implementation 'com.grack:nanojson:1.1'
implementation 'org.jsoup:jsoup:1.9.2'
implementation "androidx.multidex:multidex:2.0.1"
implementation 'ch.acra:acra:4.9.2' //4.11
// NewPipe dependencies
// You can use a local version by uncommenting a few lines in settings.gradle
implementation 'com.github.TeamNewPipe:NewPipeExtractor:b3835bd616ab28b861c83dcefd56e1754c6d20be'
implementation "com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751"
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.nononsenseapps:filepicker:4.2.1'
implementation "org.jsoup:jsoup:1.13.1"
implementation "com.google.android.exoplayer:exoplayer:${exoPlayerLibVersion}"
implementation "com.google.android.exoplayer:extension-mediasession:${exoPlayerLibVersion}"
//noinspection GradleDependency --> do not update okhttp to keep supporting Android 4.4 users
implementation "com.squareup.okhttp3:okhttp:3.12.12"
debugImplementation "com.facebook.stetho:stetho:${stethoLibVersion}"
debugImplementation "com.facebook.stetho:stetho-urlconnection:${stethoLibVersion}"
debugImplementation 'androidx.multidex:multidex:2.0.1'
implementation "com.google.android.exoplayer:exoplayer:${exoPlayerVersion}"
implementation "com.google.android.exoplayer:extension-mediasession:${exoPlayerVersion}"
implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.3.Final'
implementation "com.google.android.material:material:1.2.1"
implementation "androidx.room:room-runtime:${roomDbLibVersion}"
implementation "androidx.room:room-rxjava2:${roomDbLibVersion}"
kapt "androidx.room:room-compiler:${roomDbLibVersion}"
compileOnly "com.google.auto.service:auto-service-annotations:${googleAutoServiceVersion}"
kapt "com.google.auto.service:auto-service:${googleAutoServiceVersion}"
implementation "frankiesardo:icepick:${icepickLibVersion}"
kapt "frankiesardo:icepick-processor:${icepickLibVersion}"
implementation "androidx.appcompat:appcompat:1.2.0"
implementation "androidx.preference:preference:1.1.1"
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
debugImplementation "com.squareup.leakcanary:leakcanary-android:${leakCanaryLibVersion}"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:${leakCanaryLibVersion}"
implementation "androidx.lifecycle:lifecycle-livedata:${androidxLifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-viewmodel:${androidxLifecycleVersion}"
implementation "com.squareup.okhttp3:okhttp:${okHttpLibVersion}"
debugImplementation "com.facebook.stetho:stetho-okhttp3:${stethoLibVersion}"
implementation "androidx.room:room-runtime:${androidxRoomVersion}"
implementation "androidx.room:room-rxjava3:${androidxRoomVersion}"
kapt "androidx.room:room-compiler:${androidxRoomVersion}"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation "com.xwray:groupie:${groupieVersion}"
implementation "com.xwray:groupie-kotlin-android-extensions:${groupieVersion}"
implementation "de.hdodenhof:circleimageview:3.1.0"
implementation "com.nostra13.universalimageloader:universal-image-loader:1.9.5"
implementation "io.noties.markwon:core:${markwonVersion}"
implementation "io.noties.markwon:linkify:${markwonVersion}"
implementation "com.nononsenseapps:filepicker:4.2.1"
implementation "ch.acra:acra-core:5.7.0"
implementation "io.reactivex.rxjava3:rxjava:3.0.7"
implementation "io.reactivex.rxjava3:rxandroid:3.0.0"
implementation "com.jakewharton.rxbinding4:rxbinding:4.0.0"
implementation "org.ocpsoft.prettytime:prettytime:4.0.6.Final"
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.mockito:mockito-core:3.6.0'
androidTestImplementation "androidx.test.ext:junit:1.1.2"
androidTestImplementation "androidx.room:room-testing:${androidxRoomVersion}"
androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0", {
exclude module: 'support-annotations'
}
}
static String getGitWorkingBranch() {
@@ -164,4 +252,4 @@ static String getGitWorkingBranch() {
// git was not found
return ""
}
}
}

View File

@@ -25,37 +25,76 @@ class AppDatabaseTest {
private const val DEFAULT_DURATION = 480L
private const val DEFAULT_UPLOADER_NAME = "Uploader Test"
private const val DEFAULT_THUMBNAIL = "https://example.com/example.jpg"
private const val DEFAULT_SECOND_SERVICE_ID = 0
private const val DEFAULT_SECOND_URL = "https://www.youtube.com/watch?v=ncQU6iBn5Fc"
}
@get:Rule val testHelper = MigrationTestHelper(InstrumentationRegistry.getInstrumentation(),
AppDatabase::class.java.canonicalName, FrameworkSQLiteOpenHelperFactory());
@get:Rule
val testHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
AppDatabase::class.java.canonicalName, FrameworkSQLiteOpenHelperFactory()
)
@Test
fun migrateDatabaseFrom2to3() {
val databaseInV2 = testHelper.createDatabase(AppDatabase.DATABASE_NAME, Migrations.DB_VER_2)
databaseInV2.run {
insert("streams", SQLiteDatabase.CONFLICT_FAIL, ContentValues().apply {
// put("uid", null)
put("service_id", DEFAULT_SERVICE_ID)
put("url", DEFAULT_URL)
put("title", DEFAULT_TITLE)
put("stream_type", DEFAULT_TYPE.name)
put("duration", DEFAULT_DURATION)
put("uploader", DEFAULT_UPLOADER_NAME)
put("thumbnail_url", DEFAULT_THUMBNAIL)
})
insert(
"streams", SQLiteDatabase.CONFLICT_FAIL,
ContentValues().apply {
// put("uid", null)
put("service_id", DEFAULT_SERVICE_ID)
put("url", DEFAULT_URL)
put("title", DEFAULT_TITLE)
put("stream_type", DEFAULT_TYPE.name)
put("duration", DEFAULT_DURATION)
put("uploader", DEFAULT_UPLOADER_NAME)
put("thumbnail_url", DEFAULT_THUMBNAIL)
}
)
insert(
"streams", SQLiteDatabase.CONFLICT_FAIL,
ContentValues().apply {
// put("uid", null)
put("service_id", DEFAULT_SECOND_SERVICE_ID)
put("url", DEFAULT_SECOND_URL)
// put("title", null)
// put("stream_type", null)
// put("duration", null)
// put("uploader", null)
// put("thumbnail_url", null)
}
)
insert(
"streams", SQLiteDatabase.CONFLICT_FAIL,
ContentValues().apply {
// put("uid", null)
put("service_id", DEFAULT_SERVICE_ID)
// put("url", null)
// put("title", null)
// put("stream_type", null)
// put("duration", null)
// put("uploader", null)
// put("thumbnail_url", null)
}
)
close()
}
testHelper.runMigrationsAndValidate(AppDatabase.DATABASE_NAME, Migrations.DB_VER_3,
true, Migrations.MIGRATION_2_3);
testHelper.runMigrationsAndValidate(
AppDatabase.DATABASE_NAME, Migrations.DB_VER_3,
true, Migrations.MIGRATION_2_3
)
val migratedDatabaseV3 = getMigratedDatabase()
val listFromDB = migratedDatabaseV3.streamDAO().all.blockingFirst()
assertEquals(1, listFromDB.size)
val streamFromMigratedDatabase = listFromDB.first()
// Only expect 2, the one with the null url will be ignored
assertEquals(2, listFromDB.size)
val streamFromMigratedDatabase = listFromDB[0]
assertEquals(DEFAULT_SERVICE_ID, streamFromMigratedDatabase.serviceId)
assertEquals(DEFAULT_URL, streamFromMigratedDatabase.url)
assertEquals(DEFAULT_TITLE, streamFromMigratedDatabase.title)
@@ -67,13 +106,29 @@ class AppDatabaseTest {
assertNull(streamFromMigratedDatabase.textualUploadDate)
assertNull(streamFromMigratedDatabase.uploadDate)
assertNull(streamFromMigratedDatabase.isUploadDateApproximation)
val secondStreamFromMigratedDatabase = listFromDB[1]
assertEquals(DEFAULT_SECOND_SERVICE_ID, secondStreamFromMigratedDatabase.serviceId)
assertEquals(DEFAULT_SECOND_URL, secondStreamFromMigratedDatabase.url)
assertEquals("", secondStreamFromMigratedDatabase.title)
// Should fallback to VIDEO_STREAM
assertEquals(StreamType.VIDEO_STREAM, secondStreamFromMigratedDatabase.streamType)
assertEquals(0, secondStreamFromMigratedDatabase.duration)
assertEquals("", secondStreamFromMigratedDatabase.uploader)
assertEquals("", secondStreamFromMigratedDatabase.thumbnailUrl)
assertNull(secondStreamFromMigratedDatabase.viewCount)
assertNull(secondStreamFromMigratedDatabase.textualUploadDate)
assertNull(secondStreamFromMigratedDatabase.uploadDate)
assertNull(secondStreamFromMigratedDatabase.isUploadDateApproximation)
}
private fun getMigratedDatabase(): AppDatabase {
val database: AppDatabase = Room.databaseBuilder(ApplicationProvider.getApplicationContext(),
AppDatabase::class.java, AppDatabase.DATABASE_NAME)
.build()
val database: AppDatabase = Room.databaseBuilder(
ApplicationProvider.getApplicationContext(),
AppDatabase::class.java, AppDatabase.DATABASE_NAME
)
.build()
testHelper.closeWhenFinished(database)
return database
}
}
}

View File

@@ -1,37 +1,38 @@
package org.schabi.newpipe.report;
import android.os.Parcel;
import androidx.test.filters.LargeTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.schabi.newpipe.R;
import org.schabi.newpipe.report.ErrorActivity.ErrorInfo;
import static org.junit.Assert.assertEquals;
/**
* Instrumented tests for {@link ErrorInfo}
* Instrumented tests for {@link ErrorInfo}.
*/
@RunWith(AndroidJUnit4.class)
@LargeTest
public class ErrorInfoTest {
@Test
public void errorInfo_testParcelable() {
ErrorInfo info = ErrorInfo.make(UserAction.USER_REPORT, "youtube", "request", R.string.general_error);
public void errorInfoTestParcelable() {
final ErrorInfo info = ErrorInfo.make(UserAction.USER_REPORT, "youtube", "request",
R.string.general_error);
// Obtain a Parcel object and write the parcelable object to it:
Parcel parcel = Parcel.obtain();
final Parcel parcel = Parcel.obtain();
info.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
ErrorInfo infoFromParcel = ErrorInfo.CREATOR.createFromParcel(parcel);
final ErrorInfo infoFromParcel = ErrorInfo.CREATOR.createFromParcel(parcel);
assertEquals(UserAction.USER_REPORT, infoFromParcel.userAction);
assertEquals("youtube", infoFromParcel.serviceName);
assertEquals("request", infoFromParcel.request);
assertEquals(R.string.general_error, infoFromParcel.message);
assertEquals(UserAction.USER_REPORT, infoFromParcel.getUserAction());
assertEquals("youtube", infoFromParcel.getServiceName());
assertEquals("request", infoFromParcel.getRequest());
assertEquals(R.string.general_error, infoFromParcel.getMessage());
parcel.recycle();
}
}
}

View File

@@ -1,104 +0,0 @@
package org.schabi.newpipe;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import androidx.annotation.NonNull;
import androidx.multidex.MultiDex;
import com.facebook.stetho.Stetho;
import com.facebook.stetho.okhttp3.StethoInterceptor;
import com.squareup.leakcanary.AndroidHeapDumper;
import com.squareup.leakcanary.DefaultLeakDirectoryProvider;
import com.squareup.leakcanary.HeapDumper;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.LeakDirectoryProvider;
import com.squareup.leakcanary.RefWatcher;
import org.schabi.newpipe.extractor.downloader.Downloader;
import java.io.File;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
public class DebugApp extends App {
private static final String TAG = DebugApp.class.toString();
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
@Override
public void onCreate() {
super.onCreate();
initStetho();
}
@Override
protected Downloader getDownloader() {
return DownloaderImpl.init(new OkHttpClient.Builder()
.addNetworkInterceptor(new StethoInterceptor()));
}
private void initStetho() {
// Create an InitializerBuilder
Stetho.InitializerBuilder initializerBuilder =
Stetho.newInitializerBuilder(this);
// Enable Chrome DevTools
initializerBuilder.enableWebKitInspector(
Stetho.defaultInspectorModulesProvider(this)
);
// Enable command line interface
initializerBuilder.enableDumpapp(
Stetho.defaultDumperPluginsProvider(getApplicationContext())
);
// Use the InitializerBuilder to generate an Initializer
Stetho.Initializer initializer = initializerBuilder.build();
// Initialize Stetho with the Initializer
Stetho.initialize(initializer);
}
@Override
protected boolean isDisposedRxExceptionsReported() {
return PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean(getString(R.string.allow_disposed_exceptions_key), false);
}
@Override
protected RefWatcher installLeakCanary() {
return LeakCanary.refWatcher(this)
.heapDumper(new ToggleableHeapDumper(this))
// give each object 10 seconds to be gc'ed, before leak canary gets nosy on it
.watchDelay(10, TimeUnit.SECONDS)
.buildAndInstall();
}
public static class ToggleableHeapDumper implements HeapDumper {
private final HeapDumper dumper;
private final SharedPreferences preferences;
private final String dumpingAllowanceKey;
ToggleableHeapDumper(@NonNull final Context context) {
LeakDirectoryProvider leakDirectoryProvider = new DefaultLeakDirectoryProvider(context);
this.dumper = new AndroidHeapDumper(context, leakDirectoryProvider);
this.preferences = PreferenceManager.getDefaultSharedPreferences(context);
this.dumpingAllowanceKey = context.getString(R.string.allow_heap_dumping_key);
}
private boolean isDumpingAllowed() {
return preferences.getBoolean(dumpingAllowanceKey, false);
}
@Override
public File dumpHeap() {
return isDumpingAllowed() ? dumper.dumpHeap() : HeapDumper.RETRY_LATER;
}
}
}

View File

@@ -0,0 +1,61 @@
package org.schabi.newpipe
import androidx.preference.PreferenceManager
import com.facebook.stetho.Stetho
import com.facebook.stetho.okhttp3.StethoInterceptor
import leakcanary.AppWatcher
import leakcanary.LeakCanary
import okhttp3.OkHttpClient
import org.schabi.newpipe.extractor.downloader.Downloader
class DebugApp : App() {
override fun onCreate() {
super.onCreate()
initStetho()
// Give each object 10 seconds to be GC'ed, before LeakCanary gets nosy on it
AppWatcher.config = AppWatcher.config.copy(watchDurationMillis = 10000)
LeakCanary.config = LeakCanary.config.copy(
dumpHeap = PreferenceManager
.getDefaultSharedPreferences(this).getBoolean(
getString(
R.string.allow_heap_dumping_key
),
false
)
)
}
override fun getDownloader(): Downloader {
val downloader = DownloaderImpl.init(
OkHttpClient.Builder()
.addNetworkInterceptor(StethoInterceptor())
)
setCookiesToDownloader(downloader)
return downloader
}
private fun initStetho() {
// Create an InitializerBuilder
val initializerBuilder = Stetho.newInitializerBuilder(this)
// Enable Chrome DevTools
initializerBuilder.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
// Enable command line interface
initializerBuilder.enableDumpapp(
Stetho.defaultDumperPluginsProvider(applicationContext)
)
// Use the InitializerBuilder to generate an Initializer
val initializer = initializerBuilder.build()
// Initialize Stetho with the Initializer
Stetho.initialize(initializer)
}
override fun isDisposedRxExceptionsReported(): Boolean {
return PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean(getString(R.string.allow_disposed_exceptions_key), false)
}
}

View File

@@ -0,0 +1,27 @@
package org.schabi.newpipe.settings;
import android.os.Bundle;
import androidx.annotation.Nullable;
import org.schabi.newpipe.R;
import leakcanary.LeakCanary;
public class DebugSettingsFragment extends BasePreferenceFragment {
@Override
public void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
findPreference(getString(R.string.show_memory_leaks_key))
.setOnPreferenceClickListener(preference -> {
startActivity(LeakCanary.INSTANCE.newLeakDisplayActivityIntent());
return true;
});
}
@Override
public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {
addPreferencesFromResource(R.xml.debug_settings);
}
}

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:key="general_preferences"
android:title="@string/settings">
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.VideoAudioSettingsFragment"
android:icon="?attr/ic_headset"
android:title="@string/settings_category_video_audio_title"
app:iconSpaceReserved="false" />
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.DownloadSettingsFragment"
android:icon="?attr/ic_file_download"
android:title="@string/settings_category_downloads_title"
app:iconSpaceReserved="false" />
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.AppearanceSettingsFragment"
android:icon="?attr/ic_palette"
android:title="@string/settings_category_appearance_title"
app:iconSpaceReserved="false" />
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.HistorySettingsFragment"
android:icon="?attr/ic_history"
android:title="@string/settings_category_history_title"
app:iconSpaceReserved="false" />
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.ContentSettingsFragment"
android:icon="?attr/ic_language"
android:title="@string/content"
app:iconSpaceReserved="false" />
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.NotificationSettingsFragment"
android:icon="?attr/ic_play_arrow"
android:title="@string/settings_category_notification_title"
app:iconSpaceReserved="false" />
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.UpdateSettingsFragment"
android:icon="?attr/ic_settings_update"
android:key="update_pref_screen_key"
android:title="@string/settings_category_updates_title"
app:iconSpaceReserved="false" />
<PreferenceScreen
android:fragment="org.schabi.newpipe.settings.DebugSettingsFragment"
android:icon="?attr/ic_bug_report"
android:key="@string/debug_pref_screen_key"
android:title="@string/settings_category_debug_title"
app:iconSpaceReserved="false" />
</PreferenceScreen>

View File

@@ -1,43 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.schabi.newpipe">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<application
android:name=".App"
android:allowBackup="true"
android:banner="@mipmap/newpipe_tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:logo="@mipmap/ic_launcher"
android:requestLegacyExternalStorage="true"
android:theme="@style/OpeningTheme"
android:resizeableActivity="true"
tools:ignore="AllowBackup">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="androidx.media.session.MediaButtonReceiver" >
<receiver android:name="androidx.media.session.MediaButtonReceiver">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
<service
android:name=".player.BackgroundPlayer"
android:exported="false">
android:name=".player.MainPlayer"
android:exported="false"
android:foregroundServiceType="mediaPlayback">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
@@ -45,36 +54,20 @@
<activity
android:name=".player.BackgroundPlayerActivity"
android:launchMode="singleTask"
android:label="@string/title_activity_background_player"/>
<activity
android:name=".player.PopupVideoPlayerActivity"
android:launchMode="singleTask"
android:label="@string/title_activity_popup_player"/>
<service
android:name=".player.PopupVideoPlayer"
android:exported="false"/>
<activity
android:name=".player.MainVideoPlayer"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/VideoPlayerTheme"/>
android:label="@string/title_activity_play_queue"
android:launchMode="singleTask" />
<activity
android:name=".settings.SettingsActivity"
android:label="@string/settings"/>
android:label="@string/settings" />
<activity
android:name=".about.AboutActivity"
android:label="@string/title_activity_about"/>
android:label="@string/title_activity_about" />
<service android:name=".local.subscription.services.SubscriptionsImportService"/>
<service android:name=".local.subscription.services.SubscriptionsExportService"/>
<service android:name=".local.feed.service.FeedLoadService"/>
<service android:name=".local.subscription.services.SubscriptionsImportService" />
<service android:name=".local.subscription.services.SubscriptionsExportService" />
<service android:name=".local.feed.service.FeedLoadService" />
<activity
android:name=".PanicResponderActivity"
@@ -82,25 +75,25 @@
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="info.guardianproject.panic.action.TRIGGER"/>
<action android:name="info.guardianproject.panic.action.TRIGGER" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ExitActivity"
android:label="@string/general_error"
android:theme="@android:style/Theme.NoDisplay"/>
<activity android:name=".report.ErrorActivity"/>
android:theme="@android:style/Theme.NoDisplay" />
<activity android:name=".report.ErrorActivity" />
<!-- giga get related -->
<activity
android:name=".download.DownloadActivity"
android:label="@string/app_name"
android:launchMode="singleTask"/>
android:launchMode="singleTask" />
<service android:name="us.shandian.giga.service.DownloadManagerService"/>
<service android:name="us.shandian.giga.service.DownloadManagerService" />
<activity
android:name=".util.FilePickerActivityHelper"
@@ -114,7 +107,7 @@
<activity
android:name=".ReCaptchaActivity"
android:label="@string/recaptcha"/>
android:label="@string/recaptcha" />
<provider
android:name="androidx.core.content.FileProvider"
@@ -123,7 +116,7 @@
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/nnf_provider_paths"/>
android:resource="@xml/nnf_provider_paths" />
</provider>
<activity
@@ -135,165 +128,202 @@
<!-- Youtube filter -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="youtube.com"/>
<data android:host="m.youtube.com"/>
<data android:host="www.youtube.com"/>
<data android:host="music.youtube.com"/>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="youtube.com" />
<data android:host="m.youtube.com" />
<data android:host="www.youtube.com" />
<data android:host="music.youtube.com" />
<!-- video prefix -->
<data android:pathPrefix="/v/"/>
<data android:pathPrefix="/embed/"/>
<data android:pathPrefix="/watch"/>
<data android:pathPrefix="/attribution_link"/>
<data android:pathPrefix="/v/" />
<data android:pathPrefix="/embed/" />
<data android:pathPrefix="/watch" />
<data android:pathPrefix="/attribution_link" />
<!-- channel prefix -->
<data android:pathPrefix="/channel/"/>
<data android:pathPrefix="/user/"/>
<data android:pathPrefix="/c/"/>
<data android:pathPrefix="/channel/" />
<data android:pathPrefix="/user/" />
<data android:pathPrefix="/c/" />
<!-- playlist prefix -->
<data android:pathPrefix="/playlist"/>
<data android:pathPrefix="/playlist" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="youtu.be"/>
<data android:pathPrefix="/"/>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="youtu.be" />
<data android:pathPrefix="/" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="www.youtube-nocookie.com"/>
<data android:pathPrefix="/embed/"/>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="www.youtube-nocookie.com" />
<data android:pathPrefix="/embed/" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="vnd.youtube"/>
<data android:scheme="vnd.youtube.launch"/>
<data android:scheme="vnd.youtube" />
<data android:scheme="vnd.youtube.launch" />
</intent-filter>
<!-- Hooktube filter -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="hooktube.com"/>
<data android:host="*.hooktube.com"/>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="hooktube.com" />
<data android:host="*.hooktube.com" />
<!-- video prefix -->
<data android:pathPrefix="/v/"/>
<data android:pathPrefix="/embed/"/>
<data android:pathPrefix="/watch"/>
<data android:pathPrefix="/v/" />
<data android:pathPrefix="/embed/" />
<data android:pathPrefix="/watch" />
<!-- channel prefix -->
<data android:pathPrefix="/channel/"/>
<data android:pathPrefix="/user/"/>
<data android:pathPrefix="/channel/" />
<data android:pathPrefix="/user/" />
</intent-filter>
<!-- Invidious filter -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="invidio.us"/>
<data android:host="dev.invidio.us"/>
<data android:host="www.invidio.us"/>
<data android:host="invidious.snopyta.org"/>
<data android:host="de.invidious.snopyta.org"/>
<data android:host="fi.invidious.snopyta.org"/>
<data android:host="vid.wxzm.sx"/>
<data android:host="invidious.kabi.tk"/>
<data android:host="invidiou.sh"/>
<data android:host="www.invidiou.sh"/>
<data android:host="no.invidiou.sh"/>
<data android:host="invidious.enkirton.net"/>
<data android:host="tube.poal.co"/>
<data android:host="invidious.13ad.de"/>
<data android:host="yt.elukerio.org"/>
<data android:pathPrefix="/"/>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="invidio.us" />
<data android:host="dev.invidio.us" />
<data android:host="www.invidio.us" />
<data android:host="invidious.snopyta.org" />
<data android:host="fi.invidious.snopyta.org" />
<data android:host="yewtu.be" />
<data android:host="invidious.ggc-project.de" />
<data android:host="yt.maisputain.ovh" />
<data android:host="invidious.13ad.de" />
<data android:host="invidious.toot.koeln" />
<data android:host="invidious.fdn.fr" />
<data android:host="watch.nettohikari.com" />
<data android:host="invidious.snwmds.net" />
<data android:host="invidious.snwmds.org" />
<data android:host="invidious.snwmds.com" />
<data android:host="invidious.sunsetravens.com" />
<data android:host="invidious.gachirangers.com" />
<data android:pathPrefix="/" />
</intent-filter>
<!-- Soundcloud filter -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="soundcloud.com"/>
<data android:host="m.soundcloud.com"/>
<data android:host="www.soundcloud.com"/>
<data android:pathPrefix="/"/>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="soundcloud.com" />
<data android:host="m.soundcloud.com" />
<data android:host="www.soundcloud.com" />
<data android:pathPrefix="/" />
</intent-filter>
<!-- Share filter -->
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<!-- MediaCCC filter -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="media.ccc.de"/>
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="media.ccc.de" />
<!-- video prefix -->
<data android:pathPrefix="/v/"/>
<data android:pathPrefix="/v/" />
<!-- channel prefix-->
<data android:pathPrefix="/c/"/>
<data android:pathPrefix="/b/"/>
<data android:pathPrefix="/c/" />
<data android:pathPrefix="/b/" />
</intent-filter>
<!-- PeerTube filter -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="framatube.org" />
<data android:host="media.assassinate-you.net" />
<data android:host="peertube.co.uk" />
<data android:host="peertube.cpy.re" />
<data android:host="peertube.mastodon.host" />
<data android:host="peertube.fr" />
<data android:host="tilvids.com" />
<data android:host="tube.privacytools.io" />
<data android:host="video.ploud.fr" />
<data android:host="video.lqdn.fr" />
<data android:host="skeptikon.fr" />
<data android:pathPrefix="/videos/" /> <!-- it contains playlists -->
<data android:pathPrefix="/accounts/" />
<data android:pathPrefix="/video-channels/" />
</intent-filter>
</activity>
<service
android:name=".RouterActivity$FetcherService"
android:exported="false"/>
android:exported="false" />
<!-- see https://github.com/TeamNewPipe/NewPipe/issues/3947 -->
<!-- Version < 3.0. DeX Mode and Screen Mirroring support -->
<meta-data android:name="com.samsung.android.keepalive.density" android:value="true"/>
<!-- Version >= 3.0. DeX Dual Mode support -->
<meta-data android:name="com.samsung.android.multidisplay.keep_process_alive" android:value="true"/>
</application>
</manifest>

View File

@@ -1,400 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GNU General Public License v2.0 - GNU Project - Free Software Foundation (FSF)</title>
<link rel="alternate" type="application/rdf+xml"
href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.rdf" />
</head>
<body>
<h3><a id="SEC1">GNU GENERAL PUBLIC LICENSE</a></h3>
<p>
Version 2, June 1991
</p>
<pre>
Copyright (C) 1989, 1991 Free Software Foundation, Inc.<br/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA<br/>
<br/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</pre>
<h3 id="preamble"><a id="SEC2">Preamble</a></h3>
<p>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
</p>
<p>
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
</p>
<p>
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
</p>
<p>
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
</p>
<p>
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
</p>
<p>
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
</p>
<p>
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
</p>
<p>
The precise terms and conditions for copying, distribution and
modification follow.
</p>
<h3 id="terms"><a id="SEC3">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a></h3>
<p id="section0">
<strong>0.</strong>
This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
</p>
<p>
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
</p>
<p id="section1">
<strong>1.</strong>
You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
</p>
<p>
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
</p>
<p id="section2">
<strong>2.</strong>
You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
</p>
<dl>
<dt></dt>
<dd>
<strong>a)</strong>
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
</dd>
<dt></dt>
<dd>
<strong>b)</strong>
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
</dd>
<dt></dt>
<dd>
<strong>c)</strong>
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
</dd>
</dl>
<p>
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
</p>
<p>
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
</p>
<p>
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
</p>
<p id="section3">
<strong>3.</strong>
You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
</p>
<!-- we use this doubled UL to get the sub-sections indented, -->
<!-- while making the bullets as unobvious as possible. -->
<dl>
<dt></dt>
<dd>
<strong>a)</strong>
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
</dd>
<dt></dt>
<dd>
<strong>b)</strong>
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
</dd>
<dt></dt>
<dd>
<strong>c)</strong>
Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
</dd>
</dl>
<p>
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major softwareComponents (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
</p>
<p>
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
</p>
<p id="section4">
<strong>4.</strong>
You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
</p>
<p id="section5">
<strong>5.</strong>
You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
</p>
<p id="section6">
<strong>6.</strong>
Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
</p>
<p id="section7">
<strong>7.</strong>
If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
</p>
<p>
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
</p>
<p>
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
</p>
<p>
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
</p>
<p id="section8">
<strong>8.</strong>
If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
</p>
<p id="section9">
<strong>9.</strong>
The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
</p>
<p>
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
</p>
<p id="section10">
<strong>10.</strong>
If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
</p>
<p id="section11"><strong>NO WARRANTY</strong></p>
<p>
<strong>11.</strong>
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
</p>
<p id="section12">
<strong>12.</strong>
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
</p>
</body></html>

View File

@@ -38,12 +38,15 @@ import java.util.ArrayList;
* This is a copy from {@link androidx.fragment.app.FragmentStatePagerAdapter}.
* <p>
* It includes a workaround to fix the menu visibility when the adapter is restored.
* </p>
* <p>
* When restoring the state of this adapter, all the fragments' menu visibility were set to false,
* effectively disabling the menu from the user until he switched pages or another event that triggered the
* menu to be visible again happened.
* effectively disabling the menu from the user until he switched pages or another event
* that triggered the menu to be visible again happened.
* </p>
* <p>
* <br><b>Check out the changes in:</b>
* <b>Check out the changes in:</b>
* </p>
* <ul>
* <li>{@link #saveState()}</li>
* <li>{@link #restoreState(Parcelable, ClassLoader)}</li>
@@ -83,13 +86,13 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
private final int mBehavior;
private FragmentTransaction mCurTransaction = null;
private ArrayList<Fragment.SavedState> mSavedState = new ArrayList<Fragment.SavedState>();
private ArrayList<Fragment> mFragments = new ArrayList<Fragment>();
private final ArrayList<Fragment.SavedState> mSavedState = new ArrayList<Fragment.SavedState>();
private final ArrayList<Fragment> mFragments = new ArrayList<Fragment>();
private Fragment mCurrentPrimaryItem = null;
/**
* Constructor for {@link FragmentStatePagerAdapterMenuWorkaround} that sets the fragment manager for the
* adapter. This is the equivalent of calling
* Constructor for {@link FragmentStatePagerAdapterMenuWorkaround}
* that sets the fragment manager for the adapter. This is the equivalent of calling
* {@link #FragmentStatePagerAdapterMenuWorkaround(FragmentManager, int)} and passing in
* {@link #BEHAVIOR_SET_USER_VISIBLE_HINT}.
*
@@ -101,7 +104,7 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
* {@link #BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT}
*/
@Deprecated
public FragmentStatePagerAdapterMenuWorkaround(@NonNull FragmentManager fm) {
public FragmentStatePagerAdapterMenuWorkaround(@NonNull final FragmentManager fm) {
this(fm, BEHAVIOR_SET_USER_VISIBLE_HINT);
}
@@ -117,20 +120,21 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
* @param fm fragment manager that will interact with this adapter
* @param behavior determines if only current fragments are in a resumed state
*/
public FragmentStatePagerAdapterMenuWorkaround(@NonNull FragmentManager fm,
@Behavior int behavior) {
public FragmentStatePagerAdapterMenuWorkaround(@NonNull final FragmentManager fm,
@Behavior final int behavior) {
mFragmentManager = fm;
mBehavior = behavior;
}
/**
* Return the Fragment associated with a specified position.
* @param position the position of the item you want
* @return the {@link Fragment} associated with a specified position
*/
@NonNull
public abstract Fragment getItem(int position);
@Override
public void startUpdate(@NonNull ViewGroup container) {
public void startUpdate(@NonNull final ViewGroup container) {
if (container.getId() == View.NO_ID) {
throw new IllegalStateException("ViewPager with adapter " + this
+ " requires a view id");
@@ -140,13 +144,13 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
@SuppressWarnings("deprecation")
@NonNull
@Override
public Object instantiateItem(@NonNull ViewGroup container, int position) {
public Object instantiateItem(@NonNull final ViewGroup container, final int position) {
// If we already have this item instantiated, there is nothing
// to do. This can happen when we are restoring the entire pager
// from its saved state, where the fragment manager has already
// taken care of restoring the fragments we previously had instantiated.
if (mFragments.size() > position) {
Fragment f = mFragments.get(position);
final Fragment f = mFragments.get(position);
if (f != null) {
return f;
}
@@ -156,10 +160,12 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
mCurTransaction = mFragmentManager.beginTransaction();
}
Fragment fragment = getItem(position);
if (DEBUG) Log.v(TAG, "Adding item #" + position + ": f=" + fragment);
final Fragment fragment = getItem(position);
if (DEBUG) {
Log.v(TAG, "Adding item #" + position + ": f=" + fragment);
}
if (mSavedState.size() > position) {
Fragment.SavedState fss = mSavedState.get(position);
final Fragment.SavedState fss = mSavedState.get(position);
if (fss != null) {
fragment.setInitialSavedState(fss);
}
@@ -183,14 +189,17 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
}
@Override
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
Fragment fragment = (Fragment) object;
public void destroyItem(@NonNull final ViewGroup container, final int position,
@NonNull final Object object) {
final Fragment fragment = (Fragment) object;
if (mCurTransaction == null) {
mCurTransaction = mFragmentManager.beginTransaction();
}
if (DEBUG) Log.v(TAG, "Removing item #" + position + ": f=" + object
+ " v=" + ((Fragment)object).getView());
if (DEBUG) {
Log.v(TAG, "Removing item #" + position + ": f=" + object
+ " v=" + ((Fragment) object).getView());
}
while (mSavedState.size() <= position) {
mSavedState.add(null);
}
@@ -206,8 +215,9 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
@Override
@SuppressWarnings({"ReferenceEquality", "deprecation"})
public void setPrimaryItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
Fragment fragment = (Fragment)object;
public void setPrimaryItem(@NonNull final ViewGroup container, final int position,
@NonNull final Object object) {
final Fragment fragment = (Fragment) object;
if (fragment != mCurrentPrimaryItem) {
if (mCurrentPrimaryItem != null) {
mCurrentPrimaryItem.setMenuVisibility(false);
@@ -235,7 +245,7 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
}
@Override
public void finishUpdate(@NonNull ViewGroup container) {
public void finishUpdate(@NonNull final ViewGroup container) {
if (mCurTransaction != null) {
mCurTransaction.commitNowAllowingStateLoss();
mCurTransaction = null;
@@ -243,12 +253,12 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
}
@Override
public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
return ((Fragment)object).getView() == view;
public boolean isViewFromObject(@NonNull final View view, @NonNull final Object object) {
return ((Fragment) object).getView() == view;
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
private final String SELECTED_FRAGMENT = "selected_fragment";
private final String selectedFragment = "selected_fragment";
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@Override
@@ -257,23 +267,23 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
Bundle state = null;
if (mSavedState.size() > 0) {
state = new Bundle();
Fragment.SavedState[] fss = new Fragment.SavedState[mSavedState.size()];
final Fragment.SavedState[] fss = new Fragment.SavedState[mSavedState.size()];
mSavedState.toArray(fss);
state.putParcelableArray("states", fss);
}
for (int i=0; i<mFragments.size(); i++) {
Fragment f = mFragments.get(i);
for (int i = 0; i < mFragments.size(); i++) {
final Fragment f = mFragments.get(i);
if (f != null && f.isAdded()) {
if (state == null) {
state = new Bundle();
}
String key = "f" + i;
final String key = "f" + i;
mFragmentManager.putFragment(state, key, f);
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Check if it's the same fragment instance
if (f == mCurrentPrimaryItem) {
state.putString(SELECTED_FRAGMENT, key);
state.putString(selectedFragment, key);
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
@@ -282,29 +292,30 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
}
@Override
public void restoreState(@Nullable Parcelable state, @Nullable ClassLoader loader) {
public void restoreState(@Nullable final Parcelable state, @Nullable final ClassLoader loader) {
if (state != null) {
Bundle bundle = (Bundle)state;
final Bundle bundle = (Bundle) state;
bundle.setClassLoader(loader);
Parcelable[] fss = bundle.getParcelableArray("states");
final Parcelable[] fss = bundle.getParcelableArray("states");
mSavedState.clear();
mFragments.clear();
if (fss != null) {
for (int i=0; i<fss.length; i++) {
mSavedState.add((Fragment.SavedState)fss[i]);
for (final Parcelable parcelable : fss) {
mSavedState.add((Fragment.SavedState) parcelable);
}
}
Iterable<String> keys = bundle.keySet();
for (String key: keys) {
final Iterable<String> keys = bundle.keySet();
for (final String key : keys) {
if (key.startsWith("f")) {
int index = Integer.parseInt(key.substring(1));
Fragment f = mFragmentManager.getFragment(bundle, key);
final int index = Integer.parseInt(key.substring(1));
final Fragment f = mFragmentManager.getFragment(bundle, key);
if (f != null) {
while (mFragments.size() <= index) {
mFragments.add(null);
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
final boolean wasSelected = bundle.getString(SELECTED_FRAGMENT, "").equals(key);
final boolean wasSelected = bundle.getString(selectedFragment, "")
.equals(key);
f.setMenuVisibility(wasSelected);
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
mFragments.set(index, f);

View File

@@ -1,24 +1,80 @@
package com.google.android.material.appbar;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.OverScroller;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import org.schabi.newpipe.R;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
// check this https://stackoverflow.com/questions/56849221/recyclerview-fling-causes-laggy-while-appbarlayout-is-scrolling/57997489#57997489
// See https://stackoverflow.com/questions/56849221#57997489
public final class FlingBehavior extends AppBarLayout.Behavior {
private final Rect focusScrollRect = new Rect();
public FlingBehavior(Context context, AttributeSet attrs) {
public FlingBehavior(final Context context, final AttributeSet attrs) {
super(context, attrs);
}
private boolean allowScroll = true;
private final Rect globalRect = new Rect();
private final List<Integer> skipInterceptionOfElements = Arrays.asList(
R.id.playQueuePanel, R.id.playbackSeekBar,
R.id.playPauseButton, R.id.playPreviousButton, R.id.playNextButton);
@Override
public boolean onInterceptTouchEvent(CoordinatorLayout parent, AppBarLayout child, MotionEvent ev) {
public boolean onRequestChildRectangleOnScreen(
@NonNull final CoordinatorLayout coordinatorLayout, @NonNull final AppBarLayout child,
@NonNull final Rect rectangle, final boolean immediate) {
focusScrollRect.set(rectangle);
coordinatorLayout.offsetDescendantRectToMyCoords(child, focusScrollRect);
final int height = coordinatorLayout.getHeight();
if (focusScrollRect.top <= 0 && focusScrollRect.bottom >= height) {
// the child is too big to fit inside ourselves completely, ignore request
return false;
}
final int dy;
if (focusScrollRect.bottom > height) {
dy = focusScrollRect.top;
} else if (focusScrollRect.top < 0) {
// scrolling up
dy = -(height - focusScrollRect.bottom);
} else {
// nothing to do
return false;
}
final int consumed = scroll(coordinatorLayout, child, dy, getMaxDragOffset(child), 0);
return consumed == dy;
}
public boolean onInterceptTouchEvent(final CoordinatorLayout parent, final AppBarLayout child,
final MotionEvent ev) {
for (final Integer element : skipInterceptionOfElements) {
final View view = child.findViewById(element);
if (view != null) {
final boolean visible = view.getGlobalVisibleRect(globalRect);
if (visible && globalRect.contains((int) ev.getRawX(), (int) ev.getRawY())) {
allowScroll = false;
return false;
}
}
}
allowScroll = true;
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
// remove reference to old nested scrolling child
@@ -32,16 +88,37 @@ public final class FlingBehavior extends AppBarLayout.Behavior {
return super.onInterceptTouchEvent(parent, child, ev);
}
@Override
public boolean onStartNestedScroll(@NonNull final CoordinatorLayout parent,
@NonNull final AppBarLayout child,
@NonNull final View directTargetChild,
final View target,
final int nestedScrollAxes,
final int type) {
return allowScroll && super.onStartNestedScroll(
parent, child, directTargetChild, target, nestedScrollAxes, type);
}
@Override
public boolean onNestedFling(@NonNull final CoordinatorLayout coordinatorLayout,
@NonNull final AppBarLayout child,
@NonNull final View target, final float velocityX,
final float velocityY, final boolean consumed) {
return allowScroll && super.onNestedFling(
coordinatorLayout, child, target, velocityX, velocityY, consumed);
}
@Nullable
private OverScroller getScrollerField() {
try {
Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass().getSuperclass();
final Class<?> headerBehaviorType = this.getClass()
.getSuperclass().getSuperclass().getSuperclass();
if (headerBehaviorType != null) {
Field field = headerBehaviorType.getDeclaredField("scroller");
final Field field = headerBehaviorType.getDeclaredField("scroller");
field.setAccessible(true);
return ((OverScroller) field.get(this));
}
} catch (NoSuchFieldException | IllegalAccessException e) {
} catch (final NoSuchFieldException | IllegalAccessException e) {
// ?
}
return null;
@@ -50,33 +127,37 @@ public final class FlingBehavior extends AppBarLayout.Behavior {
@Nullable
private Field getLastNestedScrollingChildRefField() {
try {
Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass();
final Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass();
if (headerBehaviorType != null) {
Field field = headerBehaviorType.getDeclaredField("lastNestedScrollingChildRef");
final Field field
= headerBehaviorType.getDeclaredField("lastNestedScrollingChildRef");
field.setAccessible(true);
return field;
}
} catch (NoSuchFieldException e) {
} catch (final NoSuchFieldException e) {
// ?
}
return null;
}
private void resetNestedScrollingChild(){
Field field = getLastNestedScrollingChildRefField();
if(field != null){
private void resetNestedScrollingChild() {
final Field field = getLastNestedScrollingChildRefField();
if (field != null) {
try {
Object value = field.get(this);
if(value != null) field.set(this, null);
} catch (IllegalAccessException e) {
final Object value = field.get(this);
if (value != null) {
field.set(this, null);
}
} catch (final IllegalAccessException e) {
// ?
}
}
}
private void stopAppBarLayoutFling() {
OverScroller scroller = getScrollerField();
if (scroller != null) scroller.forceFinished(true);
final OverScroller scroller = getScrollerField();
if (scroller != null) {
scroller.forceFinished(true);
}
}
}
}

View File

@@ -23,17 +23,25 @@ package org.schabi.newpipe;
/**
* Singleton:
* Used to send data between certain Activity/Services within the same process.
* This can be considered as an ugly hack inside the Android universe. **/
* This can be considered as an ugly hack inside the Android universe.
**/
public class ActivityCommunicator {
private static ActivityCommunicator activityCommunicator;
private volatile Class returnActivity;
public static ActivityCommunicator getCommunicator() {
if(activityCommunicator == null) {
if (activityCommunicator == null) {
activityCommunicator = new ActivityCommunicator();
}
return activityCommunicator;
}
public volatile Class returnActivity;
public Class getReturnActivity() {
return returnActivity;
}
public void setReturnActivity(final Class returnActivity) {
this.returnActivity = returnActivity;
}
}

View File

@@ -1,33 +1,32 @@
package org.schabi.newpipe;
import android.annotation.TargetApi;
import android.app.Application;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.multidex.MultiDexApplication;
import androidx.preference.PreferenceManager;
import com.nostra13.universalimageloader.cache.memory.impl.LRULimitedMemoryCache;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
import org.acra.ACRA;
import org.acra.config.ACRAConfiguration;
import org.acra.config.ACRAConfigurationException;
import org.acra.config.ConfigurationBuilder;
import org.acra.sender.ReportSenderFactory;
import org.acra.config.CoreConfiguration;
import org.acra.config.CoreConfigurationBuilder;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.downloader.Downloader;
import org.schabi.newpipe.report.AcraReportSenderFactory;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.ErrorInfo;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.settings.SettingsActivity;
import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.ExceptionUtils;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.StateSaver;
@@ -35,16 +34,17 @@ import org.schabi.newpipe.util.StateSaver;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.SocketException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import io.reactivex.annotations.NonNull;
import io.reactivex.exceptions.CompositeException;
import io.reactivex.exceptions.MissingBackpressureException;
import io.reactivex.exceptions.OnErrorNotImplementedException;
import io.reactivex.exceptions.UndeliverableException;
import io.reactivex.functions.Consumer;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.exceptions.CompositeException;
import io.reactivex.rxjava3.exceptions.MissingBackpressureException;
import io.reactivex.rxjava3.exceptions.OnErrorNotImplementedException;
import io.reactivex.rxjava3.exceptions.UndeliverableException;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.plugins.RxJavaPlugins;
/*
* Copyright (C) Hans-Christoph Steiner 2016 <hans@eds.org>
@@ -64,19 +64,20 @@ import io.reactivex.plugins.RxJavaPlugins;
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/
public class App extends Application {
public class App extends MultiDexApplication {
protected static final String TAG = App.class.toString();
private RefWatcher refWatcher;
private static App app;
@SuppressWarnings("unchecked")
private static final Class<? extends ReportSenderFactory>[]
reportSenderFactoryClasses = new Class[]{AcraReportSenderFactory.class};
@Nullable private Disposable disposable = null;
@NonNull
public static App getApp() {
return app;
}
@Override
protected void attachBaseContext(Context base) {
protected void attachBaseContext(final Context base) {
super.attachBaseContext(base);
initACRA();
}
@@ -84,13 +85,6 @@ public class App extends Application {
public void onCreate() {
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
refWatcher = installLeakCanary();
app = this;
// Initialize settings first because others inits can use its values
@@ -102,7 +96,7 @@ public class App extends Application {
Localization.init(getApplicationContext());
StateSaver.init(this);
initNotificationChannel();
initNotificationChannels();
ServiceHelper.initServices(this);
@@ -112,35 +106,59 @@ public class App extends Application {
configureRxJavaErrorHandler();
// Check for new version
new CheckForNewAppVersionTask().execute();
disposable = CheckForNewAppVersion.checkNewVersion(this);
}
@Override
public void onTerminate() {
if (disposable != null) {
disposable.dispose();
}
super.onTerminate();
}
protected Downloader getDownloader() {
return DownloaderImpl.init(null);
final DownloaderImpl downloader = DownloaderImpl.init(null);
setCookiesToDownloader(downloader);
return downloader;
}
protected void setCookiesToDownloader(final DownloaderImpl downloader) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(
getApplicationContext());
final String key = getApplicationContext().getString(R.string.recaptcha_cookies_key);
downloader.setCookie(ReCaptchaActivity.RECAPTCHA_COOKIES_KEY, prefs.getString(key, ""));
downloader.updateYoutubeRestrictedModeCookies(getApplicationContext());
}
private void configureRxJavaErrorHandler() {
// https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling
RxJavaPlugins.setErrorHandler(new Consumer<Throwable>() {
@Override
public void accept(@NonNull Throwable throwable) {
Log.e(TAG, "RxJavaPlugins.ErrorHandler called with -> : " +
"throwable = [" + throwable.getClass().getName() + "]");
public void accept(@NonNull final Throwable throwable) {
Log.e(TAG, "RxJavaPlugins.ErrorHandler called with -> : "
+ "throwable = [" + throwable.getClass().getName() + "]");
final Throwable actualThrowable;
if (throwable instanceof UndeliverableException) {
// As UndeliverableException is a wrapper, get the cause of it to get the "real" exception
throwable = throwable.getCause();
// As UndeliverableException is a wrapper,
// get the cause of it to get the "real" exception
actualThrowable = throwable.getCause();
} else {
actualThrowable = throwable;
}
final List<Throwable> errors;
if (throwable instanceof CompositeException) {
errors = ((CompositeException) throwable).getExceptions();
if (actualThrowable instanceof CompositeException) {
errors = ((CompositeException) actualThrowable).getExceptions();
} else {
errors = Collections.singletonList(throwable);
errors = Collections.singletonList(actualThrowable);
}
for (final Throwable error : errors) {
if (isThrowableIgnored(error)) return;
if (isThrowableIgnored(error)) {
return;
}
if (isThrowableCritical(error)) {
reportException(error);
return;
@@ -150,22 +168,24 @@ public class App extends Application {
// Out-of-lifecycle exceptions should only be reported if a debug user wishes so,
// When exception is not reported, log it
if (isDisposedRxExceptionsReported()) {
reportException(throwable);
reportException(actualThrowable);
} else {
Log.e(TAG, "RxJavaPlugin: Undeliverable Exception received: ", throwable);
Log.e(TAG, "RxJavaPlugin: Undeliverable Exception received: ", actualThrowable);
}
}
private boolean isThrowableIgnored(@NonNull final Throwable throwable) {
// Don't crash the application over a simple network problem
return ExtractorHelper.hasAssignableCauseThrowable(throwable,
IOException.class, SocketException.class, // network api cancellation
InterruptedException.class, InterruptedIOException.class); // blocking code disposed
return ExceptionUtils.hasAssignableCause(throwable,
// network api cancellation
IOException.class, SocketException.class,
// blocking code disposed
InterruptedException.class, InterruptedIOException.class);
}
private boolean isThrowableCritical(@NonNull final Throwable throwable) {
// Though these exceptions cannot be ignored
return ExtractorHelper.hasAssignableCauseThrowable(throwable,
return ExceptionUtils.hasAssignableCause(throwable,
NullPointerException.class, IllegalArgumentException.class, // bug in app
OnErrorNotImplementedException.class, MissingBackpressureException.class,
IllegalStateException.class); // bug in operator
@@ -188,84 +208,59 @@ public class App extends Application {
.build();
}
private void initACRA() {
/**
* Called in {@link #attachBaseContext(Context)} after calling the {@code super} method.
* Should be overridden if MultiDex is enabled, since it has to be initialized before ACRA.
*/
protected void initACRA() {
if (ACRA.isACRASenderServiceProcess()) {
return;
}
try {
final ACRAConfiguration acraConfig = new ConfigurationBuilder(this)
.setReportSenderFactoryClasses(reportSenderFactoryClasses)
final CoreConfiguration acraConfig = new CoreConfigurationBuilder(this)
.setBuildConfigClass(BuildConfig.class)
.build();
ACRA.init(this, acraConfig);
} catch (ACRAConfigurationException ace) {
} catch (final ACRAConfigurationException ace) {
ace.printStackTrace();
ErrorActivity.reportError(this,
ace,
null,
null,
ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none",
"Could not initialize ACRA crash report", R.string.app_ui_crash));
ErrorInfo.make(UserAction.SOMETHING_ELSE, "none",
"Could not initialize ACRA crash report", R.string.app_ui_crash));
}
}
public void initNotificationChannel() {
if (Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O) {
private void initNotificationChannels() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
return;
}
final String id = getString(R.string.notification_channel_id);
final CharSequence name = getString(R.string.notification_channel_name);
final String description = getString(R.string.notification_channel_description);
String id = getString(R.string.notification_channel_id);
String name = getString(R.string.notification_channel_name);
String description = getString(R.string.notification_channel_description);
// Keep this below DEFAULT to avoid making noise on every notification update
final int importance = NotificationManager.IMPORTANCE_LOW;
NotificationChannel mChannel = new NotificationChannel(id, name, importance);
mChannel.setDescription(description);
final NotificationChannel mainChannel = new NotificationChannel(id, name, importance);
mainChannel.setDescription(description);
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.createNotificationChannel(mChannel);
id = getString(R.string.app_update_notification_channel_id);
name = getString(R.string.app_update_notification_channel_name);
description = getString(R.string.app_update_notification_channel_description);
setUpUpdateNotificationChannel(importance);
}
final NotificationChannel appUpdateChannel = new NotificationChannel(id, name, importance);
appUpdateChannel.setDescription(description);
/**
* Set up notification channel for app update.
* @param importance
*/
@TargetApi(Build.VERSION_CODES.O)
private void setUpUpdateNotificationChannel(int importance) {
final String appUpdateId
= getString(R.string.app_update_notification_channel_id);
final CharSequence appUpdateName
= getString(R.string.app_update_notification_channel_name);
final String appUpdateDescription
= getString(R.string.app_update_notification_channel_description);
NotificationChannel appUpdateChannel
= new NotificationChannel(appUpdateId, appUpdateName, importance);
appUpdateChannel.setDescription(appUpdateDescription);
NotificationManager appUpdateNotificationManager
= (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
appUpdateNotificationManager.createNotificationChannel(appUpdateChannel);
}
@Nullable
public static RefWatcher getRefWatcher(Context context) {
final App application = (App) context.getApplicationContext();
return application.refWatcher;
}
protected RefWatcher installLeakCanary() {
return RefWatcher.DISABLED;
final NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannels(Arrays.asList(mainChannel,
appUpdateChannel));
}
protected boolean isDisposedRxExceptionsReported() {
return false;
}
public static App getApp() {
return app;
}
}

View File

@@ -2,32 +2,31 @@ package org.schabi.newpipe;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.squareup.leakcanary.RefWatcher;
import icepick.Icepick;
import icepick.State;
import leakcanary.AppWatcher;
public abstract class BaseFragment extends Fragment {
public static final ImageLoader IMAGE_LOADER = ImageLoader.getInstance();
protected final String TAG = getClass().getSimpleName() + "@" + Integer.toHexString(hashCode());
protected final boolean DEBUG = MainActivity.DEBUG;
protected AppCompatActivity activity;
public static final ImageLoader imageLoader = ImageLoader.getInstance();
//These values are used for controlling framgents when they are part of the frontpage
//These values are used for controlling fragments when they are part of the frontpage
@State
protected boolean useAsFrontPage = false;
protected boolean mIsVisibleToUser = false;
private boolean mIsVisibleToUser = false;
public void useAsFrontPage(boolean value) {
public void useAsFrontPage(final boolean value) {
useAsFrontPage = value;
}
@@ -36,7 +35,7 @@ public abstract class BaseFragment extends Fragment {
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onAttach(Context context) {
public void onAttach(final Context context) {
super.onAttach(context);
activity = (AppCompatActivity) context;
}
@@ -48,43 +47,49 @@ public abstract class BaseFragment extends Fragment {
}
@Override
public void onCreate(Bundle savedInstanceState) {
if (DEBUG) Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]");
public void onCreate(final Bundle savedInstanceState) {
if (DEBUG) {
Log.d(TAG, "onCreate() called with: "
+ "savedInstanceState = [" + savedInstanceState + "]");
}
super.onCreate(savedInstanceState);
Icepick.restoreInstanceState(this, savedInstanceState);
if (savedInstanceState != null) onRestoreInstanceState(savedInstanceState);
if (savedInstanceState != null) {
onRestoreInstanceState(savedInstanceState);
}
}
@Override
public void onViewCreated(View rootView, Bundle savedInstanceState) {
public void onViewCreated(final View rootView, final Bundle savedInstanceState) {
super.onViewCreated(rootView, savedInstanceState);
if (DEBUG) {
Log.d(TAG, "onViewCreated() called with: rootView = [" + rootView + "], savedInstanceState = [" + savedInstanceState + "]");
Log.d(TAG, "onViewCreated() called with: "
+ "rootView = [" + rootView + "], "
+ "savedInstanceState = [" + savedInstanceState + "]");
}
initViews(rootView, savedInstanceState);
initListeners();
}
@Override
public void onSaveInstanceState(Bundle outState) {
public void onSaveInstanceState(final Bundle outState) {
super.onSaveInstanceState(outState);
Icepick.saveInstanceState(this, outState);
}
protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
protected void onRestoreInstanceState(@NonNull final Bundle savedInstanceState) {
}
@Override
public void onDestroy() {
super.onDestroy();
RefWatcher refWatcher = App.getRefWatcher(getActivity());
if (refWatcher != null) refWatcher.watch(this);
AppWatcher.INSTANCE.getObjectWatcher().watch(this);
}
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
public void setUserVisibleHint(final boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
mIsVisibleToUser = isVisibleToUser;
}
@@ -93,7 +98,7 @@ public abstract class BaseFragment extends Fragment {
// Init
//////////////////////////////////////////////////////////////////////////*/
protected void initViews(View rootView, Bundle savedInstanceState) {
protected void initViews(final View rootView, final Bundle savedInstanceState) {
}
protected void initListeners() {
@@ -103,10 +108,12 @@ public abstract class BaseFragment extends Fragment {
// Utils
//////////////////////////////////////////////////////////////////////////*/
public void setTitle(String title) {
if (DEBUG) Log.d(TAG, "setTitle() called with: title = [" + title + "]");
if((!useAsFrontPage || mIsVisibleToUser)
&& (activity != null && activity.getSupportActionBar() != null)) {
public void setTitle(final String title) {
if (DEBUG) {
Log.d(TAG, "setTitle() called with: title = [" + title + "]");
}
if ((!useAsFrontPage || mIsVisibleToUser)
&& (activity != null && activity.getSupportActionBar() != null)) {
activity.getSupportActionBar().setDisplayShowTitleEnabled(true);
activity.getSupportActionBar().setTitle(title);
}

View File

@@ -0,0 +1,222 @@
package org.schabi.newpipe;
import android.app.Application;
import android.app.PendingIntent;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import androidx.core.content.ContextCompat;
import androidx.preference.PreferenceManager;
import com.grack.nanojson.JsonObject;
import com.grack.nanojson.JsonParser;
import com.grack.nanojson.JsonParserException;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.ErrorInfo;
import org.schabi.newpipe.report.UserAction;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Maybe;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.schedulers.Schedulers;
public final class CheckForNewAppVersion {
private CheckForNewAppVersion() { }
private static final boolean DEBUG = MainActivity.DEBUG;
private static final String TAG = CheckForNewAppVersion.class.getSimpleName();
private static final String GITHUB_APK_SHA1
= "B0:2E:90:7C:1C:D6:FC:57:C3:35:F0:88:D0:8F:50:5F:94:E4:D2:15";
private static final String NEWPIPE_API_URL = "https://newpipe.schabi.org/api/data.json";
/**
* Method to get the APK's SHA1 key. See https://stackoverflow.com/questions/9293019/#22506133.
*
* @param application The application
* @return String with the APK's SHA1 fingerprint in hexadecimal
*/
@NonNull
private static String getCertificateSHA1Fingerprint(@NonNull final Application application) {
final PackageInfo packageInfo;
try {
packageInfo = application.getPackageManager().getPackageInfo(
application.getPackageName(), PackageManager.GET_SIGNATURES);
} catch (final PackageManager.NameNotFoundException e) {
ErrorActivity.reportError(application, e, null, null,
ErrorInfo.make(UserAction.SOMETHING_ELSE, "none",
"Could not find package info", R.string.app_ui_crash));
return "";
}
final X509Certificate c;
try {
final Signature[] signatures = packageInfo.signatures;
final byte[] cert = signatures[0].toByteArray();
final InputStream input = new ByteArrayInputStream(cert);
final CertificateFactory cf = CertificateFactory.getInstance("X509");
c = (X509Certificate) cf.generateCertificate(input);
} catch (final CertificateException e) {
ErrorActivity.reportError(application, e, null, null,
ErrorInfo.make(UserAction.SOMETHING_ELSE, "none",
"Certificate error", R.string.app_ui_crash));
return "";
}
try {
final MessageDigest md = MessageDigest.getInstance("SHA1");
final byte[] publicKey = md.digest(c.getEncoded());
return byte2HexFormatted(publicKey);
} catch (NoSuchAlgorithmException | CertificateEncodingException e) {
ErrorActivity.reportError(application, e, null, null,
ErrorInfo.make(UserAction.SOMETHING_ELSE, "none",
"Could not retrieve SHA1 key", R.string.app_ui_crash));
return "";
}
}
private static String byte2HexFormatted(final byte[] arr) {
final StringBuilder str = new StringBuilder(arr.length * 2);
for (int i = 0; i < arr.length; i++) {
String h = Integer.toHexString(arr[i]);
final int l = h.length();
if (l == 1) {
h = "0" + h;
}
if (l > 2) {
h = h.substring(l - 2, l);
}
str.append(h.toUpperCase());
if (i < (arr.length - 1)) {
str.append(':');
}
}
return str.toString();
}
/**
* Method to compare the current and latest available app version.
* If a newer version is available, we show the update notification.
*
* @param application The application
* @param versionName Name of new version
* @param apkLocationUrl Url with the new apk
* @param versionCode Code of new version
*/
private static void compareAppVersionAndShowNotification(@NonNull final Application application,
final String versionName,
final String apkLocationUrl,
final int versionCode) {
final int notificationId = 2000;
if (BuildConfig.VERSION_CODE < versionCode) {
// A pending intent to open the apk location url in the browser.
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(apkLocationUrl));
final PendingIntent pendingIntent
= PendingIntent.getActivity(application, 0, intent, 0);
final String channelId = application
.getString(R.string.app_update_notification_channel_id);
final NotificationCompat.Builder notificationBuilder
= new NotificationCompat.Builder(application, channelId)
.setSmallIcon(R.drawable.ic_newpipe_update)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setContentIntent(pendingIntent)
.setAutoCancel(true)
.setContentTitle(application
.getString(R.string.app_update_notification_content_title))
.setContentText(application
.getString(R.string.app_update_notification_content_text)
+ " " + versionName);
final NotificationManagerCompat notificationManager
= NotificationManagerCompat.from(application);
notificationManager.notify(notificationId, notificationBuilder.build());
}
}
private static boolean isConnected(@NonNull final App app) {
final ConnectivityManager connectivityManager =
ContextCompat.getSystemService(app, ConnectivityManager.class);
return connectivityManager != null && connectivityManager.getActiveNetworkInfo() != null
&& connectivityManager.getActiveNetworkInfo().isConnected();
}
public static boolean isGithubApk(@NonNull final App app) {
return getCertificateSHA1Fingerprint(app).equals(GITHUB_APK_SHA1);
}
@Nullable
public static Disposable checkNewVersion(@NonNull final App app) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(app);
// Check if user has enabled/disabled update checking
// and if the current apk is a github one or not.
if (!prefs.getBoolean(app.getString(R.string.update_app_key), true) || !isGithubApk(app)) {
return null;
}
return Maybe
.fromCallable(() -> {
if (!isConnected(app)) {
return null;
}
// Make a network request to get latest NewPipe data.
return DownloaderImpl.getInstance().get(NEWPIPE_API_URL).responseBody();
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
response -> {
// Parse the json from the response.
try {
final JsonObject githubStableObject = JsonParser.object()
.from(response).getObject("flavors").getObject("github")
.getObject("stable");
final String versionName = githubStableObject
.getString("version");
final int versionCode = githubStableObject
.getInt("version_code");
final String apkLocationUrl = githubStableObject
.getString("apk");
compareAppVersionAndShowNotification(app, versionName,
apkLocationUrl, versionCode);
} catch (final JsonParserException e) {
// connectivity problems, do not alarm user and fail silently
if (DEBUG) {
Log.w(TAG, "Could not get NewPipe API: invalid json", e);
}
}
},
e -> {
// connectivity problems, do not alarm user and fail silently
if (DEBUG) {
Log.w(TAG, "Could not get NewPipe API: network problem", e);
}
});
}
}

View File

@@ -1,238 +0,0 @@
package org.schabi.newpipe;
import android.app.Application;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.Signature;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.AsyncTask;
import android.preference.PreferenceManager;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
/**
* AsyncTask to check if there is a newer version of the NewPipe github apk available or not.
* If there is a newer version we show a notification, informing the user. On tapping
* the notification, the user will be directed to the download link.
*/
public class CheckForNewAppVersionTask extends AsyncTask<Void, Void, String> {
private static final boolean DEBUG = MainActivity.DEBUG;
private static final String TAG = CheckForNewAppVersionTask.class.getSimpleName();
private static final Application app = App.getApp();
private static final String GITHUB_APK_SHA1 = "B0:2E:90:7C:1C:D6:FC:57:C3:35:F0:88:D0:8F:50:5F:94:E4:D2:15";
private static final String newPipeApiUrl = "https://newpipe.schabi.org/api/data.json";
private static final int timeoutPeriod = 30;
private SharedPreferences mPrefs;
private OkHttpClient client;
@Override
protected void onPreExecute() {
mPrefs = PreferenceManager.getDefaultSharedPreferences(app);
// Check if user has enabled/ disabled update checking
// and if the current apk is a github one or not.
if (!mPrefs.getBoolean(app.getString(R.string.update_app_key), true)
|| !isGithubApk()) {
this.cancel(true);
}
}
@Override
protected String doInBackground(Void... voids) {
if(isCancelled() || !isConnected()) return null;
// Make a network request to get latest NewPipe data.
if (client == null) {
client = new OkHttpClient
.Builder()
.readTimeout(timeoutPeriod, TimeUnit.SECONDS)
.build();
}
Request request = new Request.Builder()
.url(newPipeApiUrl)
.build();
try {
Response response = client.newCall(request).execute();
return response.body().string();
} catch (IOException ex) {
// connectivity problems, do not alarm user and fail silently
if (DEBUG) Log.w(TAG, Log.getStackTraceString(ex));
}
return null;
}
@Override
protected void onPostExecute(String response) {
// Parse the json from the response.
if (response != null) {
try {
JSONObject mainObject = new JSONObject(response);
JSONObject flavoursObject = mainObject.getJSONObject("flavors");
JSONObject githubObject = flavoursObject.getJSONObject("github");
JSONObject githubStableObject = githubObject.getJSONObject("stable");
String versionName = githubStableObject.getString("version");
String versionCode = githubStableObject.getString("version_code");
String apkLocationUrl = githubStableObject.getString("apk");
compareAppVersionAndShowNotification(versionName, apkLocationUrl, versionCode);
} catch (JSONException ex) {
// connectivity problems, do not alarm user and fail silently
if (DEBUG) Log.w(TAG, Log.getStackTraceString(ex));
}
}
}
/**
* Method to compare the current and latest available app version.
* If a newer version is available, we show the update notification.
* @param versionName
* @param apkLocationUrl
*/
private void compareAppVersionAndShowNotification(String versionName,
String apkLocationUrl,
String versionCode) {
int NOTIFICATION_ID = 2000;
if (BuildConfig.VERSION_CODE < Integer.valueOf(versionCode)) {
// A pending intent to open the apk location url in the browser.
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(apkLocationUrl));
PendingIntent pendingIntent
= PendingIntent.getActivity(app, 0, intent, 0);
NotificationCompat.Builder notificationBuilder = new NotificationCompat
.Builder(app, app.getString(R.string.app_update_notification_channel_id))
.setSmallIcon(R.drawable.ic_newpipe_update)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setContentIntent(pendingIntent)
.setAutoCancel(true)
.setContentTitle(app.getString(R.string.app_update_notification_content_title))
.setContentText(app.getString(R.string.app_update_notification_content_text)
+ " " + versionName);
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(app);
notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build());
}
}
/**
* Method to get the apk's SHA1 key.
* https://stackoverflow.com/questions/9293019/get-certificate-fingerprint-from-android-app#22506133
*/
private static String getCertificateSHA1Fingerprint() {
PackageManager pm = app.getPackageManager();
String packageName = app.getPackageName();
int flags = PackageManager.GET_SIGNATURES;
PackageInfo packageInfo = null;
try {
packageInfo = pm.getPackageInfo(packageName, flags);
} catch (PackageManager.NameNotFoundException ex) {
ErrorActivity.reportError(app, ex, null, null,
ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none",
"Could not find package info", R.string.app_ui_crash));
}
Signature[] signatures = packageInfo.signatures;
byte[] cert = signatures[0].toByteArray();
InputStream input = new ByteArrayInputStream(cert);
CertificateFactory cf = null;
X509Certificate c = null;
try {
cf = CertificateFactory.getInstance("X509");
c = (X509Certificate) cf.generateCertificate(input);
} catch (CertificateException ex) {
ErrorActivity.reportError(app, ex, null, null,
ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none",
"Certificate error", R.string.app_ui_crash));
}
String hexString = null;
try {
MessageDigest md = MessageDigest.getInstance("SHA1");
byte[] publicKey = md.digest(c.getEncoded());
hexString = byte2HexFormatted(publicKey);
} catch (NoSuchAlgorithmException ex1) {
ErrorActivity.reportError(app, ex1, null, null,
ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none",
"Could not retrieve SHA1 key", R.string.app_ui_crash));
} catch (CertificateEncodingException ex2) {
ErrorActivity.reportError(app, ex2, null, null,
ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none",
"Could not retrieve SHA1 key", R.string.app_ui_crash));
}
return hexString;
}
private static String byte2HexFormatted(byte[] arr) {
StringBuilder str = new StringBuilder(arr.length * 2);
for (int i = 0; i < arr.length; i++) {
String h = Integer.toHexString(arr[i]);
int l = h.length();
if (l == 1) h = "0" + h;
if (l > 2) h = h.substring(l - 2, l);
str.append(h.toUpperCase());
if (i < (arr.length - 1)) str.append(':');
}
return str.toString();
}
public static boolean isGithubApk() {
return getCertificateSHA1Fingerprint().equals(GITHUB_APK_SHA1);
}
private boolean isConnected() {
ConnectivityManager cm =
(ConnectivityManager) app.getSystemService(Context.CONNECTIVITY_SERVICE);
return cm.getActiveNetworkInfo() != null
&& cm.getActiveNetworkInfo().isConnected();
}
}

View File

@@ -1,12 +1,18 @@
package org.schabi.newpipe;
import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import androidx.preference.PreferenceManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.schabi.newpipe.extractor.downloader.Downloader;
import org.schabi.newpipe.extractor.downloader.Request;
import org.schabi.newpipe.extractor.downloader.Response;
import org.schabi.newpipe.extractor.exceptions.ReCaptchaException;
import org.schabi.newpipe.util.CookieUtils;
import org.schabi.newpipe.util.InfoCache;
import org.schabi.newpipe.util.TLSSocketFactoryCompat;
import java.io.IOException;
@@ -17,6 +23,7 @@ import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@@ -26,9 +33,6 @@ import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import okhttp3.CipherSuite;
import okhttp3.ConnectionSpec;
import okhttp3.OkHttpClient;
@@ -37,42 +41,139 @@ import okhttp3.ResponseBody;
import static org.schabi.newpipe.MainActivity.DEBUG;
public class DownloaderImpl extends Downloader {
public static final String USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0";
public final class DownloaderImpl extends Downloader {
public static final String USER_AGENT
= "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0";
public static final String YOUTUBE_RESTRICTED_MODE_COOKIE_KEY
= "youtube_restricted_mode_key";
public static final String YOUTUBE_RESTRICTED_MODE_COOKIE = "PREF=f2=8000000";
public static final String YOUTUBE_DOMAIN = "youtube.com";
private static DownloaderImpl instance;
private String mCookies;
private OkHttpClient client;
private final Map<String, String> mCookies;
private final OkHttpClient client;
private DownloaderImpl(OkHttpClient.Builder builder) {
private DownloaderImpl(final OkHttpClient.Builder builder) {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
enableModernTLS(builder);
}
this.client = builder
.readTimeout(30, TimeUnit.SECONDS)
//.cache(new Cache(new File(context.getExternalCacheDir(), "okhttp"), 16 * 1024 * 1024))
// .cache(new Cache(new File(context.getExternalCacheDir(), "okhttp"),
// 16 * 1024 * 1024))
.build();
this.mCookies = new HashMap<>();
}
/**
* It's recommended to call exactly once in the entire lifetime of the application.
*
* @param builder if null, default builder will be used
* @return a new instance of {@link DownloaderImpl}
*/
public static DownloaderImpl init(@Nullable OkHttpClient.Builder builder) {
return instance = new DownloaderImpl(builder != null ? builder : new OkHttpClient.Builder());
public static DownloaderImpl init(@Nullable final OkHttpClient.Builder builder) {
instance = new DownloaderImpl(
builder != null ? builder : new OkHttpClient.Builder());
return instance;
}
public static DownloaderImpl getInstance() {
return instance;
}
public String getCookies() {
return mCookies;
/**
* Enable TLS 1.2 and 1.1 on Android Kitkat. This function is mostly taken
* from the documentation of OkHttpClient.Builder.sslSocketFactory(_,_).
* <p>
* If there is an error, the function will safely fall back to doing nothing
* and printing the error to the console.
* </p>
*
* @param builder The HTTPClient Builder on which TLS is enabled on (will be modified in-place)
*/
private static void enableModernTLS(final OkHttpClient.Builder builder) {
try {
// get the default TrustManager
final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(
TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init((KeyStore) null);
final TrustManager[] trustManagers = trustManagerFactory.getTrustManagers();
if (trustManagers.length != 1 || !(trustManagers[0] instanceof X509TrustManager)) {
throw new IllegalStateException("Unexpected default trust managers:"
+ Arrays.toString(trustManagers));
}
final X509TrustManager trustManager = (X509TrustManager) trustManagers[0];
// insert our own TLSSocketFactory
final SSLSocketFactory sslSocketFactory = TLSSocketFactoryCompat.getInstance();
builder.sslSocketFactory(sslSocketFactory, trustManager);
// This will try to enable all modern CipherSuites(+2 more)
// that are supported on the device.
// Necessary because some servers (e.g. Framatube.org)
// don't support the old cipher suites.
// https://github.com/square/okhttp/issues/4053#issuecomment-402579554
final List<CipherSuite> cipherSuites =
new ArrayList<>(ConnectionSpec.MODERN_TLS.cipherSuites());
cipherSuites.add(CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA);
cipherSuites.add(CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA);
final ConnectionSpec legacyTLS = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.cipherSuites(cipherSuites.toArray(new CipherSuite[0]))
.build();
builder.connectionSpecs(Arrays.asList(legacyTLS, ConnectionSpec.CLEARTEXT));
} catch (final KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) {
if (DEBUG) {
e.printStackTrace();
}
}
}
public void setCookies(String cookies) {
mCookies = cookies;
public String getCookies(final String url) {
final List<String> resultCookies = new ArrayList<>();
if (url.contains(YOUTUBE_DOMAIN)) {
final String youtubeCookie = getCookie(YOUTUBE_RESTRICTED_MODE_COOKIE_KEY);
if (youtubeCookie != null) {
resultCookies.add(youtubeCookie);
}
}
// Recaptcha cookie is always added TODO: not sure if this is necessary
final String recaptchaCookie = getCookie(ReCaptchaActivity.RECAPTCHA_COOKIES_KEY);
if (recaptchaCookie != null) {
resultCookies.add(recaptchaCookie);
}
return CookieUtils.concatCookies(resultCookies);
}
public String getCookie(final String key) {
return mCookies.get(key);
}
public void setCookie(final String key, final String cookie) {
mCookies.put(key, cookie);
}
public void removeCookie(final String key) {
mCookies.remove(key);
}
public void updateYoutubeRestrictedModeCookies(final Context context) {
final String restrictedModeEnabledKey =
context.getString(R.string.youtube_restricted_mode_enabled);
final boolean restrictedModeEnabled = PreferenceManager.getDefaultSharedPreferences(context)
.getBoolean(restrictedModeEnabledKey, false);
updateYoutubeRestrictedModeCookies(restrictedModeEnabled);
}
public void updateYoutubeRestrictedModeCookies(final boolean youtubeRestrictedModeEnabled) {
if (youtubeRestrictedModeEnabled) {
setCookie(YOUTUBE_RESTRICTED_MODE_COOKIE_KEY,
YOUTUBE_RESTRICTED_MODE_COOKIE);
} else {
removeCookie(YOUTUBE_RESTRICTED_MODE_COOKIE_KEY);
}
InfoCache.getInstance().clearCache();
}
/**
@@ -81,25 +182,26 @@ public class DownloaderImpl extends Downloader {
* @param url an url pointing to the content
* @return the size of the content, in bytes
*/
public long getContentLength(String url) throws IOException {
public long getContentLength(final String url) throws IOException {
try {
final Response response = head(url);
return Long.parseLong(response.getHeader("Content-Length"));
} catch (NumberFormatException e) {
} catch (final NumberFormatException e) {
throw new IOException("Invalid content length", e);
} catch (ReCaptchaException e) {
} catch (final ReCaptchaException e) {
throw new IOException(e);
}
}
public InputStream stream(String siteUrl) throws IOException {
public InputStream stream(final String siteUrl) throws IOException {
try {
final okhttp3.Request.Builder requestBuilder = new okhttp3.Request.Builder()
.method("GET", null).url(siteUrl)
.addHeader("User-Agent", USER_AGENT);
if (!TextUtils.isEmpty(mCookies)) {
requestBuilder.addHeader("Cookie", mCookies);
final String cookies = getCookies(siteUrl);
if (!cookies.isEmpty()) {
requestBuilder.addHeader("Cookie", cookies);
}
final okhttp3.Request request = requestBuilder.build();
@@ -116,13 +218,14 @@ public class DownloaderImpl extends Downloader {
}
return body.byteStream();
} catch (ReCaptchaException e) {
} catch (final ReCaptchaException e) {
throw new IOException(e.getMessage(), e.getCause());
}
}
@Override
public Response execute(@NonNull Request request) throws IOException, ReCaptchaException {
public Response execute(@NonNull final Request request)
throws IOException, ReCaptchaException {
final String httpMethod = request.httpMethod();
final String url = request.url();
final Map<String, List<String>> headers = request.headers();
@@ -137,17 +240,18 @@ public class DownloaderImpl extends Downloader {
.method(httpMethod, requestBody).url(url)
.addHeader("User-Agent", USER_AGENT);
if (!TextUtils.isEmpty(mCookies)) {
requestBuilder.addHeader("Cookie", mCookies);
final String cookies = getCookies(url);
if (!cookies.isEmpty()) {
requestBuilder.addHeader("Cookie", cookies);
}
for (Map.Entry<String, List<String>> pair : headers.entrySet()) {
for (final Map.Entry<String, List<String>> pair : headers.entrySet()) {
final String headerName = pair.getKey();
final List<String> headerValueList = pair.getValue();
if (headerValueList.size() > 1) {
requestBuilder.removeHeader(headerName);
for (String headerValue : headerValueList) {
for (final String headerValue : headerValueList) {
requestBuilder.addHeader(headerName, headerValue);
}
} else if (headerValueList.size() == 1) {
@@ -172,49 +276,7 @@ public class DownloaderImpl extends Downloader {
}
final String latestUrl = response.request().url().toString();
return new Response(response.code(), response.message(), response.headers().toMultimap(), responseBodyToReturn, latestUrl);
}
/**
* Enable TLS 1.2 and 1.1 on Android Kitkat. This function is mostly taken from the documentation of
* OkHttpClient.Builder.sslSocketFactory(_,_)
* <p>
* If there is an error, the function will safely fall back to doing nothing and printing the error to the console.
*
* @param builder The HTTPClient Builder on which TLS is enabled on (will be modified in-place)
*/
private static void enableModernTLS(OkHttpClient.Builder builder) {
try {
// get the default TrustManager
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(
TrustManagerFactory.getDefaultAlgorithm());
trustManagerFactory.init((KeyStore) null);
TrustManager[] trustManagers = trustManagerFactory.getTrustManagers();
if (trustManagers.length != 1 || !(trustManagers[0] instanceof X509TrustManager)) {
throw new IllegalStateException("Unexpected default trust managers:"
+ Arrays.toString(trustManagers));
}
X509TrustManager trustManager = (X509TrustManager) trustManagers[0];
// insert our own TLSSocketFactory
SSLSocketFactory sslSocketFactory = TLSSocketFactoryCompat.getInstance();
builder.sslSocketFactory(sslSocketFactory, trustManager);
// This will try to enable all modern CipherSuites(+2 more) that are supported on the device.
// Necessary because some servers (e.g. Framatube.org) don't support the old cipher suites.
// https://github.com/square/okhttp/issues/4053#issuecomment-402579554
List<CipherSuite> cipherSuites = new ArrayList<>();
cipherSuites.addAll(ConnectionSpec.MODERN_TLS.cipherSuites());
cipherSuites.add(CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA);
cipherSuites.add(CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA);
ConnectionSpec legacyTLS = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.cipherSuites(cipherSuites.toArray(new CipherSuite[0]))
.build();
builder.connectionSpecs(Arrays.asList(legacyTLS, ConnectionSpec.CLEARTEXT));
} catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) {
if (DEBUG) e.printStackTrace();
}
return new Response(response.code(), response.message(), response.headers().toMultimap(),
responseBodyToReturn, latestUrl);
}
}

View File

@@ -1,4 +1,3 @@
package org.schabi.newpipe;
import android.annotation.SuppressLint;
@@ -27,22 +26,8 @@ import android.os.Bundle;
public class ExitActivity extends Activity {
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= 21) {
finishAndRemoveTask();
} else {
finish();
}
System.exit(0);
}
public static void exitAndRemoveFromRecentApps(Activity activity) {
Intent intent = new Intent(activity, ExitActivity.class);
public static void exitAndRemoveFromRecentApps(final Activity activity) {
final Intent intent = new Intent(activity, ExitActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
@@ -51,4 +36,18 @@ public class ExitActivity extends Activity {
activity.startActivity(intent);
}
@SuppressLint("NewApi")
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
finishAndRemoveTask();
} else {
finish();
}
System.exit(0);
}
}

View File

@@ -4,7 +4,7 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.preference.PreferenceManager;
import androidx.preference.PreferenceManager;
import com.nostra13.universalimageloader.core.download.BaseImageDownloader;
@@ -18,7 +18,7 @@ public class ImageDownloader extends BaseImageDownloader {
private final SharedPreferences preferences;
private final String downloadThumbnailKey;
public ImageDownloader(Context context) {
public ImageDownloader(final Context context) {
super(context);
this.resources = context.getResources();
this.preferences = PreferenceManager.getDefaultSharedPreferences(context);
@@ -31,7 +31,7 @@ public class ImageDownloader extends BaseImageDownloader {
@SuppressLint("ResourceType")
@Override
public InputStream getStream(String imageUri, Object extra) throws IOException {
public InputStream getStream(final String imageUri, final Object extra) throws IOException {
if (isDownloadingThumbnail()) {
return super.getStream(imageUri, extra);
} else {
@@ -39,7 +39,8 @@ public class ImageDownloader extends BaseImageDownloader {
}
}
protected InputStream getStreamFromNetwork(String imageUri, Object extra) throws IOException {
protected InputStream getStreamFromNetwork(final String imageUri, final Object extra)
throws IOException {
final DownloaderImpl downloader = (DownloaderImpl) NewPipe.getDownloader();
return downloader.stream(imageUri);
}

View File

@@ -20,24 +20,27 @@
package org.schabi.newpipe;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
@@ -51,7 +54,9 @@ import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.preference.PreferenceManager;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.navigation.NavigationView;
import org.schabi.newpipe.extractor.NewPipe;
@@ -62,20 +67,28 @@ 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.player.VideoPlayer;
import org.schabi.newpipe.player.event.OnKeyDownListener;
import org.schabi.newpipe.player.helper.PlayerHolder;
import org.schabi.newpipe.player.playqueue.PlayQueue;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.DeviceUtils;
import org.schabi.newpipe.util.KioskTranslator;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PeertubeHelper;
import org.schabi.newpipe.util.PermissionHelper;
import org.schabi.newpipe.util.SerializedCache;
import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.StateSaver;
import org.schabi.newpipe.util.TLSSocketFactoryCompat;
import org.schabi.newpipe.util.ThemeHelper;
import org.schabi.newpipe.views.FocusOverlayView;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
@@ -83,20 +96,23 @@ public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity";
public static final boolean DEBUG = !BuildConfig.BUILD_TYPE.equals("release");
private ActionBarDrawerToggle toggle = null;
private DrawerLayout drawer = null;
private NavigationView drawerItems = null;
private TextView headerServiceView = null;
private Button toggleServiceButton = null;
private ActionBarDrawerToggle toggle;
private DrawerLayout drawer;
private NavigationView drawerItems;
private ImageView headerServiceIcon;
private TextView headerServiceView;
private Button toggleServiceButton;
private boolean servicesShown = false;
private ImageView serviceArrow;
private static final int ITEM_ID_SUBSCRIPTIONS = - 1;
private static final int ITEM_ID_FEED = - 2;
private static final int ITEM_ID_BOOKMARKS = - 3;
private static final int ITEM_ID_DOWNLOADS = - 4;
private static final int ITEM_ID_HISTORY = - 5;
private BroadcastReceiver broadcastReceiver;
private static final int ITEM_ID_SUBSCRIPTIONS = -1;
private static final int ITEM_ID_FEED = -2;
private static final int ITEM_ID_BOOKMARKS = -3;
private static final int ITEM_ID_DOWNLOADS = -4;
private static final int ITEM_ID_HISTORY = -5;
private static final int ITEM_ID_SETTINGS = 0;
private static final int ITEM_ID_ABOUT = 1;
@@ -107,8 +123,11 @@ public class MainActivity extends AppCompatActivity {
//////////////////////////////////////////////////////////////////////////*/
@Override
protected void onCreate(Bundle savedInstanceState) {
if (DEBUG) Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]");
protected void onCreate(final Bundle savedInstanceState) {
if (DEBUG) {
Log.d(TAG, "onCreate() called with: "
+ "savedInstanceState = [" + savedInstanceState + "]");
}
// enable TLS1.1/1.2 for kitkat devices, to fix download and play for mediaCCC sources
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
@@ -120,21 +139,21 @@ public class MainActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window w = getWindow();
w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
}
if (getSupportFragmentManager() != null && getSupportFragmentManager().getBackStackEntryCount() == 0) {
if (getSupportFragmentManager().getBackStackEntryCount() == 0) {
initFragments();
}
setSupportActionBar(findViewById(R.id.toolbar));
try {
setupDrawer();
} catch (Exception e) {
} catch (final Exception e) {
ErrorActivity.reportUiError(this, e);
}
if (DeviceUtils.isTv(this)) {
FocusOverlayView.setupFocusObserver(this);
}
openMiniPlayerUponPlayerStarted();
}
private void setupDrawer() throws Exception {
@@ -143,56 +162,59 @@ public class MainActivity extends AppCompatActivity {
drawerItems = findViewById(R.id.navigation);
//Tabs
int currentServiceId = ServiceHelper.getSelectedServiceId(this);
StreamingService service = NewPipe.getService(currentServiceId);
final int currentServiceId = ServiceHelper.getSelectedServiceId(this);
final StreamingService service = NewPipe.getService(currentServiceId);
int kioskId = 0;
for (final String ks : service.getKioskList().getAvailableKiosks()) {
drawerItems.getMenu()
.add(R.id.menu_tabs_group, kioskId, 0, KioskTranslator.getTranslatedKioskName(ks, this))
.setIcon(KioskTranslator.getKioskIcons(ks, this));
kioskId ++;
.add(R.id.menu_tabs_group, kioskId, 0, KioskTranslator
.getTranslatedKioskName(ks, this))
.setIcon(KioskTranslator.getKioskIcon(ks, this));
kioskId++;
}
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_SUBSCRIPTIONS, ORDER, R.string.tab_subscriptions)
.add(R.id.menu_tabs_group, ITEM_ID_SUBSCRIPTIONS, ORDER,
R.string.tab_subscriptions)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_channel));
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_FEED, ORDER, R.string.fragment_feed_title)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.rss));
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_rss));
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_BOOKMARKS, ORDER, R.string.tab_bookmarks)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_bookmark));
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_DOWNLOADS, ORDER, R.string.downloads)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.download));
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_file_download));
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.history));
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_history));
//Settings and About
drawerItems.getMenu()
.add(R.id.menu_options_about_group, ITEM_ID_SETTINGS, ORDER, R.string.settings)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.settings));
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_settings));
drawerItems.getMenu()
.add(R.id.menu_options_about_group, ITEM_ID_ABOUT, ORDER, R.string.tab_about)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.info));
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_info_outline));
toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.drawer_open, R.string.drawer_close);
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) {
public void onDrawerOpened(final View drawerView) {
lastService = ServiceHelper.getSelectedServiceId(MainActivity.this);
}
@Override
public void onDrawerClosed(View drawerView) {
if(servicesShown) {
public void onDrawerClosed(final View drawerView) {
if (servicesShown) {
toggleServices();
}
if (lastService != ServiceHelper.getSelectedServiceId(MainActivity.this)) {
@@ -205,7 +227,7 @@ public class MainActivity extends AppCompatActivity {
setupDrawerHeader();
}
private boolean drawerItemSelected(MenuItem item) {
private boolean drawerItemSelected(final MenuItem item) {
switch (item.getGroupId()) {
case R.id.menu_services_group:
changeService(item);
@@ -213,7 +235,7 @@ public class MainActivity extends AppCompatActivity {
case R.id.menu_tabs_group:
try {
tabSelected(item);
} catch (Exception e) {
} catch (final Exception e) {
ErrorActivity.reportUiError(this, e);
}
break;
@@ -228,14 +250,16 @@ public class MainActivity extends AppCompatActivity {
return true;
}
private void changeService(MenuItem item) {
drawerItems.getMenu().getItem(ServiceHelper.getSelectedServiceId(this)).setChecked(false);
private void changeService(final MenuItem item) {
drawerItems.getMenu().getItem(ServiceHelper.getSelectedServiceId(this))
.setChecked(false);
ServiceHelper.setSelectedServiceId(this, item.getItemId());
drawerItems.getMenu().getItem(ServiceHelper.getSelectedServiceId(this)).setChecked(true);
drawerItems.getMenu().getItem(ServiceHelper.getSelectedServiceId(this))
.setChecked(true);
}
private void tabSelected(MenuItem item) throws ExtractionException {
switch(item.getItemId()) {
private void tabSelected(final MenuItem item) throws ExtractionException {
switch (item.getItemId()) {
case ITEM_ID_SUBSCRIPTIONS:
NavigationHelper.openSubscriptionFragment(getSupportFragmentManager());
break;
@@ -252,25 +276,26 @@ public class MainActivity extends AppCompatActivity {
NavigationHelper.openStatisticFragment(getSupportFragmentManager());
break;
default:
int currentServiceId = ServiceHelper.getSelectedServiceId(this);
StreamingService service = NewPipe.getService(currentServiceId);
final int currentServiceId = ServiceHelper.getSelectedServiceId(this);
final StreamingService service = NewPipe.getService(currentServiceId);
String serviceName = "";
int kioskId = 0;
for (final String ks : service.getKioskList().getAvailableKiosks()) {
if(kioskId == item.getItemId()) {
if (kioskId == item.getItemId()) {
serviceName = ks;
}
kioskId ++;
kioskId++;
}
NavigationHelper.openKioskFragment(getSupportFragmentManager(), currentServiceId, serviceName);
NavigationHelper.openKioskFragment(getSupportFragmentManager(), currentServiceId,
serviceName);
break;
}
}
private void optionsAboutSelected(MenuItem item) {
switch(item.getItemId()) {
private void optionsAboutSelected(final MenuItem item) {
switch (item.getItemId()) {
case ITEM_ID_SETTINGS:
NavigationHelper.openSettings(this);
break;
@@ -281,15 +306,28 @@ public class MainActivity extends AppCompatActivity {
}
private void setupDrawerHeader() {
NavigationView navigationView = findViewById(R.id.navigation);
View hView = navigationView.getHeaderView(0);
final NavigationView navigationView = findViewById(R.id.navigation);
final View hView = navigationView.getHeaderView(0);
serviceArrow = hView.findViewById(R.id.drawer_arrow);
headerServiceIcon = hView.findViewById(R.id.drawer_header_service_icon);
headerServiceView = hView.findViewById(R.id.drawer_header_service_view);
toggleServiceButton = hView.findViewById(R.id.drawer_header_action_button);
toggleServiceButton.setOnClickListener(view -> {
toggleServices();
});
toggleServiceButton.setOnClickListener(view -> toggleServices());
// If the current app name is bigger than the default "NewPipe" (7 chars),
// let the text view grow a little more as well.
if (getString(R.string.app_name).length() > "NewPipe".length()) {
final TextView headerTitle = hView.findViewById(R.id.drawer_header_newpipe_title);
final ViewGroup.LayoutParams layoutParams = headerTitle.getLayoutParams();
layoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
headerTitle.setLayoutParams(layoutParams);
headerTitle.setMaxLines(2);
headerTitle.setMinWidth(getResources()
.getDimensionPixelSize(R.dimen.drawer_header_newpipe_title_default_width));
headerTitle.setMaxWidth(getResources()
.getDimensionPixelSize(R.dimen.drawer_header_newpipe_title_max_width));
}
}
private void toggleServices() {
@@ -299,70 +337,76 @@ public class MainActivity extends AppCompatActivity {
drawerItems.getMenu().removeGroup(R.id.menu_tabs_group);
drawerItems.getMenu().removeGroup(R.id.menu_options_about_group);
if(servicesShown) {
if (servicesShown) {
showServices();
} else {
try {
showTabs();
} catch (Exception e) {
} catch (final Exception e) {
ErrorActivity.reportUiError(this, e);
}
}
}
private void showServices() {
serviceArrow.setImageResource(R.drawable.ic_arrow_up_white);
serviceArrow.setImageResource(R.drawable.ic_arrow_drop_up_white_24dp);
for(StreamingService s : NewPipe.getServices()) {
final String title = s.getServiceInfo().getName() +
(ServiceHelper.isBeta(s) ? " (beta)" : "");
for (final StreamingService s : NewPipe.getServices()) {
final String title = s.getServiceInfo().getName()
+ (ServiceHelper.isBeta(s) ? " (beta)" : "");
MenuItem menuItem = drawerItems.getMenu()
final MenuItem menuItem = drawerItems.getMenu()
.add(R.id.menu_services_group, s.getServiceId(), ORDER, title)
.setIcon(ServiceHelper.getIcon(s.getServiceId()));
// peertube specifics
if(s.getServiceId() == 3){
if (s.getServiceId() == 3) {
enhancePeertubeMenu(s, menuItem);
}
}
drawerItems.getMenu().getItem(ServiceHelper.getSelectedServiceId(this)).setChecked(true);
drawerItems.getMenu().getItem(ServiceHelper.getSelectedServiceId(this))
.setChecked(true);
}
private void enhancePeertubeMenu(StreamingService s, MenuItem menuItem) {
PeertubeInstance currentInstace = PeertubeHelper.getCurrentInstance();
private void enhancePeertubeMenu(final StreamingService s, final MenuItem menuItem) {
final PeertubeInstance currentInstace = PeertubeHelper.getCurrentInstance();
menuItem.setTitle(currentInstace.getName() + (ServiceHelper.isBeta(s) ? " (beta)" : ""));
Spinner spinner = (Spinner) LayoutInflater.from(this).inflate(R.layout.instance_spinner_layout, null);
List<PeertubeInstance> instances = PeertubeHelper.getInstanceList(this);
List<String> items = new ArrayList<>();
final Spinner spinner = (Spinner) LayoutInflater.from(this)
.inflate(R.layout.instance_spinner_layout, null);
final List<PeertubeInstance> instances = PeertubeHelper.getInstanceList(this);
final List<String> items = new ArrayList<>();
int defaultSelect = 0;
for(PeertubeInstance instance: instances){
for (final PeertubeInstance instance : instances) {
items.add(instance.getName());
if(instance.getUrl().equals(currentInstace.getUrl())){
defaultSelect = items.size()-1;
if (instance.getUrl().equals(currentInstace.getUrl())) {
defaultSelect = items.size() - 1;
}
}
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, R.layout.instance_spinner_item, items);
final ArrayAdapter<String> adapter = new ArrayAdapter<>(this,
R.layout.instance_spinner_item, items);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
spinner.setSelection(defaultSelect, false);
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
PeertubeInstance newInstance = instances.get(position);
if(newInstance.getUrl().equals(PeertubeHelper.getCurrentInstance().getUrl())) return;
public void onItemSelected(final AdapterView<?> parent, final View view,
final int position, final long id) {
final PeertubeInstance newInstance = instances.get(position);
if (newInstance.getUrl().equals(PeertubeHelper.getCurrentInstance().getUrl())) {
return;
}
PeertubeHelper.selectInstance(newInstance, getApplicationContext());
changeService(menuItem);
drawer.closeDrawers();
new Handler(Looper.getMainLooper()).postDelayed(() -> {
getSupportFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
getSupportFragmentManager().popBackStack(null,
FragmentManager.POP_BACK_STACK_INCLUSIVE);
recreate();
}, 300);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
public void onNothingSelected(final AdapterView<?> parent) {
}
});
@@ -370,19 +414,20 @@ public class MainActivity extends AppCompatActivity {
}
private void showTabs() throws ExtractionException {
serviceArrow.setImageResource(R.drawable.ic_arrow_down_white);
serviceArrow.setImageResource(R.drawable.ic_arrow_drop_down_white_24dp);
//Tabs
int currentServiceId = ServiceHelper.getSelectedServiceId(this);
StreamingService service = NewPipe.getService(currentServiceId);
final int currentServiceId = ServiceHelper.getSelectedServiceId(this);
final StreamingService service = NewPipe.getService(currentServiceId);
int kioskId = 0;
for (final String ks : service.getKioskList().getAvailableKiosks()) {
drawerItems.getMenu()
.add(R.id.menu_tabs_group, kioskId, ORDER, KioskTranslator.getTranslatedKioskName(ks, this))
.setIcon(KioskTranslator.getKioskIcons(ks, this));
kioskId ++;
.add(R.id.menu_tabs_group, kioskId, ORDER,
KioskTranslator.getTranslatedKioskName(ks, this))
.setIcon(KioskTranslator.getKioskIcon(ks, this));
kioskId++;
}
drawerItems.getMenu()
@@ -390,24 +435,24 @@ public class MainActivity extends AppCompatActivity {
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_channel));
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_FEED, ORDER, R.string.fragment_feed_title)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.rss));
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_rss));
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_BOOKMARKS, ORDER, R.string.tab_bookmarks)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_bookmark));
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_DOWNLOADS, ORDER, R.string.downloads)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.download));
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_file_download));
drawerItems.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.history));
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_history));
//Settings and About
drawerItems.getMenu()
.add(R.id.menu_options_about_group, ITEM_ID_SETTINGS, ORDER, R.string.settings)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.settings));
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_settings));
drawerItems.getMenu()
.add(R.id.menu_options_about_group, ITEM_ID_ABOUT, ORDER, R.string.tab_about)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.info));
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_info_outline));
}
@Override
@@ -416,39 +461,52 @@ public class MainActivity extends AppCompatActivity {
if (!isChangingConfigurations()) {
StateSaver.clearStateFiles();
}
if (broadcastReceiver != null) {
unregisterReceiver(broadcastReceiver);
}
}
@Override
protected void onResume() {
assureCorrectAppLanguage(this);
Localization.init(getApplicationContext()); //change the date format to match the selected language on resume
// Change the date format to match the selected language on resume
Localization.init(getApplicationContext());
super.onResume();
// close drawer on return, and don't show animation, so its looks like the drawer isn't open
// when the user returns to MainActivity
// Close drawer on return, and don't show animation,
// so it looks like the drawer isn't open when the user returns to MainActivity
drawer.closeDrawer(GravityCompat.START, false);
try {
String selectedServiceName = NewPipe.getService(
ServiceHelper.getSelectedServiceId(this)).getServiceInfo().getName();
final int selectedServiceId = ServiceHelper.getSelectedServiceId(this);
final String selectedServiceName = NewPipe.getService(selectedServiceId)
.getServiceInfo().getName();
headerServiceView.setText(selectedServiceName);
headerServiceIcon.setImageResource(ServiceHelper.getIcon(selectedServiceId));
headerServiceView.post(() -> headerServiceView.setSelected(true));
toggleServiceButton.setContentDescription(
getString(R.string.drawer_header_description) + selectedServiceName);
} catch (Exception e) {
} catch (final Exception e) {
ErrorActivity.reportUiError(this, e);
}
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
final SharedPreferences sharedPreferences
= PreferenceManager.getDefaultSharedPreferences(this);
if (sharedPreferences.getBoolean(Constants.KEY_THEME_CHANGE, false)) {
if (DEBUG) Log.d(TAG, "Theme has changed, recreating activity...");
if (DEBUG) {
Log.d(TAG, "Theme has changed, recreating activity...");
}
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
// https://stackoverflow.com/questions/10844112/
// Briefly, let the activity resume
// properly posting the recreate call to end of the message queue
new Handler(Looper.getMainLooper()).post(MainActivity.this::recreate);
}
if (sharedPreferences.getBoolean(Constants.KEY_MAIN_PAGE_CHANGE, false)) {
if (DEBUG) Log.d(TAG, "main page has changed, recreating main fragment...");
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);
}
@@ -459,13 +517,18 @@ public class MainActivity extends AppCompatActivity {
}
@Override
protected void onNewIntent(Intent intent) {
if (DEBUG) Log.d(TAG, "onNewIntent() called with: intent = [" + intent + "]");
protected void onNewIntent(final Intent intent) {
if (DEBUG) {
Log.d(TAG, "onNewIntent() called with: intent = [" + intent + "]");
}
if (intent != null) {
// Return if launched from a launcher (e.g. Nova Launcher, Pixel Launcher ...)
// to not destroy the already created backstack
String action = intent.getAction();
if ((action != null && action.equals(Intent.ACTION_MAIN)) && intent.hasCategory(Intent.CATEGORY_LAUNCHER)) return;
final String action = intent.getAction();
if ((action != null && action.equals(Intent.ACTION_MAIN))
&& intent.hasCategory(Intent.CATEGORY_LAUNCHER)) {
return;
}
}
super.onNewIntent(intent);
@@ -474,25 +537,76 @@ public class MainActivity extends AppCompatActivity {
}
@Override
public void onBackPressed() {
if (DEBUG) Log.d(TAG, "onBackPressed() called");
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_holder);
// If current fragment implements BackPressable (i.e. can/wanna handle back press) delegate the back press to it
if (fragment instanceof BackPressable) {
if (((BackPressable) fragment).onBackPressed()) return;
public boolean onKeyDown(final int keyCode, final KeyEvent event) {
final Fragment fragment = getSupportFragmentManager()
.findFragmentById(R.id.fragment_player_holder);
if (fragment instanceof OnKeyDownListener
&& !bottomSheetHiddenOrCollapsed()) {
// Provide keyDown event to fragment which then sends this event
// to the main player service
return ((OnKeyDownListener) fragment).onKeyDown(keyCode)
|| super.onKeyDown(keyCode, event);
}
if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
finish();
} else super.onBackPressed();
return super.onKeyDown(keyCode, event);
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
for (int i: grantResults){
if (i == PackageManager.PERMISSION_DENIED){
public void onBackPressed() {
if (DEBUG) {
Log.d(TAG, "onBackPressed() called");
}
if (DeviceUtils.isTv(this)) {
final View drawerPanel = findViewById(R.id.navigation);
if (drawer.isDrawerOpen(drawerPanel)) {
drawer.closeDrawers();
return;
}
}
// In case bottomSheet is not visible on the screen or collapsed we can assume that the user
// interacts with a fragment inside fragment_holder so all back presses should be
// handled by it
if (bottomSheetHiddenOrCollapsed()) {
final Fragment fragment = getSupportFragmentManager()
.findFragmentById(R.id.fragment_holder);
// If current fragment implements BackPressable (i.e. can/wanna handle back press)
// delegate the back press to it
if (fragment instanceof BackPressable) {
if (((BackPressable) fragment).onBackPressed()) {
return;
}
}
} else {
final Fragment fragmentPlayer = getSupportFragmentManager()
.findFragmentById(R.id.fragment_player_holder);
// If current fragment implements BackPressable (i.e. can/wanna handle back press)
// delegate the back press to it
if (fragmentPlayer instanceof BackPressable) {
if (!((BackPressable) fragmentPlayer).onBackPressed()) {
final FrameLayout bottomSheetLayout =
findViewById(R.id.fragment_player_holder);
BottomSheetBehavior.from(bottomSheetLayout)
.setState(BottomSheetBehavior.STATE_COLLAPSED);
}
return;
}
}
if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
finish();
} else {
super.onBackPressed();
}
}
@Override
public void onRequestPermissionsResult(final int requestCode,
@NonNull final String[] permissions,
@NonNull final int[] grantResults) {
for (final int i : grantResults) {
if (i == PackageManager.PERMISSION_DENIED) {
return;
}
}
@@ -501,7 +615,8 @@ public class MainActivity extends AppCompatActivity {
NavigationHelper.openDownloads(this);
break;
case PermissionHelper.DOWNLOAD_DIALOG_REQUEST_CODE:
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_holder);
final Fragment fragment = getSupportFragmentManager()
.findFragmentById(R.id.fragment_player_holder);
if (fragment instanceof VideoDetailFragment) {
((VideoDetailFragment) fragment).openDownloadDialog();
}
@@ -546,21 +661,20 @@ public class MainActivity extends AppCompatActivity {
//////////////////////////////////////////////////////////////////////////*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (DEBUG) Log.d(TAG, "onCreateOptionsMenu() called with: menu = [" + menu + "]");
public boolean onCreateOptionsMenu(final Menu menu) {
if (DEBUG) {
Log.d(TAG, "onCreateOptionsMenu() called with: menu = [" + menu + "]");
}
super.onCreateOptionsMenu(menu);
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_holder);
if (!(fragment instanceof VideoDetailFragment)) {
findViewById(R.id.toolbar).findViewById(R.id.toolbar_spinner).setVisibility(View.GONE);
}
final Fragment fragment
= getSupportFragmentManager().findFragmentById(R.id.fragment_holder);
if (!(fragment instanceof SearchFragment)) {
findViewById(R.id.toolbar).findViewById(R.id.toolbar_search_container).setVisibility(View.GONE);
findViewById(R.id.toolbar).findViewById(R.id.toolbar_search_container)
.setVisibility(View.GONE);
}
ActionBar actionBar = getSupportActionBar();
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(false);
}
@@ -571,9 +685,11 @@ public class MainActivity extends AppCompatActivity {
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (DEBUG) Log.d(TAG, "onOptionsItemSelected() called with: item = [" + item + "]");
int id = item.getItemId();
public boolean onOptionsItemSelected(final MenuItem item) {
if (DEBUG) {
Log.d(TAG, "onOptionsItemSelected() called with: item = [" + item + "]");
}
final int id = item.getItemId();
switch (id) {
case android.R.id.home:
@@ -589,11 +705,22 @@ public class MainActivity extends AppCompatActivity {
//////////////////////////////////////////////////////////////////////////*/
private void initFragments() {
if (DEBUG) Log.d(TAG, "initFragments() called");
if (DEBUG) {
Log.d(TAG, "initFragments() called");
}
StateSaver.clearStateFiles();
if (getIntent() != null && getIntent().hasExtra(Constants.KEY_LINK_TYPE)) {
// When user watch a video inside popup and then tries to open the video in main player
// while the app is closed he will see a blank fragment on place of kiosk.
// Let's open it first
if (getSupportFragmentManager().getBackStackEntryCount() == 0) {
NavigationHelper.openMainFragment(getSupportFragmentManager());
}
handleIntent(getIntent());
} else NavigationHelper.gotoMainFragment(getSupportFragmentManager());
} else {
NavigationHelper.gotoMainFragment(getSupportFragmentManager());
}
}
/*//////////////////////////////////////////////////////////////////////////
@@ -601,12 +728,14 @@ public class MainActivity extends AppCompatActivity {
//////////////////////////////////////////////////////////////////////////*/
private void updateDrawerNavigation() {
if (getSupportActionBar() == null) return;
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);
final Fragment fragment = getSupportFragmentManager()
.findFragmentById(R.id.fragment_holder);
if (fragment instanceof MainFragment) {
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
if (toggle != null) {
@@ -621,44 +750,53 @@ public class MainActivity extends AppCompatActivity {
}
}
private void updateDrawerHeaderString(String content) {
NavigationView navigationView = findViewById(R.id.navigation);
View hView = navigationView.getHeaderView(0);
Button action = hView.findViewById(R.id.drawer_header_action_button);
action.setContentDescription(content);
}
private void handleIntent(Intent intent) {
private void handleIntent(final Intent intent) {
try {
if (DEBUG) Log.d(TAG, "handleIntent() called with: intent = [" + intent + "]");
if (DEBUG) {
Log.d(TAG, "handleIntent() called with: intent = [" + intent + "]");
}
if (intent.hasExtra(Constants.KEY_LINK_TYPE)) {
String url = intent.getStringExtra(Constants.KEY_URL);
int serviceId = intent.getIntExtra(Constants.KEY_SERVICE_ID, 0);
final String url = intent.getStringExtra(Constants.KEY_URL);
final int serviceId = intent.getIntExtra(Constants.KEY_SERVICE_ID, 0);
String title = intent.getStringExtra(Constants.KEY_TITLE);
switch (((StreamingService.LinkType) intent.getSerializableExtra(Constants.KEY_LINK_TYPE))) {
if (title == null) {
title = "";
}
final StreamingService.LinkType linkType = ((StreamingService.LinkType) intent
.getSerializableExtra(Constants.KEY_LINK_TYPE));
assert linkType != null;
switch (linkType) {
case STREAM:
boolean autoPlay = intent.getBooleanExtra(VideoDetailFragment.AUTO_PLAY, false);
NavigationHelper.openVideoDetailFragment(getSupportFragmentManager(), serviceId, url, title, autoPlay);
final String intentCacheKey = intent.getStringExtra(
VideoPlayer.PLAY_QUEUE_KEY);
final PlayQueue playQueue = intentCacheKey != null
? SerializedCache.getInstance()
.take(intentCacheKey, PlayQueue.class)
: null;
final boolean switchingPlayers = intent.getBooleanExtra(
VideoDetailFragment.KEY_SWITCHING_PLAYERS, false);
NavigationHelper.openVideoDetailFragment(
getApplicationContext(), getSupportFragmentManager(),
serviceId, url, title, playQueue, switchingPlayers);
break;
case CHANNEL:
NavigationHelper.openChannelFragment(getSupportFragmentManager(),
serviceId,
url,
title);
serviceId, url, title);
break;
case PLAYLIST:
NavigationHelper.openPlaylistFragment(getSupportFragmentManager(),
serviceId,
url,
title);
serviceId, url, title);
break;
}
} else if (intent.hasExtra(Constants.KEY_OPEN_SEARCH)) {
String searchString = intent.getStringExtra(Constants.KEY_SEARCH_STRING);
if (searchString == null) searchString = "";
int serviceId = intent.getIntExtra(Constants.KEY_SERVICE_ID, 0);
if (searchString == null) {
searchString = "";
}
final int serviceId = intent.getIntExtra(Constants.KEY_SERVICE_ID, 0);
NavigationHelper.openSearchFragment(
getSupportFragmentManager(),
serviceId,
@@ -667,8 +805,61 @@ public class MainActivity extends AppCompatActivity {
} else {
NavigationHelper.gotoMainFragment(getSupportFragmentManager());
}
} catch (Exception e) {
} catch (final Exception e) {
ErrorActivity.reportUiError(this, e);
}
}
private void openMiniPlayerIfMissing() {
final Fragment fragmentPlayer = getSupportFragmentManager()
.findFragmentById(R.id.fragment_player_holder);
if (fragmentPlayer == null) {
// We still don't have a fragment attached to the activity. It can happen when a user
// started popup or background players without opening a stream inside the fragment.
// Adding it in a collapsed state (only mini player will be visible).
NavigationHelper.showMiniPlayer(getSupportFragmentManager());
}
}
private void openMiniPlayerUponPlayerStarted() {
if (getIntent().getSerializableExtra(Constants.KEY_LINK_TYPE)
== StreamingService.LinkType.STREAM) {
// handleIntent() already takes care of opening video detail fragment
// due to an intent containing a STREAM link
return;
}
if (PlayerHolder.isPlayerOpen()) {
// if the player is already open, no need for a broadcast receiver
openMiniPlayerIfMissing();
} else {
// listen for player start intent being sent around
broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(final Context context, final Intent intent) {
if (Objects.equals(intent.getAction(),
VideoDetailFragment.ACTION_PLAYER_STARTED)) {
openMiniPlayerIfMissing();
// At this point the player is added 100%, we can unregister. Other actions
// are useless since the fragment will not be removed after that.
unregisterReceiver(broadcastReceiver);
broadcastReceiver = null;
}
}
};
final IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(VideoDetailFragment.ACTION_PLAYER_STARTED);
registerReceiver(broadcastReceiver, intentFilter);
}
}
private boolean bottomSheetHiddenOrCollapsed() {
final FrameLayout bottomSheetLayout = findViewById(R.id.fragment_player_holder);
final BottomSheetBehavior<FrameLayout> bottomSheetBehavior =
BottomSheetBehavior.from(bottomSheetLayout);
final int sheetState = bottomSheetBehavior.getState();
return sheetState == BottomSheetBehavior.STATE_HIDDEN
|| sheetState == BottomSheetBehavior.STATE_COLLAPSED;
}
}

View File

@@ -13,14 +13,13 @@ import static org.schabi.newpipe.database.Migrations.MIGRATION_1_2;
import static org.schabi.newpipe.database.Migrations.MIGRATION_2_3;
public final class NewPipeDatabase {
private static volatile AppDatabase databaseInstance;
private NewPipeDatabase() {
//no instance
}
private static AppDatabase getDatabase(Context context) {
private static AppDatabase getDatabase(final Context context) {
return Room
.databaseBuilder(context.getApplicationContext(), AppDatabase.class, DATABASE_NAME)
.addMigrations(MIGRATION_1_2, MIGRATION_2_3)
@@ -28,13 +27,14 @@ public final class NewPipeDatabase {
}
@NonNull
public static AppDatabase getInstance(@NonNull Context context) {
public static AppDatabase getInstance(@NonNull final Context context) {
AppDatabase result = databaseInstance;
if (result == null) {
synchronized (NewPipeDatabase.class) {
result = databaseInstance;
if (result == null) {
databaseInstance = (result = getDatabase(context));
databaseInstance = getDatabase(context);
result = databaseInstance;
}
}
}
@@ -46,7 +46,7 @@ public final class NewPipeDatabase {
if (databaseInstance == null) {
throw new IllegalStateException("database is not initialized");
}
Cursor c = databaseInstance.query("pragma wal_checkpoint(full)", null);
final Cursor c = databaseInstance.query("pragma wal_checkpoint(full)", null);
if (c.moveToFirst() && c.getInt(0) == 1) {
throw new RuntimeException("Checkpoint was blocked from completing");
}

View File

@@ -1,4 +1,3 @@
package org.schabi.newpipe;
import android.annotation.SuppressLint;
@@ -26,21 +25,22 @@ import android.os.Bundle;
*/
public class PanicResponderActivity extends Activity {
public static final String PANIC_TRIGGER_ACTION = "info.guardianproject.panic.action.TRIGGER";
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
final Intent intent = getIntent();
if (intent != null && PANIC_TRIGGER_ACTION.equals(intent.getAction())) {
// TODO explicitly clear the search results once they are restored when the app restarts
// or if the app reloads the current video after being killed, that should be cleared also
// TODO: Explicitly clear the search results
// once they are restored when the app restarts
// or if the app reloads the current video after being killed,
// that should be cleared also
ExitActivity.exitAndRemoveFromRecentApps(this);
}
if (Build.VERSION.SDK_INT >= 21) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
finishAndRemoveTask();
} else {
finish();

View File

@@ -1,24 +1,31 @@
package org.schabi.newpipe;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import androidx.core.app.NavUtils;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.CookieManager;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.NavUtils;
import androidx.preference.PreferenceManager;
import org.schabi.newpipe.util.ThemeHelper;
import androidx.annotation.NonNull;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
/*
* Created by beneth <bmauduit@beneth.fr> on 06.12.16.
@@ -44,16 +51,17 @@ public class ReCaptchaActivity extends AppCompatActivity {
public static final String RECAPTCHA_URL_EXTRA = "recaptcha_url_extra";
public static final String TAG = ReCaptchaActivity.class.toString();
public static final String YT_URL = "https://www.youtube.com";
public static final String RECAPTCHA_COOKIES_KEY = "recaptcha_cookies";
private WebView webView;
private String foundCookies = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(final Bundle savedInstanceState) {
ThemeHelper.setTheme(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recaptcha);
Toolbar toolbar = findViewById(R.id.toolbar);
final Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
String url = getIntent().getStringExtra(RECAPTCHA_URL_EXTRA);
@@ -68,23 +76,47 @@ public class ReCaptchaActivity extends AppCompatActivity {
webView = findViewById(R.id.reCaptchaWebView);
// enable Javascript
WebSettings webSettings = webView.getSettings();
final WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient() {
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public void onPageFinished(WebView view, String url) {
public boolean shouldOverrideUrlLoading(final WebView view,
final WebResourceRequest request) {
final String url = request.getUrl().toString();
if (MainActivity.DEBUG) {
Log.d(TAG, "shouldOverrideUrlLoading: request.url=" + url);
}
handleCookiesFromUrl(url);
return false;
}
@Override
public boolean shouldOverrideUrlLoading(final WebView view, final String url) {
if (MainActivity.DEBUG) {
Log.d(TAG, "shouldOverrideUrlLoading: url=" + url);
}
handleCookiesFromUrl(url);
return false;
}
@Override
public void onPageFinished(final WebView view, final String url) {
super.onPageFinished(view, url);
handleCookies(url);
handleCookiesFromUrl(url);
}
});
// cleaning cache, history and cookies from webView
webView.clearCache(true);
webView.clearHistory();
android.webkit.CookieManager cookieManager = CookieManager.getInstance();
final android.webkit.CookieManager cookieManager = CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
cookieManager.removeAllCookies(aBoolean -> {});
cookieManager.removeAllCookies(aBoolean -> {
});
} else {
cookieManager.removeAllCookie();
}
@@ -93,10 +125,10 @@ public class ReCaptchaActivity extends AppCompatActivity {
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
public boolean onCreateOptionsMenu(final Menu menu) {
getMenuInflater().inflate(R.menu.menu_recaptcha, menu);
ActionBar actionBar = getSupportActionBar();
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setTitle(R.string.title_activity_recaptcha);
@@ -112,8 +144,8 @@ public class ReCaptchaActivity extends AppCompatActivity {
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
public boolean onOptionsItemSelected(final MenuItem item) {
final int id = item.getItemId();
switch (id) {
case R.id.menu_item_done:
saveCookiesAndFinish();
@@ -124,37 +156,83 @@ public class ReCaptchaActivity extends AppCompatActivity {
}
private void saveCookiesAndFinish() {
handleCookies(webView.getUrl()); // try to get cookies of unclosed page
handleCookiesFromUrl(webView.getUrl()); // try to get cookies of unclosed page
if (MainActivity.DEBUG) {
Log.d(TAG, "saveCookiesAndFinish: foundCookies=" + foundCookies);
}
if (!foundCookies.isEmpty()) {
// save cookies to preferences
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(
getApplicationContext());
final String key = getApplicationContext().getString(R.string.recaptcha_cookies_key);
prefs.edit().putString(key, foundCookies).apply();
// give cookies to Downloader class
DownloaderImpl.getInstance().setCookies(foundCookies);
DownloaderImpl.getInstance().setCookie(RECAPTCHA_COOKIES_KEY, foundCookies);
setResult(RESULT_OK);
}
Intent intent = new Intent(this, org.schabi.newpipe.MainActivity.class);
final Intent intent = new Intent(this, org.schabi.newpipe.MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
NavUtils.navigateUpTo(this, intent);
}
private void handleCookiesFromUrl(@Nullable final String url) {
if (MainActivity.DEBUG) {
Log.d(TAG, "handleCookiesFromUrl: url=" + (url == null ? "null" : url));
}
private void handleCookies(String url) {
String cookies = CookieManager.getInstance().getCookie(url);
if (MainActivity.DEBUG) Log.d(TAG, "handleCookies: url=" + url + "; cookies=" + (cookies == null ? "null" : cookies));
if (cookies == null) return;
if (url == null) {
return;
}
addYoutubeCookies(cookies);
// add other methods to extract cookies here
final String cookies = CookieManager.getInstance().getCookie(url);
handleCookies(cookies);
// sometimes cookies are inside the url
final int abuseStart = url.indexOf("google_abuse=");
if (abuseStart != -1) {
final int abuseEnd = url.indexOf("+path");
try {
String abuseCookie = url.substring(abuseStart + 13, abuseEnd);
abuseCookie = URLDecoder.decode(abuseCookie, "UTF-8");
handleCookies(abuseCookie);
} catch (UnsupportedEncodingException | StringIndexOutOfBoundsException e) {
if (MainActivity.DEBUG) {
e.printStackTrace();
Log.d(TAG, "handleCookiesFromUrl: invalid google abuse starting at "
+ abuseStart + " and ending at " + abuseEnd + " for url " + url);
}
}
}
}
private void addYoutubeCookies(@NonNull String cookies) {
if (cookies.contains("s_gl=") || cookies.contains("goojf=") || cookies.contains("VISITOR_INFO1_LIVE=")) {
private void handleCookies(@Nullable final String cookies) {
if (MainActivity.DEBUG) {
Log.d(TAG, "handleCookies: cookies=" + (cookies == null ? "null" : cookies));
}
if (cookies == null) {
return;
}
addYoutubeCookies(cookies);
// add here methods to extract cookies for other services
}
private void addYoutubeCookies(@NonNull final String cookies) {
if (cookies.contains("s_gl=") || cookies.contains("goojf=")
|| cookies.contains("VISITOR_INFO1_LIVE=")
|| cookies.contains("GOOGLE_ABUSE_EXEMPTION=")) {
// youtube seems to also need the other cookies:
addCookie(cookies);
}
}
private void addCookie(String cookie) {
private void addCookie(final String cookie) {
if (foundCookies.contains(cookie)) {
return;
}

View File

@@ -8,7 +8,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
@@ -25,8 +24,11 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.app.NotificationCompat;
import androidx.core.widget.TextViewCompat;
import androidx.fragment.app.FragmentManager;
import androidx.preference.PreferenceManager;
import org.schabi.newpipe.download.DownloadDialog;
import org.schabi.newpipe.extractor.Info;
@@ -38,18 +40,24 @@ import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.playlist.PlaylistInfo;
import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.extractor.stream.VideoStream;
import org.schabi.newpipe.player.MainPlayer;
import org.schabi.newpipe.player.helper.PlayerHelper;
import org.schabi.newpipe.player.helper.PlayerHolder;
import org.schabi.newpipe.player.playqueue.ChannelPlayQueue;
import org.schabi.newpipe.player.playqueue.PlayQueue;
import org.schabi.newpipe.player.playqueue.PlaylistPlayQueue;
import org.schabi.newpipe.player.playqueue.SinglePlayQueue;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.DeviceUtils;
import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.ListHelper;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PermissionHelper;
import org.schabi.newpipe.util.ShareUtils;
import org.schabi.newpipe.util.ThemeHelper;
import org.schabi.newpipe.util.urlfinder.UrlFinder;
import org.schabi.newpipe.views.FocusOverlayView;
import java.io.Serializable;
import java.util.ArrayList;
@@ -58,42 +66,44 @@ import java.util.List;
import icepick.Icepick;
import icepick.State;
import io.reactivex.Observable;
import io.reactivex.Single;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.schedulers.Schedulers;
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.AUDIO;
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.VIDEO;
import static org.schabi.newpipe.util.ThemeHelper.resolveResourceIdFromAttr;
/**
* Get the url from the intent and open it in the chosen preferred player
* Get the url from the intent and open it in the chosen preferred player.
*/
public class RouterActivity extends AppCompatActivity {
public static final String INTERNAL_ROUTE_KEY = "internalRoute";
/**
* Removes invisible separators (\p{Z}) and punctuation characters including
* brackets (\p{P}). See http://www.regular-expressions.info/unicode.html for
* more details.
*/
private static final String REGEX_REMOVE_FROM_URL = "[\\p{Z}\\p{P}]";
protected final CompositeDisposable disposables = new CompositeDisposable();
@State
protected int currentServiceId = -1;
private StreamingService currentService;
@State
protected LinkType currentLinkType;
@State
protected int selectedRadioPosition = -1;
protected int selectedPreviously = -1;
protected String currentUrl;
protected boolean internalRoute = false;
protected final CompositeDisposable disposables = new CompositeDisposable();
private StreamingService currentService;
private boolean selectionIsDownload = false;
public static final String internalRouteKey = "internalRoute";
@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Icepick.restoreInstanceState(this, savedInstanceState);
@@ -106,14 +116,12 @@ public class RouterActivity extends AppCompatActivity {
}
}
internalRoute = getIntent().getBooleanExtra(internalRouteKey, false);
setTheme(ThemeHelper.isLightThemeSelected(this)
? R.style.RouterActivityThemeLight : R.style.RouterActivityThemeDark);
}
@Override
protected void onSaveInstanceState(Bundle outState) {
protected void onSaveInstanceState(final Bundle outState) {
super.onSaveInstanceState(outState);
Icepick.saveInstanceState(this, outState);
}
@@ -132,7 +140,7 @@ public class RouterActivity extends AppCompatActivity {
disposables.clear();
}
private void handleUrl(String url) {
private void handleUrl(final String url) {
disposables.add(Observable
.fromCallable(() -> {
if (currentServiceId == -1) {
@@ -152,31 +160,44 @@ public class RouterActivity extends AppCompatActivity {
if (result) {
onSuccess();
} else {
onError();
showUnsupportedUrlDialog(url);
}
}, this::handleError));
}, throwable -> handleError(throwable, url)));
}
private void handleError(Throwable error) {
error.printStackTrace();
private void handleError(final Throwable throwable, final String url) {
throwable.printStackTrace();
if (error instanceof ExtractionException) {
Toast.makeText(this, R.string.url_not_supported_toast, Toast.LENGTH_LONG).show();
if (throwable instanceof ExtractionException) {
showUnsupportedUrlDialog(url);
} else {
ExtractorHelper.handleGeneralException(this, -1, null, error, UserAction.SOMETHING_ELSE, null);
ExtractorHelper.handleGeneralException(this, -1, url, throwable,
UserAction.SOMETHING_ELSE, null);
finish();
}
finish();
}
private void onError() {
Toast.makeText(this, R.string.url_not_supported_toast, Toast.LENGTH_LONG).show();
finish();
private void showUnsupportedUrlDialog(final String url) {
final Context context = getThemeWrapperContext();
new AlertDialog.Builder(context)
.setTitle(R.string.unsupported_url)
.setMessage(R.string.unsupported_url_dialog_message)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_share))
.setPositiveButton(R.string.open_in_browser,
(dialog, which) -> ShareUtils.openUrlInBrowser(this, url))
.setNegativeButton(R.string.share,
(dialog, which) -> ShareUtils.shareUrl(this, "", url)) // no subject
.setNeutralButton(R.string.cancel, null)
.setOnDismissListener(dialog -> finish())
.show();
}
protected void onSuccess() {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
final String selectedChoiceKey = preferences.getString(getString(R.string.preferred_open_action_key), getString(R.string.preferred_open_action_default));
final SharedPreferences preferences = PreferenceManager
.getDefaultSharedPreferences(this);
final String selectedChoiceKey = preferences
.getString(getString(R.string.preferred_open_action_key),
getString(R.string.preferred_open_action_default));
final String showInfoKey = getString(R.string.show_info_key);
final String videoPlayerKey = getString(R.string.video_player_key);
@@ -186,7 +207,8 @@ public class RouterActivity extends AppCompatActivity {
final String alwaysAskKey = getString(R.string.always_ask_open_action_key);
if (selectedChoiceKey.equals(alwaysAskKey)) {
final List<AdapterChoiceItem> choices = getChoicesForService(currentService, currentLinkType);
final List<AdapterChoiceItem> choices
= getChoicesForService(currentService, currentLinkType);
switch (choices.size()) {
case 1:
@@ -204,20 +226,26 @@ public class RouterActivity extends AppCompatActivity {
} else if (selectedChoiceKey.equals(downloadKey)) {
handleChoice(downloadKey);
} else {
final boolean isExtVideoEnabled = preferences.getBoolean(getString(R.string.use_external_video_player_key), false);
final boolean isExtAudioEnabled = preferences.getBoolean(getString(R.string.use_external_audio_player_key), false);
final boolean isVideoPlayerSelected = selectedChoiceKey.equals(videoPlayerKey) || selectedChoiceKey.equals(popupPlayerKey);
final boolean isExtVideoEnabled = preferences.getBoolean(
getString(R.string.use_external_video_player_key), false);
final boolean isExtAudioEnabled = preferences.getBoolean(
getString(R.string.use_external_audio_player_key), false);
final boolean isVideoPlayerSelected = selectedChoiceKey.equals(videoPlayerKey)
|| selectedChoiceKey.equals(popupPlayerKey);
final boolean isAudioPlayerSelected = selectedChoiceKey.equals(backgroundPlayerKey);
if (currentLinkType != LinkType.STREAM) {
if (isExtAudioEnabled && isAudioPlayerSelected || isExtVideoEnabled && isVideoPlayerSelected) {
Toast.makeText(this, R.string.external_player_unsupported_link_type, Toast.LENGTH_LONG).show();
if (isExtAudioEnabled && isAudioPlayerSelected
|| isExtVideoEnabled && isVideoPlayerSelected) {
Toast.makeText(this, R.string.external_player_unsupported_link_type,
Toast.LENGTH_LONG).show();
handleChoice(showInfoKey);
return;
}
}
final List<StreamingService.ServiceInfo.MediaCapability> capabilities = currentService.getServiceInfo().getMediaCapabilities();
final List<StreamingService.ServiceInfo.MediaCapability> capabilities
= currentService.getServiceInfo().getMediaCapabilities();
boolean serviceSupportsChoice = false;
if (isVideoPlayerSelected) {
@@ -239,7 +267,8 @@ public class RouterActivity extends AppCompatActivity {
final Context themeWrapperContext = getThemeWrapperContext();
final LayoutInflater inflater = LayoutInflater.from(themeWrapperContext);
final LinearLayout rootLayout = (LinearLayout) inflater.inflate(R.layout.preferred_player_dialog_view, null, false);
final LinearLayout rootLayout = (LinearLayout) inflater.inflate(
R.layout.single_choice_dialog_view, null, false);
final RadioGroup radioGroup = rootLayout.findViewById(android.R.id.list);
final DialogInterface.OnClickListener dialogButtonsClickListener = (dialog, which) -> {
@@ -249,8 +278,11 @@ public class RouterActivity extends AppCompatActivity {
handleChoice(choice.key);
// open future streams always like this one, because "always" button was used by user
if (which == DialogInterface.BUTTON_POSITIVE) {
preferences.edit().putString(getString(R.string.preferred_open_action_key), choice.key).apply();
preferences.edit()
.putString(getString(R.string.preferred_open_action_key), choice.key)
.apply();
}
};
@@ -261,7 +293,9 @@ public class RouterActivity extends AppCompatActivity {
.setNegativeButton(R.string.just_once, dialogButtonsClickListener)
.setPositiveButton(R.string.always, dialogButtonsClickListener)
.setOnDismissListener((dialog) -> {
if (!selectionIsDownload) finish();
if (!selectionIsDownload) {
finish();
}
})
.create();
@@ -270,10 +304,13 @@ public class RouterActivity extends AppCompatActivity {
setDialogButtonsState(alertDialog, radioGroup.getCheckedRadioButtonId() != -1);
});
radioGroup.setOnCheckedChangeListener((group, checkedId) -> setDialogButtonsState(alertDialog, true));
radioGroup.setOnCheckedChangeListener((group, checkedId) ->
setDialogButtonsState(alertDialog, true));
final View.OnClickListener radioButtonsClickListener = v -> {
final int indexOfChild = radioGroup.indexOfChild(v);
if (indexOfChild == -1) return;
if (indexOfChild == -1) {
return;
}
selectedPreviously = selectedRadioPosition;
selectedRadioPosition = indexOfChild;
@@ -284,22 +321,27 @@ public class RouterActivity extends AppCompatActivity {
};
int id = 12345;
for (AdapterChoiceItem item : choices) {
final RadioButton radioButton = (RadioButton) inflater.inflate(R.layout.list_radio_icon_item, null);
for (final AdapterChoiceItem item : choices) {
final RadioButton radioButton
= (RadioButton) inflater.inflate(R.layout.list_radio_icon_item, null);
radioButton.setText(item.description);
radioButton.setCompoundDrawablesWithIntrinsicBounds(item.icon, 0, 0, 0);
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds(radioButton,
AppCompatResources.getDrawable(getApplicationContext(), item.icon),
null, null, null);
radioButton.setChecked(false);
radioButton.setId(id++);
radioButton.setLayoutParams(new RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
radioButton.setLayoutParams(new RadioGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
radioButton.setOnClickListener(radioButtonsClickListener);
radioGroup.addView(radioButton);
}
if (selectedRadioPosition == -1) {
final String lastSelectedPlayer = preferences.getString(getString(R.string.preferred_open_action_last_selected_key), null);
final String lastSelectedPlayer = preferences.getString(
getString(R.string.preferred_open_action_last_selected_key), null);
if (!TextUtils.isEmpty(lastSelectedPlayer)) {
for (int i = 0; i < choices.size(); i++) {
AdapterChoiceItem c = choices.get(i);
final AdapterChoiceItem c = choices.get(i);
if (lastSelectedPlayer.equals(c.key)) {
selectedRadioPosition = i;
break;
@@ -315,78 +357,133 @@ public class RouterActivity extends AppCompatActivity {
selectedPreviously = selectedRadioPosition;
alertDialog.show();
if (DeviceUtils.isTv(this)) {
FocusOverlayView.setupFocusObserver(alertDialog);
}
}
private List<AdapterChoiceItem> getChoicesForService(StreamingService service, LinkType linkType) {
private List<AdapterChoiceItem> getChoicesForService(final StreamingService service,
final LinkType linkType) {
final Context context = getThemeWrapperContext();
final List<AdapterChoiceItem> returnList = new ArrayList<>();
final List<StreamingService.ServiceInfo.MediaCapability> capabilities = service.getServiceInfo().getMediaCapabilities();
final List<StreamingService.ServiceInfo.MediaCapability> capabilities
= service.getServiceInfo().getMediaCapabilities();
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
boolean isExtVideoEnabled = preferences.getBoolean(getString(R.string.use_external_video_player_key), false);
boolean isExtAudioEnabled = preferences.getBoolean(getString(R.string.use_external_audio_player_key), false);
final SharedPreferences preferences = PreferenceManager
.getDefaultSharedPreferences(this);
final boolean isExtVideoEnabled = preferences.getBoolean(
getString(R.string.use_external_video_player_key), false);
final boolean isExtAudioEnabled = preferences.getBoolean(
getString(R.string.use_external_audio_player_key), false);
returnList.add(new AdapterChoiceItem(getString(R.string.show_info_key), getString(R.string.show_info),
resolveResourceIdFromAttr(context, R.attr.info)));
final AdapterChoiceItem videoPlayer = new AdapterChoiceItem(
getString(R.string.video_player_key), getString(R.string.video_player),
resolveResourceIdFromAttr(context, R.attr.ic_play_arrow));
final AdapterChoiceItem showInfo = new AdapterChoiceItem(
getString(R.string.show_info_key), getString(R.string.show_info),
resolveResourceIdFromAttr(context, R.attr.ic_info_outline));
final AdapterChoiceItem popupPlayer = new AdapterChoiceItem(
getString(R.string.popup_player_key), getString(R.string.popup_player),
resolveResourceIdFromAttr(context, R.attr.ic_popup));
final AdapterChoiceItem backgroundPlayer = new AdapterChoiceItem(
getString(R.string.background_player_key), getString(R.string.background_player),
resolveResourceIdFromAttr(context, R.attr.ic_headset));
if (capabilities.contains(VIDEO) && !(isExtVideoEnabled && linkType != LinkType.STREAM)) {
returnList.add(new AdapterChoiceItem(getString(R.string.video_player_key), getString(R.string.video_player),
resolveResourceIdFromAttr(context, R.attr.play)));
returnList.add(new AdapterChoiceItem(getString(R.string.popup_player_key), getString(R.string.popup_player),
resolveResourceIdFromAttr(context, R.attr.popup)));
if (linkType == LinkType.STREAM) {
if (isExtVideoEnabled) {
// show both "show info" and "video player", they are two different activities
returnList.add(showInfo);
returnList.add(videoPlayer);
} else {
final MainPlayer.PlayerType playerType = PlayerHolder.getType();
if (capabilities.contains(VIDEO)
&& PlayerHelper.isAutoplayAllowedByUser(context)
&& playerType == null || playerType == MainPlayer.PlayerType.VIDEO) {
// show only "video player" since the details activity will be opened and the
// video will be auto played there. Since "show info" would do the exact same
// thing, use that as a key to let VideoDetailFragment load the stream instead
// of using FetcherService (see comment in handleChoice())
returnList.add(new AdapterChoiceItem(
showInfo.key, videoPlayer.description, videoPlayer.icon));
} else {
// show only "show info" if video player is not applicable, auto play is
// disabled or a video is playing in a player different than the main one
returnList.add(showInfo);
}
}
if (capabilities.contains(VIDEO)) {
returnList.add(popupPlayer);
}
if (capabilities.contains(AUDIO)) {
returnList.add(backgroundPlayer);
}
} else {
returnList.add(showInfo);
if (capabilities.contains(VIDEO) && !isExtVideoEnabled) {
returnList.add(videoPlayer);
returnList.add(popupPlayer);
}
if (capabilities.contains(AUDIO) && !isExtAudioEnabled) {
returnList.add(backgroundPlayer);
}
}
if (capabilities.contains(AUDIO) && !(isExtAudioEnabled && linkType != LinkType.STREAM)) {
returnList.add(new AdapterChoiceItem(getString(R.string.background_player_key), getString(R.string.background_player),
resolveResourceIdFromAttr(context, R.attr.audio)));
}
returnList.add(new AdapterChoiceItem(getString(R.string.download_key), getString(R.string.download),
resolveResourceIdFromAttr(context, R.attr.download)));
returnList.add(new AdapterChoiceItem(getString(R.string.download_key),
getString(R.string.download),
resolveResourceIdFromAttr(context, R.attr.ic_file_download)));
return returnList;
}
private Context getThemeWrapperContext() {
return new ContextThemeWrapper(this,
ThemeHelper.isLightThemeSelected(this) ? R.style.LightTheme : R.style.DarkTheme);
return new ContextThemeWrapper(this, ThemeHelper.isLightThemeSelected(this)
? R.style.LightTheme : R.style.DarkTheme);
}
private void setDialogButtonsState(AlertDialog dialog, boolean state) {
private void setDialogButtonsState(final AlertDialog dialog, final boolean state) {
final Button negativeButton = dialog.getButton(DialogInterface.BUTTON_NEGATIVE);
final Button positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
if (negativeButton == null || positiveButton == null) return;
if (negativeButton == null || positiveButton == null) {
return;
}
negativeButton.setEnabled(state);
positiveButton.setEnabled(state);
}
private void handleText() {
String searchString = getIntent().getStringExtra(Intent.EXTRA_TEXT);
int serviceId = getIntent().getIntExtra(Constants.KEY_SERVICE_ID, 0);
Intent intent = new Intent(getThemeWrapperContext(), MainActivity.class);
final String searchString = getIntent().getStringExtra(Intent.EXTRA_TEXT);
final int serviceId = getIntent().getIntExtra(Constants.KEY_SERVICE_ID, 0);
final Intent intent = new Intent(getThemeWrapperContext(), MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
NavigationHelper.openSearch(getThemeWrapperContext(), serviceId, searchString);
}
private void handleChoice(final String selectedChoiceKey) {
final List<String> validChoicesList = Arrays.asList(getResources().getStringArray(R.array.preferred_open_action_values_list));
final List<String> validChoicesList = Arrays.asList(getResources()
.getStringArray(R.array.preferred_open_action_values_list));
if (validChoicesList.contains(selectedChoiceKey)) {
PreferenceManager.getDefaultSharedPreferences(this).edit()
.putString(getString(R.string.preferred_open_action_last_selected_key), selectedChoiceKey)
.putString(getString(
R.string.preferred_open_action_last_selected_key), selectedChoiceKey)
.apply();
}
if (selectedChoiceKey.equals(getString(R.string.popup_player_key)) && !PermissionHelper.isPopupEnabled(this)) {
if (selectedChoiceKey.equals(getString(R.string.popup_player_key))
&& !PermissionHelper.isPopupEnabled(this)) {
PermissionHelper.showPopupEnablementToast(this);
finish();
return;
}
if (selectedChoiceKey.equals(getString(R.string.download_key))) {
if (PermissionHelper.checkStoragePermissions(this, PermissionHelper.DOWNLOAD_DIALOG_REQUEST_CODE)) {
if (PermissionHelper.checkStoragePermissions(this,
PermissionHelper.DOWNLOAD_DIALOG_REQUEST_CODE)) {
selectionIsDownload = true;
openDownloadDialog();
}
@@ -401,20 +498,16 @@ public class RouterActivity extends AppCompatActivity {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(intent -> {
if (!internalRoute) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
}
startActivity(intent);
finish();
}, this::handleError)
}, throwable -> handleError(throwable, currentUrl))
);
return;
}
final Intent intent = new Intent(this, FetcherService.class);
final Choice choice = new Choice(currentService.getServiceId(), currentLinkType, currentUrl, selectedChoiceKey);
final Choice choice = new Choice(currentService.getServiceId(), currentLinkType,
currentUrl, selectedChoiceKey);
intent.putExtra(FetcherService.KEY_CHOICE, choice);
startService(intent);
@@ -423,35 +516,33 @@ public class RouterActivity extends AppCompatActivity {
@SuppressLint("CheckResult")
private void openDownloadDialog() {
ExtractorHelper.getStreamInfo(currentServiceId, currentUrl, true)
disposables.add(ExtractorHelper.getStreamInfo(currentServiceId, currentUrl, true)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe((@NonNull StreamInfo result) -> {
List<VideoStream> sortedVideoStreams = ListHelper.getSortedStreamVideosList(this,
result.getVideoStreams(),
result.getVideoOnlyStreams(),
false);
int selectedVideoStreamIndex = ListHelper.getDefaultResolutionIndex(this,
sortedVideoStreams);
.subscribe(result -> {
final List<VideoStream> sortedVideoStreams = ListHelper
.getSortedStreamVideosList(this, result.getVideoStreams(),
result.getVideoOnlyStreams(), false);
final int selectedVideoStreamIndex = ListHelper
.getDefaultResolutionIndex(this, sortedVideoStreams);
FragmentManager fm = getSupportFragmentManager();
DownloadDialog downloadDialog = DownloadDialog.newInstance(result);
final FragmentManager fm = getSupportFragmentManager();
final DownloadDialog downloadDialog = DownloadDialog.newInstance(result);
downloadDialog.setVideoStreams(sortedVideoStreams);
downloadDialog.setAudioStreams(result.getAudioStreams());
downloadDialog.setSelectedVideoStream(selectedVideoStreamIndex);
downloadDialog.show(fm, "downloadDialog");
fm.executePendingTransactions();
downloadDialog.getDialog().setOnDismissListener(dialog -> {
finish();
});
}, (@NonNull Throwable throwable) -> {
onError();
});
downloadDialog.requireDialog().setOnDismissListener(dialog -> finish());
}, throwable ->
showUnsupportedUrlDialog(currentUrl)));
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
for (int i : grantResults) {
public void onRequestPermissionsResult(final int requestCode,
@NonNull final String[] permissions,
@NonNull final int[] grantResults) {
for (final int i : grantResults) {
if (i == PackageManager.PERMISSION_DENIED) {
finish();
return;
@@ -463,11 +554,12 @@ public class RouterActivity extends AppCompatActivity {
}
private static class AdapterChoiceItem {
final String description, key;
final String description;
final String key;
@DrawableRes
final int icon;
AdapterChoiceItem(String key, String description, int icon) {
AdapterChoiceItem(final String key, final String description, final int icon) {
this.description = description;
this.key = key;
this.icon = icon;
@@ -476,10 +568,12 @@ public class RouterActivity extends AppCompatActivity {
private static class Choice implements Serializable {
final int serviceId;
final String url, playerChoice;
final String url;
final String playerChoice;
final LinkType linkType;
Choice(int serviceId, LinkType linkType, String url, String playerChoice) {
Choice(final int serviceId, final LinkType linkType,
final String url, final String playerChoice) {
this.serviceId = serviceId;
this.linkType = linkType;
this.url = url;
@@ -492,14 +586,10 @@ public class RouterActivity extends AppCompatActivity {
}
}
/*//////////////////////////////////////////////////////////////////////////
// Service Fetcher
//////////////////////////////////////////////////////////////////////////*/
public static class FetcherService extends IntentService {
private static final int ID = 456;
public static final String KEY_CHOICE = "key_choice";
private static final int ID = 456;
private Disposable fetcher;
public FetcherService() {
@@ -513,16 +603,20 @@ public class RouterActivity extends AppCompatActivity {
}
@Override
protected void onHandleIntent(@Nullable Intent intent) {
if (intent == null) return;
protected void onHandleIntent(@Nullable final Intent intent) {
if (intent == null) {
return;
}
final Serializable serializable = intent.getSerializableExtra(KEY_CHOICE);
if (!(serializable instanceof Choice)) return;
Choice playerChoice = (Choice) serializable;
if (!(serializable instanceof Choice)) {
return;
}
final Choice playerChoice = (Choice) serializable;
handleChoice(playerChoice);
}
public void handleChoice(Choice choice) {
public void handleChoice(final Choice choice) {
Single<? extends Info> single = null;
UserAction userAction = UserAction.SOMETHING_ELSE;
@@ -549,56 +643,52 @@ public class RouterActivity extends AppCompatActivity {
.observeOn(AndroidSchedulers.mainThread())
.subscribe(info -> {
resultHandler.accept(info);
if (fetcher != null) fetcher.dispose();
if (fetcher != null) {
fetcher.dispose();
}
}, throwable -> ExtractorHelper.handleGeneralException(this,
choice.serviceId, choice.url, throwable, finalUserAction, ", opened with " + choice.playerChoice));
choice.serviceId, choice.url, throwable, finalUserAction,
", opened with " + choice.playerChoice));
}
}
public Consumer<Info> getResultHandler(Choice choice) {
public Consumer<Info> getResultHandler(final Choice choice) {
return info -> {
final String videoPlayerKey = getString(R.string.video_player_key);
final String backgroundPlayerKey = getString(R.string.background_player_key);
final String popupPlayerKey = getString(R.string.popup_player_key);
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
boolean isExtVideoEnabled = preferences.getBoolean(getString(R.string.use_external_video_player_key), false);
boolean isExtAudioEnabled = preferences.getBoolean(getString(R.string.use_external_audio_player_key), false);
;
PlayQueue playQueue;
String playerChoice = choice.playerChoice;
final SharedPreferences preferences = PreferenceManager
.getDefaultSharedPreferences(this);
final boolean isExtVideoEnabled = preferences.getBoolean(
getString(R.string.use_external_video_player_key), false);
final boolean isExtAudioEnabled = preferences.getBoolean(
getString(R.string.use_external_audio_player_key), false);
final PlayQueue playQueue;
if (info instanceof StreamInfo) {
if (playerChoice.equals(backgroundPlayerKey) && isExtAudioEnabled) {
if (choice.playerChoice.equals(backgroundPlayerKey) && isExtAudioEnabled) {
NavigationHelper.playOnExternalAudioPlayer(this, (StreamInfo) info);
} else if (playerChoice.equals(videoPlayerKey) && isExtVideoEnabled) {
return;
} else if (choice.playerChoice.equals(videoPlayerKey) && isExtVideoEnabled) {
NavigationHelper.playOnExternalVideoPlayer(this, (StreamInfo) info);
} else {
playQueue = new SinglePlayQueue((StreamInfo) info);
if (playerChoice.equals(videoPlayerKey)) {
NavigationHelper.playOnMainPlayer(this, playQueue, true);
} else if (playerChoice.equals(backgroundPlayerKey)) {
NavigationHelper.enqueueOnBackgroundPlayer(this, playQueue, true);
} else if (playerChoice.equals(popupPlayerKey)) {
NavigationHelper.enqueueOnPopupPlayer(this, playQueue, true);
}
return;
}
playQueue = new SinglePlayQueue((StreamInfo) info);
} else if (info instanceof ChannelInfo) {
playQueue = new ChannelPlayQueue((ChannelInfo) info);
} else if (info instanceof PlaylistInfo) {
playQueue = new PlaylistPlayQueue((PlaylistInfo) info);
} else {
return;
}
if (info instanceof ChannelInfo || info instanceof PlaylistInfo) {
playQueue = info instanceof ChannelInfo ? new ChannelPlayQueue((ChannelInfo) info) : new PlaylistPlayQueue((PlaylistInfo) info);
if (playerChoice.equals(videoPlayerKey)) {
NavigationHelper.playOnMainPlayer(this, playQueue, true);
} else if (playerChoice.equals(backgroundPlayerKey)) {
NavigationHelper.playOnBackgroundPlayer(this, playQueue, true);
} else if (playerChoice.equals(popupPlayerKey)) {
NavigationHelper.playOnPopupPlayer(this, playQueue, true);
}
if (choice.playerChoice.equals(videoPlayerKey)) {
NavigationHelper.playOnMainPlayer(this, playQueue, false);
} else if (choice.playerChoice.equals(backgroundPlayerKey)) {
NavigationHelper.playOnBackgroundPlayer(this, playQueue, true);
} else if (choice.playerChoice.equals(popupPlayerKey)) {
NavigationHelper.playOnPopupPlayer(this, playQueue, true);
}
};
}
@@ -607,7 +697,9 @@ public class RouterActivity extends AppCompatActivity {
public void onDestroy() {
super.onDestroy();
stopForeground(true);
if (fetcher != null) fetcher.dispose();
if (fetcher != null) {
fetcher.dispose();
}
}
private NotificationCompat.Builder createNotification() {
@@ -615,8 +707,10 @@ public class RouterActivity extends AppCompatActivity {
.setOngoing(true)
.setSmallIcon(R.drawable.ic_newpipe_triangle_white)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
.setContentTitle(getString(R.string.preferred_player_fetcher_notification_title))
.setContentText(getString(R.string.preferred_player_fetcher_notification_message));
.setContentTitle(
getString(R.string.preferred_player_fetcher_notification_title))
.setContentText(
getString(R.string.preferred_player_fetcher_notification_message));
}
}
@@ -625,7 +719,7 @@ public class RouterActivity extends AppCompatActivity {
//////////////////////////////////////////////////////////////////////////*/
@Nullable
private String getUrl(Intent intent) {
private String getUrl(final Intent intent) {
String foundUrl = null;
if (intent.getData() != null) {
// Called from another app

View File

@@ -1,71 +1,87 @@
package org.schabi.newpipe.about;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import com.google.android.material.tabs.TabLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import androidx.viewpager2.widget.ViewPager2;
import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;
import org.schabi.newpipe.BuildConfig;
import org.schabi.newpipe.R;
import org.schabi.newpipe.util.ThemeHelper;
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
import static org.schabi.newpipe.util.ShareUtils.openUrlInBrowser;
public class AboutActivity extends AppCompatActivity {
/**
* List of all software components
* List of all software components.
*/
private static final SoftwareComponent[] SOFTWARE_COMPONENTS = new SoftwareComponent[]{
new SoftwareComponent("Giga Get", "2014 - 2015", "Peter Cai", "https://github.com/PaperAirplane-Dev-Team/GigaGet", StandardLicenses.GPL2),
new SoftwareComponent("NewPipe Extractor", "2017 - 2020", "Christian Schabesberger", "https://github.com/TeamNewPipe/NewPipeExtractor", StandardLicenses.GPL3),
new SoftwareComponent("Jsoup", "2017", "Jonathan Hedley", "https://github.com/jhy/jsoup", StandardLicenses.MIT),
new SoftwareComponent("Rhino", "2015", "Mozilla", "https://www.mozilla.org/rhino/", StandardLicenses.MPL2),
new SoftwareComponent("ACRA", "2013", "Kevin Gaudin", "http://www.acra.ch", StandardLicenses.APACHE2),
new SoftwareComponent("Universal Image Loader", "2011 - 2015", "Sergey Tarasevich", "https://github.com/nostra13/Android-Universal-Image-Loader", StandardLicenses.APACHE2),
new SoftwareComponent("CircleImageView", "2014 - 2020", "Henning Dodenhof", "https://github.com/hdodenhof/CircleImageView", StandardLicenses.APACHE2),
new SoftwareComponent("NoNonsense-FilePicker", "2016", "Jonas Kalderstam", "https://github.com/spacecowboy/NoNonsense-FilePicker", StandardLicenses.MPL2),
new SoftwareComponent("ExoPlayer", "2014 - 2020", "Google Inc", "https://github.com/google/ExoPlayer", StandardLicenses.APACHE2),
new SoftwareComponent("RxAndroid", "2015 - 2018", "The RxAndroid authors", "https://github.com/ReactiveX/RxAndroid", StandardLicenses.APACHE2),
new SoftwareComponent("RxJava", "2016 - 2020", "RxJava Contributors", "https://github.com/ReactiveX/RxJava", StandardLicenses.APACHE2),
new SoftwareComponent("RxBinding", "2015 - 2018", "Jake Wharton", "https://github.com/JakeWharton/RxBinding", StandardLicenses.APACHE2),
new SoftwareComponent("PrettyTime", "2012 - 2020", "Lincoln Baxter, III", "https://github.com/ocpsoft/prettytime", StandardLicenses.APACHE2),
new SoftwareComponent("Markwon", "2017 - 2020", "Noties", "https://github.com/noties/Markwon", StandardLicenses.APACHE2),
new SoftwareComponent("Groupie", "2016", "Lisa Wray", "https://github.com/lisawray/groupie", StandardLicenses.MIT)
private static final SoftwareComponent[] SOFTWARE_COMPONENTS = {
new SoftwareComponent("Giga Get", "2014 - 2015", "Peter Cai",
"https://github.com/PaperAirplane-Dev-Team/GigaGet", StandardLicenses.GPL3),
new SoftwareComponent("NewPipe Extractor", "2017 - 2020", "Christian Schabesberger",
"https://github.com/TeamNewPipe/NewPipeExtractor", StandardLicenses.GPL3),
new SoftwareComponent("Jsoup", "2017", "Jonathan Hedley",
"https://github.com/jhy/jsoup", StandardLicenses.MIT),
new SoftwareComponent("Rhino", "2015", "Mozilla",
"https://www.mozilla.org/rhino/", StandardLicenses.MPL2),
new SoftwareComponent("ACRA", "2013", "Kevin Gaudin",
"http://www.acra.ch", StandardLicenses.APACHE2),
new SoftwareComponent("Universal Image Loader", "2011 - 2015", "Sergey Tarasevich",
"https://github.com/nostra13/Android-Universal-Image-Loader",
StandardLicenses.APACHE2),
new SoftwareComponent("CircleImageView", "2014 - 2020", "Henning Dodenhof",
"https://github.com/hdodenhof/CircleImageView", StandardLicenses.APACHE2),
new SoftwareComponent("NoNonsense-FilePicker", "2016", "Jonas Kalderstam",
"https://github.com/spacecowboy/NoNonsense-FilePicker", StandardLicenses.MPL2),
new SoftwareComponent("ExoPlayer", "2014 - 2020", "Google Inc",
"https://github.com/google/ExoPlayer", StandardLicenses.APACHE2),
new SoftwareComponent("RxAndroid", "2015 - 2018", "The RxAndroid authors",
"https://github.com/ReactiveX/RxAndroid", StandardLicenses.APACHE2),
new SoftwareComponent("RxJava", "2016 - 2020", "RxJava Contributors",
"https://github.com/ReactiveX/RxJava", StandardLicenses.APACHE2),
new SoftwareComponent("RxBinding", "2015 - 2018", "Jake Wharton",
"https://github.com/JakeWharton/RxBinding", StandardLicenses.APACHE2),
new SoftwareComponent("PrettyTime", "2012 - 2020", "Lincoln Baxter, III",
"https://github.com/ocpsoft/prettytime", StandardLicenses.APACHE2),
new SoftwareComponent("Markwon", "2017 - 2020", "Noties",
"https://github.com/noties/Markwon", StandardLicenses.APACHE2),
new SoftwareComponent("Groupie", "2016", "Lisa Wray",
"https://github.com/lisawray/groupie", StandardLicenses.MIT)
};
private static final int POS_ABOUT = 0;
private static final int POS_LICENSE = 1;
private static final int TOTAL_COUNT = 2;
/**
* The {@link PagerAdapter} that will provide
* The {@link RecyclerView.Adapter} that will provide
* fragments for each of the sections. We use a
* {@link FragmentPagerAdapter} derivative, which will keep every
* loaded fragment in memory. If this becomes too memory intensive, it
* may be best to switch to a
* {@link FragmentStatePagerAdapter}.
* {@link FragmentStateAdapter} derivative, which will keep every
* loaded fragment in memory.
*/
private SectionsPagerAdapter mSectionsPagerAdapter;
/**
* The {@link ViewPager} that will host the section contents.
* The {@link ViewPager2} that will host the section contents.
*/
private ViewPager mViewPager;
private ViewPager2 mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(final Bundle savedInstanceState) {
assureCorrectAppLanguage(this);
super.onCreate(savedInstanceState);
ThemeHelper.setTheme(this);
@@ -73,26 +89,34 @@ public class AboutActivity extends AppCompatActivity {
setContentView(R.layout.activity_about);
Toolbar toolbar = findViewById(R.id.toolbar);
final Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
// Create the adapter that will return a fragment for each of the three
// primary sections of the activity.
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
mSectionsPagerAdapter = new SectionsPagerAdapter(this);
// Set up the ViewPager with the sections adapter.
mViewPager = findViewById(R.id.container);
mViewPager.setAdapter(mSectionsPagerAdapter);
TabLayout tabLayout = findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
final TabLayout tabLayout = findViewById(R.id.tabs);
new TabLayoutMediator(tabLayout, mViewPager, (tab, position) -> {
switch (position) {
default:
case POS_ABOUT:
tab.setText(R.string.tab_about);
break;
case POS_LICENSE:
tab.setText(R.string.tab_licenses);
break;
}
}).attach();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
public boolean onOptionsItemSelected(final MenuItem item) {
final int id = item.getItemId();
switch (id) {
case android.R.id.home:
@@ -107,86 +131,72 @@ public class AboutActivity extends AppCompatActivity {
* A placeholder fragment containing a simple view.
*/
public static class AboutFragment extends Fragment {
public AboutFragment() {
}
public AboutFragment() { }
/**
* Returns a new instance of this fragment for the given section
* number.
* Created a new instance of this fragment for the given section number.
*
* @return New instance of {@link AboutFragment}
*/
public static AboutFragment newInstance() {
return new AboutFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_about, container, false);
Context context = this.getContext();
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
final Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_about, container, false);
final Context context = this.getContext();
TextView version = rootView.findViewById(R.id.app_version);
final TextView version = rootView.findViewById(R.id.app_version);
version.setText(BuildConfig.VERSION_NAME);
View githubLink = rootView.findViewById(R.id.github_link);
githubLink.setOnClickListener(nv -> openWebsite(context.getString(R.string.github_url), context));
final View githubLink = rootView.findViewById(R.id.github_link);
githubLink.setOnClickListener(nv ->
openUrlInBrowser(context, context.getString(R.string.github_url)));
View donationLink = rootView.findViewById(R.id.donation_link);
donationLink.setOnClickListener(v -> openWebsite(context.getString(R.string.donation_url), context));
final View donationLink = rootView.findViewById(R.id.donation_link);
donationLink.setOnClickListener(v ->
openUrlInBrowser(context, context.getString(R.string.donation_url)));
View websiteLink = rootView.findViewById(R.id.website_link);
websiteLink.setOnClickListener(nv -> openWebsite(context.getString(R.string.website_url), context));
final View websiteLink = rootView.findViewById(R.id.website_link);
websiteLink.setOnClickListener(nv ->
openUrlInBrowser(context, context.getString(R.string.website_url)));
View privacyPolicyLink = rootView.findViewById(R.id.privacy_policy_link);
privacyPolicyLink.setOnClickListener(v -> openWebsite(context.getString(R.string.privacy_policy_url), context));
final View privacyPolicyLink = rootView.findViewById(R.id.privacy_policy_link);
privacyPolicyLink.setOnClickListener(v ->
openUrlInBrowser(context, context.getString(R.string.privacy_policy_url)));
return rootView;
}
private void openWebsite(String url, Context context) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
context.startActivity(intent);
}
}
/**
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
* A {@link FragmentStateAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
public static class SectionsPagerAdapter extends FragmentStateAdapter {
public SectionsPagerAdapter(final FragmentActivity fa) {
super(fa);
}
@NonNull
@Override
public Fragment getItem(int position) {
public Fragment createFragment(final int position) {
switch (position) {
case 0:
default:
case POS_ABOUT:
return AboutFragment.newInstance();
case 1:
case POS_LICENSE:
return LicenseFragment.newInstance(SOFTWARE_COMPONENTS);
}
return null;
}
@Override
public int getCount() {
public int getItemCount() {
// Show 2 total pages.
return 2;
}
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return getString(R.string.tab_about);
case 1:
return getString(R.string.tab_licenses);
}
return null;
return TOTAL_COUNT;
}
}
}

View File

@@ -1,73 +0,0 @@
package org.schabi.newpipe.about;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
/**
* A software license
*/
public class License implements Parcelable {
public static final Creator<License> CREATOR = new Creator<License>() {
@Override
public License createFromParcel(Parcel source) {
return new License(source);
}
@Override
public License[] newArray(int size) {
return new License[size];
}
};
private final String abbreviation;
private final String name;
private String filename;
public License(String name, String abbreviation, String filename) {
if(name == null) throw new NullPointerException("name is null");
if(abbreviation == null) throw new NullPointerException("abbreviation is null");
if(filename == null) throw new NullPointerException("filename is null");
this.name = name;
this.filename = filename;
this.abbreviation = abbreviation;
}
protected License(Parcel in) {
this.filename = in.readString();
this.abbreviation = in.readString();
this.name = in.readString();
}
public Uri getContentUri() {
return new Uri.Builder()
.scheme("file")
.path("/android_asset")
.appendPath(filename)
.build();
}
public String getAbbreviation() {
return abbreviation;
}
public String getFilename() {
return filename;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(this.filename);
dest.writeString(this.abbreviation);
dest.writeString(this.name);
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,19 @@
package org.schabi.newpipe.about
import android.net.Uri
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import java.io.Serializable
/**
* Class for storing information about a software license.
*/
@Parcelize
class License(val name: String, val abbreviation: String, val filename: String) : Parcelable, Serializable {
val contentUri: Uri
get() = Uri.Builder()
.scheme("file")
.path("/android_asset")
.appendPath(filename)
.build()
}

View File

@@ -1,133 +1,147 @@
package org.schabi.newpipe.about;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.view.*;
import android.widget.TextView;
import org.schabi.newpipe.R;
import org.schabi.newpipe.R;
import org.schabi.newpipe.util.ShareUtils;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Comparator;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
/**
* Fragment containing the software licenses
* Fragment containing the software licenses.
*/
public class LicenseFragment extends Fragment {
private static final String ARG_COMPONENTS = "components";
private SoftwareComponent[] softwareComponents;
private SoftwareComponent mComponentForContextMenu;
private static final String LICENSE_KEY = "ACTIVE_LICENSE";
public static LicenseFragment newInstance(SoftwareComponent[] softwareComponents) {
if(softwareComponents == null) {
private SoftwareComponent[] softwareComponents;
private SoftwareComponent componentForContextMenu;
private License activeLicense;
private final CompositeDisposable compositeDisposable = new CompositeDisposable();
public static LicenseFragment newInstance(final SoftwareComponent[] softwareComponents) {
if (softwareComponents == null) {
throw new NullPointerException("softwareComponents is null");
}
LicenseFragment fragment = new LicenseFragment();
Bundle bundle = new Bundle();
final LicenseFragment fragment = new LicenseFragment();
final Bundle bundle = new Bundle();
bundle.putParcelableArray(ARG_COMPONENTS, softwareComponents);
fragment.setArguments(bundle);
return fragment;
}
/**
* Shows a popup containing the license
* @param context the context to use
* @param license the license to show
*/
public static void showLicense(Context context, License license) {
new LicenseFragmentHelper((Activity) context).execute(license);
@Override
public void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
softwareComponents = (SoftwareComponent[]) getArguments()
.getParcelableArray(ARG_COMPONENTS);
if (savedInstanceState != null) {
final Serializable license = savedInstanceState.getSerializable(LICENSE_KEY);
if (license != null) {
activeLicense = (License) license;
}
}
// Sort components by name
Arrays.sort(softwareComponents, Comparator.comparing(SoftwareComponent::getName));
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
softwareComponents = (SoftwareComponent[]) getArguments().getParcelableArray(ARG_COMPONENTS);
// Sort components by name
Arrays.sort(softwareComponents, new Comparator<SoftwareComponent>() {
@Override
public int compare(SoftwareComponent o1, SoftwareComponent o2) {
return o1.getName().compareTo(o2.getName());
}
});
public void onDestroy() {
compositeDisposable.dispose();
super.onDestroy();
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_licenses, container, false);
ViewGroup softwareComponentsView = rootView.findViewById(R.id.software_components);
public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container,
@Nullable final Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_licenses, container, false);
final ViewGroup softwareComponentsView = rootView.findViewById(R.id.software_components);
View licenseLink = rootView.findViewById(R.id.app_read_license);
licenseLink.setOnClickListener(new OnReadFullLicenseClickListener());
final View licenseLink = rootView.findViewById(R.id.app_read_license);
licenseLink.setOnClickListener(v -> {
activeLicense = StandardLicenses.GPL3;
compositeDisposable.add(LicenseFragmentHelper.showLicense(getActivity(),
StandardLicenses.GPL3));
});
for (final SoftwareComponent component : softwareComponents) {
View componentView = inflater.inflate(R.layout.item_software_component, container, false);
TextView softwareName = componentView.findViewById(R.id.name);
TextView copyright = componentView.findViewById(R.id.copyright);
final View componentView = inflater
.inflate(R.layout.item_software_component, container, false);
final TextView softwareName = componentView.findViewById(R.id.name);
final TextView copyright = componentView.findViewById(R.id.copyright);
softwareName.setText(component.getName());
copyright.setText(getContext().getString(R.string.copyright,
copyright.setText(getString(R.string.copyright,
component.getYears(),
component.getCopyrightOwner(),
component.getLicense().getAbbreviation()));
componentView.setTag(component);
componentView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Context context = v.getContext();
if (context != null) {
showLicense(context, component.getLicense());
}
}
componentView.setOnClickListener(v -> {
activeLicense = component.getLicense();
compositeDisposable.add(LicenseFragmentHelper.showLicense(getActivity(),
component.getLicense()));
});
softwareComponentsView.addView(componentView);
registerForContextMenu(componentView);
}
if (activeLicense != null) {
compositeDisposable.add(LicenseFragmentHelper.showLicense(getActivity(),
activeLicense));
}
return rootView;
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
MenuInflater inflater = getActivity().getMenuInflater();
SoftwareComponent component = (SoftwareComponent) v.getTag();
public void onCreateContextMenu(final ContextMenu menu, final View v,
final ContextMenu.ContextMenuInfo menuInfo) {
final MenuInflater inflater = getActivity().getMenuInflater();
final SoftwareComponent component = (SoftwareComponent) v.getTag();
menu.setHeaderTitle(component.getName());
inflater.inflate(R.menu.software_component, menu);
super.onCreateContextMenu(menu, v, menuInfo);
mComponentForContextMenu = (SoftwareComponent) v.getTag();
componentForContextMenu = (SoftwareComponent) v.getTag();
}
@Override
public boolean onContextItemSelected(MenuItem item) {
public boolean onContextItemSelected(@NonNull final MenuItem item) {
// item.getMenuInfo() is null so we use the tag of the view
final SoftwareComponent component = mComponentForContextMenu;
final SoftwareComponent component = componentForContextMenu;
if (component == null) {
return false;
}
switch (item.getItemId()) {
case R.id.action_website:
openWebsite(component.getLink());
ShareUtils.openUrlInBrowser(getActivity(), component.getLink());
return true;
case R.id.action_show_license:
showLicense(getContext(), component.getLicense());
compositeDisposable.add(LicenseFragmentHelper.showLicense(getActivity(),
component.getLicense()));
}
return false;
}
private void openWebsite(String componentLink) {
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);
@Override
public void onSaveInstanceState(@NonNull final Bundle savedInstanceState) {
super.onSaveInstanceState(savedInstanceState);
if (activeLicense != null) {
savedInstanceState.putSerializable(LICENSE_KEY, activeLicense);
}
}
}

View File

@@ -1,136 +1,109 @@
package org.schabi.newpipe.about;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.os.AsyncTask;
import android.util.Base64;
import android.webkit.WebView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import android.webkit.WebView;
import org.schabi.newpipe.R;
import org.schabi.newpipe.util.ThemeHelper;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.ref.WeakReference;
import java.nio.charset.StandardCharsets;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.schedulers.Schedulers;
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
public class LicenseFragmentHelper extends AsyncTask<Object, Void, Integer> {
final WeakReference<Activity> weakReference;
private License license;
public LicenseFragmentHelper(@Nullable Activity activity) {
weakReference = new WeakReference<>(activity);
}
@Nullable
private Activity getActivity() {
Activity activity = weakReference.get();
if (activity != null && activity.isFinishing()) {
return null;
} else {
return activity;
}
}
@Override
protected Integer doInBackground(Object... objects) {
license = (License) objects[0];
return 1;
}
@Override
protected void onPostExecute(Integer result) {
Activity activity = getActivity();
if (activity == null) {
return;
}
String webViewData = getFormattedLicense(activity, license);
AlertDialog.Builder alert = new AlertDialog.Builder(activity);
alert.setTitle(license.getName());
WebView wv = new WebView(activity);
wv.loadData(webViewData, "text/html; charset=UTF-8", null);
alert.setView(wv);
assureCorrectAppLanguage(activity.getApplicationContext());
alert.setNegativeButton(getFinishString(activity), (dialog, which) -> dialog.dismiss());
alert.show();
}
private static String getFinishString(Activity activity) {
return activity.getApplicationContext().getResources().getString(R.string.finish);
}
public final class LicenseFragmentHelper {
private LicenseFragmentHelper() { }
/**
* @param context the context to use
* @param license the license
* @return String which contains a HTML formatted license page styled according to the context's theme
* @return String which contains a HTML formatted license page
* styled according to the context's theme
*/
public static String getFormattedLicense(Context context, License license) {
if(context == null) {
throw new NullPointerException("context is null");
}
if(license == null) {
throw new NullPointerException("license is null");
}
StringBuilder licenseContent = new StringBuilder();
String webViewData;
try {
BufferedReader in = new BufferedReader(new InputStreamReader(context.getAssets().open(license.getFilename()), "UTF-8"));
private static String getFormattedLicense(@NonNull final Context context,
@NonNull final License license) {
final StringBuilder licenseContent = new StringBuilder();
final String webViewData;
try (BufferedReader in = new BufferedReader(new InputStreamReader(
context.getAssets().open(license.getFilename()), StandardCharsets.UTF_8))) {
String str;
while ((str = in.readLine()) != null) {
licenseContent.append(str);
}
in.close();
// split the HTML file and insert the stylesheet into the HEAD of the file
String[] insert = licenseContent.toString().split("</head>");
webViewData = insert[0] + "<style type=\"text/css\">"
+ getLicenseStylesheet(context) + "</style></head>"
+ insert[1];
} catch (Exception e) {
throw new NullPointerException("could not get license file:" + getLicenseStylesheet(context));
webViewData = licenseContent.toString().replace("</head>",
"<style>" + getLicenseStylesheet(context) + "</style></head>");
} catch (final IOException e) {
throw new IllegalArgumentException(
"Could not get license file: " + license.getFilename(), e);
}
return webViewData;
}
/**
*
* @param context
* @param context the Android context
* @return String which is a CSS stylesheet according to the context's theme
*/
public static String getLicenseStylesheet(Context context) {
boolean isLightTheme = ThemeHelper.isLightThemeSelected(context);
return "body{padding:12px 15px;margin:0;background:#"
+ getHexRGBColor(context, isLightTheme
? R.color.light_license_background_color
: R.color.dark_license_background_color)
+ ";color:#"
+ getHexRGBColor(context, isLightTheme
? R.color.light_license_text_color
: R.color.dark_license_text_color) + ";}"
+ "a[href]{color:#"
+ getHexRGBColor(context, isLightTheme
? R.color.light_youtube_primary_color
: R.color.dark_youtube_primary_color) + ";}"
+ "pre{white-space: pre-wrap;}";
private static String getLicenseStylesheet(@NonNull final Context context) {
final boolean isLightTheme = ThemeHelper.isLightThemeSelected(context);
return "body{padding:12px 15px;margin:0;"
+ "background:#" + getHexRGBColor(context, isLightTheme
? R.color.light_license_background_color
: R.color.dark_license_background_color) + ";"
+ "color:#" + getHexRGBColor(context, isLightTheme
? R.color.light_license_text_color
: R.color.dark_license_text_color) + "}"
+ "a[href]{color:#" + getHexRGBColor(context, isLightTheme
? R.color.light_youtube_primary_color
: R.color.dark_youtube_primary_color) + "}"
+ "pre{white-space:pre-wrap}";
}
/**
* Cast R.color to a hexadecimal color value
* Cast R.color to a hexadecimal color value.
*
* @param context the context to use
* @param color the color number from R.color
* @param color the color number from R.color
* @return a six characters long String with hexadecimal RGB values
*/
public static String getHexRGBColor(Context context, int color) {
private static String getHexRGBColor(@NonNull final Context context, final int color) {
return context.getResources().getString(color).substring(3);
}
static Disposable showLicense(@Nullable final Context context, @NonNull final License license) {
if (context == null) {
return Disposable.empty();
}
return Observable.fromCallable(() -> getFormattedLicense(context, license))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(formattedLicense -> {
final String webViewData = Base64.encodeToString(formattedLicense
.getBytes(StandardCharsets.UTF_8), Base64.NO_PADDING);
final WebView webView = new WebView(context);
webView.loadData(webViewData, "text/html; charset=UTF-8", "base64");
final AlertDialog.Builder alert = new AlertDialog.Builder(context);
alert.setTitle(license.getName());
alert.setView(webView);
assureCorrectAppLanguage(context);
alert.setNegativeButton(context.getString(R.string.finish),
(dialog, which) -> dialog.dismiss());
alert.show();
});
}
}

View File

@@ -1,83 +0,0 @@
package org.schabi.newpipe.about;
import android.os.Parcel;
import android.os.Parcelable;
public class SoftwareComponent implements Parcelable {
public static final Creator<SoftwareComponent> CREATOR = new Creator<SoftwareComponent>() {
@Override
public SoftwareComponent createFromParcel(Parcel source) {
return new SoftwareComponent(source);
}
@Override
public SoftwareComponent[] newArray(int size) {
return new SoftwareComponent[size];
}
};
public String getName() {
return name;
}
public String getYears() {
return years;
}
public String getCopyrightOwner() {
return copyrightOwner;
}
public String getLink() {
return link;
}
public String getVersion() {
return version;
}
private final License license;
private final String name;
private final String years;
private final String copyrightOwner;
private final String link;
private final String version;
public SoftwareComponent(String name, String years, String copyrightOwner, String link, License license) {
this.name = name;
this.years = years;
this.copyrightOwner = copyrightOwner;
this.link = link;
this.license = license;
this.version = null;
}
protected SoftwareComponent(Parcel in) {
this.name = in.readString();
this.license = in.readParcelable(License.class.getClassLoader());
this.copyrightOwner = in.readString();
this.link = in.readString();
this.years = in.readString();
this.version = in.readString();
}
public License getLicense() {
return license;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(name);
dest.writeParcelable(license, flags);
dest.writeString(copyrightOwner);
dest.writeString(link);
dest.writeString(years);
dest.writeString(version);
}
}

View File

@@ -0,0 +1,16 @@
package org.schabi.newpipe.about
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
@Parcelize
class SoftwareComponent
@JvmOverloads
constructor(
val name: String,
val years: String,
val copyrightOwner: String,
val link: String,
val license: License,
val version: String? = null
) : Parcelable

View File

@@ -1,12 +1,17 @@
package org.schabi.newpipe.about;
/**
* Standard software licenses
* Class containing information about standard software licenses.
*/
public final class StandardLicenses {
public static final License GPL2 = new License("GNU General Public License, Version 2.0", "GPLv2", "gpl_2.html");
public static final License GPL3 = new License("GNU General Public License, Version 3.0", "GPLv3", "gpl_3.html");
public static final License APACHE2 = new License("Apache License, Version 2.0", "ALv2", "apache2.html");
public static final License MPL2 = new License("Mozilla Public License, Version 2.0", "MPL 2.0", "mpl2.html");
public static final License MIT = new License("MIT License", "MIT", "mit.html");
public static final License GPL3
= new License("GNU General Public License, Version 3.0", "GPLv3", "gpl_3.html");
public static final License APACHE2
= new License("Apache License, Version 2.0", "ALv2", "apache2.html");
public static final License MPL2
= new License("Mozilla Public License, Version 2.0", "MPL 2.0", "mpl2.html");
public static final License MIT
= new License("MIT License", "MIT", "mit.html");
private StandardLicenses() { }
}

View File

@@ -46,14 +46,20 @@ public abstract class AppDatabase extends RoomDatabase {
public abstract SearchHistoryDAO searchHistoryDAO();
public abstract StreamDAO streamDAO();
public abstract StreamHistoryDAO streamHistoryDAO();
public abstract StreamStateDAO streamStateDAO();
public abstract PlaylistDAO playlistDAO();
public abstract PlaylistStreamDAO playlistStreamDAO();
public abstract PlaylistRemoteDAO playlistRemoteDAO();
public abstract FeedDAO feedDAO();
public abstract FeedGroupDAO feedGroupDAO();
public abstract SubscriptionDAO subscriptionDAO();
}

View File

@@ -9,19 +9,19 @@ import androidx.room.Update;
import java.util.Collection;
import java.util.List;
import io.reactivex.Flowable;
import io.reactivex.rxjava3.core.Flowable;
@Dao
public interface BasicDAO<Entity> {
/* Inserts */
@Insert(onConflict = OnConflictStrategy.FAIL)
long insert(final Entity entity);
@Insert(onConflict = OnConflictStrategy.ABORT)
long insert(Entity entity);
@Insert(onConflict = OnConflictStrategy.FAIL)
List<Long> insertAll(final Entity... entities);
@Insert(onConflict = OnConflictStrategy.ABORT)
List<Long> insertAll(Entity... entities);
@Insert(onConflict = OnConflictStrategy.FAIL)
List<Long> insertAll(final Collection<Entity> entities);
@Insert(onConflict = OnConflictStrategy.ABORT)
List<Long> insertAll(Collection<Entity> entities);
/* Searches */
Flowable<List<Entity>> getAll();
@@ -30,17 +30,17 @@ public interface BasicDAO<Entity> {
/* Deletes */
@Delete
void delete(final Entity entity);
void delete(Entity entity);
@Delete
int delete(final Collection<Entity> entities);
int delete(Collection<Entity> entities);
int deleteAll();
/* Updates */
@Update
int update(final Entity entity);
int update(Entity entity);
@Update
void update(final Collection<Entity> entities);
void update(Collection<Entity> entities);
}

View File

@@ -5,49 +5,58 @@ import androidx.room.TypeConverter;
import org.schabi.newpipe.extractor.stream.StreamType;
import org.schabi.newpipe.local.subscription.FeedGroupIcon;
import java.util.Date;
import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
public class Converters {
public final class Converters {
private Converters() { }
/**
* Convert a long value to a date
* Convert a long value to a {@link OffsetDateTime}.
*
* @param value the long value
* @return the date
* @return the {@code OffsetDateTime}
*/
@TypeConverter
public static Date fromTimestamp(Long value) {
return value == null ? null : new Date(value);
public static OffsetDateTime offsetDateTimeFromTimestamp(final Long value) {
return value == null ? null : OffsetDateTime.ofInstant(Instant.ofEpochMilli(value),
ZoneOffset.UTC);
}
/**
* Convert a date to a long value
* @param date the date
* Convert a {@link OffsetDateTime} to a long value.
*
* @param offsetDateTime the {@code OffsetDateTime}
* @return the long value
*/
@TypeConverter
public static Long dateToTimestamp(Date date) {
return date == null ? null : date.getTime();
public static Long offsetDateTimeToTimestamp(final OffsetDateTime offsetDateTime) {
return offsetDateTime == null ? null : offsetDateTime.withOffsetSameInstant(ZoneOffset.UTC)
.toInstant().toEpochMilli();
}
@TypeConverter
public static StreamType streamTypeOf(String value) {
public static StreamType streamTypeOf(final String value) {
return StreamType.valueOf(value);
}
@TypeConverter
public static String stringOf(StreamType streamType) {
public static String stringOf(final StreamType streamType) {
return streamType.name();
}
@TypeConverter
public static Integer integerOf(FeedGroupIcon feedGroupIcon) {
public static Integer integerOf(final FeedGroupIcon feedGroupIcon) {
return feedGroupIcon.getId();
}
@TypeConverter
public static FeedGroupIcon feedGroupIconOf(Integer id) {
for (FeedGroupIcon icon : FeedGroupIcon.values()) {
if (icon.getId() == id) return icon;
public static FeedGroupIcon feedGroupIconOf(final Integer id) {
for (final FeedGroupIcon icon : FeedGroupIcon.values()) {
if (icon.getId() == id) {
return icon;
}
}
throw new IllegalArgumentException("There's no feed group icon with the id \"" + id + "\"");

View File

@@ -1,6 +1,8 @@
package org.schabi.newpipe.database;
public interface LocalItem {
LocalItemType getLocalItemType();
enum LocalItemType {
PLAYLIST_LOCAL_ITEM,
PLAYLIST_REMOTE_ITEM,
@@ -8,6 +10,4 @@ public interface LocalItem {
PLAYLIST_STREAM_ITEM,
STATISTIC_STREAM_ITEM,
}
LocalItemType getLocalItemType();
}

View File

@@ -1,72 +1,103 @@
package org.schabi.newpipe.database;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.room.migration.Migration;
import androidx.annotation.NonNull;
import android.util.Log;
import org.schabi.newpipe.BuildConfig;
import androidx.annotation.NonNull;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
public class Migrations {
import org.schabi.newpipe.MainActivity;
public final class Migrations {
public static final int DB_VER_1 = 1;
public static final int DB_VER_2 = 2;
public static final int DB_VER_3 = 3;
public static final boolean DEBUG = !BuildConfig.BUILD_TYPE.equals("release");
private static final String TAG = Migrations.class.getName();
public static final boolean DEBUG = MainActivity.DEBUG;
public static final Migration MIGRATION_1_2 = new Migration(DB_VER_1, DB_VER_2) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
if(DEBUG) {
public void migrate(@NonNull final SupportSQLiteDatabase database) {
if (DEBUG) {
Log.d(TAG, "Start migrating database");
}
/*
* Unfortunately these queries must be hardcoded due to the possibility of
* schema and names changing at a later date, thus invalidating the older migration
* scripts if they are not hardcoded.
* */
* Unfortunately these queries must be hardcoded due to the possibility of
* schema and names changing at a later date, thus invalidating the older migration
* scripts if they are not hardcoded.
* */
// Not much we can do about this, since room doesn't create tables before migration.
// It's either this or blasting the entire database anew.
database.execSQL("CREATE INDEX `index_search_history_search` ON `search_history` (`search`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `streams` (`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `service_id` INTEGER NOT NULL, `url` TEXT, `title` TEXT, `stream_type` TEXT, `duration` INTEGER, `uploader` TEXT, `thumbnail_url` TEXT)");
database.execSQL("CREATE UNIQUE INDEX `index_streams_service_id_url` ON `streams` (`service_id`, `url`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `stream_history` (`stream_id` INTEGER NOT NULL, `access_date` INTEGER NOT NULL, `repeat_count` INTEGER NOT NULL, PRIMARY KEY(`stream_id`, `access_date`), FOREIGN KEY(`stream_id`) REFERENCES `streams`(`uid`) ON UPDATE CASCADE ON DELETE CASCADE )");
database.execSQL("CREATE INDEX `index_stream_history_stream_id` ON `stream_history` (`stream_id`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `stream_state` (`stream_id` INTEGER NOT NULL, `progress_time` INTEGER NOT NULL, PRIMARY KEY(`stream_id`), FOREIGN KEY(`stream_id`) REFERENCES `streams`(`uid`) ON UPDATE CASCADE ON DELETE CASCADE )");
database.execSQL("CREATE TABLE IF NOT EXISTS `playlists` (`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `thumbnail_url` TEXT)");
database.execSQL("CREATE INDEX `index_search_history_search` "
+ "ON `search_history` (`search`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `streams` "
+ "(`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "
+ "`service_id` INTEGER NOT NULL, `url` TEXT, `title` TEXT, "
+ "`stream_type` TEXT, `duration` INTEGER, `uploader` TEXT, "
+ "`thumbnail_url` TEXT)");
database.execSQL("CREATE UNIQUE INDEX `index_streams_service_id_url` "
+ "ON `streams` (`service_id`, `url`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `stream_history` "
+ "(`stream_id` INTEGER NOT NULL, `access_date` INTEGER NOT NULL, "
+ "`repeat_count` INTEGER NOT NULL, PRIMARY KEY(`stream_id`, `access_date`), "
+ "FOREIGN KEY(`stream_id`) REFERENCES `streams`(`uid`) "
+ "ON UPDATE CASCADE ON DELETE CASCADE )");
database.execSQL("CREATE INDEX `index_stream_history_stream_id` "
+ "ON `stream_history` (`stream_id`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `stream_state` "
+ "(`stream_id` INTEGER NOT NULL, `progress_time` INTEGER NOT NULL, "
+ "PRIMARY KEY(`stream_id`), FOREIGN KEY(`stream_id`) "
+ "REFERENCES `streams`(`uid`) ON UPDATE CASCADE ON DELETE CASCADE )");
database.execSQL("CREATE TABLE IF NOT EXISTS `playlists` "
+ "(`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "
+ "`name` TEXT, `thumbnail_url` TEXT)");
database.execSQL("CREATE INDEX `index_playlists_name` ON `playlists` (`name`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `playlist_stream_join` (`playlist_id` INTEGER NOT NULL, `stream_id` INTEGER NOT NULL, `join_index` INTEGER NOT NULL, PRIMARY KEY(`playlist_id`, `join_index`), FOREIGN KEY(`playlist_id`) REFERENCES `playlists`(`uid`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, FOREIGN KEY(`stream_id`) REFERENCES `streams`(`uid`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)");
database.execSQL("CREATE UNIQUE INDEX `index_playlist_stream_join_playlist_id_join_index` ON `playlist_stream_join` (`playlist_id`, `join_index`)");
database.execSQL("CREATE INDEX `index_playlist_stream_join_stream_id` ON `playlist_stream_join` (`stream_id`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `remote_playlists` (`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `service_id` INTEGER NOT NULL, `name` TEXT, `url` TEXT, `thumbnail_url` TEXT, `uploader` TEXT, `stream_count` INTEGER)");
database.execSQL("CREATE INDEX `index_remote_playlists_name` ON `remote_playlists` (`name`)");
database.execSQL("CREATE UNIQUE INDEX `index_remote_playlists_service_id_url` ON `remote_playlists` (`service_id`, `url`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `playlist_stream_join` "
+ "(`playlist_id` INTEGER NOT NULL, `stream_id` INTEGER NOT NULL, "
+ "`join_index` INTEGER NOT NULL, PRIMARY KEY(`playlist_id`, `join_index`), "
+ "FOREIGN KEY(`playlist_id`) REFERENCES `playlists`(`uid`) "
+ "ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, "
+ "FOREIGN KEY(`stream_id`) REFERENCES `streams`(`uid`) "
+ "ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)");
database.execSQL("CREATE UNIQUE INDEX "
+ "`index_playlist_stream_join_playlist_id_join_index` "
+ "ON `playlist_stream_join` (`playlist_id`, `join_index`)");
database.execSQL("CREATE INDEX `index_playlist_stream_join_stream_id` "
+ "ON `playlist_stream_join` (`stream_id`)");
database.execSQL("CREATE TABLE IF NOT EXISTS `remote_playlists` "
+ "(`uid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "
+ "`service_id` INTEGER NOT NULL, `name` TEXT, `url` TEXT, "
+ "`thumbnail_url` TEXT, `uploader` TEXT, `stream_count` INTEGER)");
database.execSQL("CREATE INDEX `index_remote_playlists_name` "
+ "ON `remote_playlists` (`name`)");
database.execSQL("CREATE UNIQUE INDEX `index_remote_playlists_service_id_url` "
+ "ON `remote_playlists` (`service_id`, `url`)");
// Populate streams table with existing entries in watch history
// Latest data first, thus ignoring older entries with the same indices
database.execSQL("INSERT OR IGNORE INTO streams (service_id, url, title, " +
"stream_type, duration, uploader, thumbnail_url) " +
database.execSQL("INSERT OR IGNORE INTO streams (service_id, url, title, "
+ "stream_type, duration, uploader, thumbnail_url) "
"SELECT service_id, url, title, 'VIDEO_STREAM', duration, " +
"uploader, thumbnail_url " +
+ "SELECT service_id, url, title, 'VIDEO_STREAM', duration, "
+ "uploader, thumbnail_url "
"FROM watch_history " +
"ORDER BY creation_date DESC");
+ "FROM watch_history "
+ "ORDER BY creation_date DESC");
// Once the streams have PKs, join them with the normalized history table
// and populate it with the remaining data from watch history
database.execSQL("INSERT INTO stream_history (stream_id, access_date, repeat_count)" +
"SELECT uid, creation_date, 1 " +
"FROM watch_history INNER JOIN streams " +
"ON watch_history.service_id == streams.service_id " +
"AND watch_history.url == streams.url " +
"ORDER BY creation_date DESC");
database.execSQL("INSERT INTO stream_history (stream_id, access_date, repeat_count)"
+ "SELECT uid, creation_date, 1 "
+ "FROM watch_history INNER JOIN streams "
+ "ON watch_history.service_id == streams.service_id "
+ "AND watch_history.url == streams.url "
+ "ORDER BY creation_date DESC");
database.execSQL("DROP TABLE IF EXISTS watch_history");
if(DEBUG) {
if (DEBUG) {
Log.d(TAG, "Stop migrating database");
}
}
@@ -74,29 +105,60 @@ public class Migrations {
public static final Migration MIGRATION_2_3 = new Migration(DB_VER_2, DB_VER_3) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
public void migrate(@NonNull final SupportSQLiteDatabase database) {
// Add NOT NULLs and new fields
database.execSQL("CREATE TABLE IF NOT EXISTS streams_new " +
"(uid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, url TEXT NOT NULL, title TEXT NOT NULL, stream_type TEXT NOT NULL," +
" duration INTEGER NOT NULL, uploader TEXT NOT NULL, thumbnail_url TEXT, view_count INTEGER, textual_upload_date TEXT, upload_date INTEGER," +
" is_upload_date_approximation INTEGER)");
database.execSQL("CREATE TABLE IF NOT EXISTS streams_new "
+ "(uid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "
+ "service_id INTEGER NOT NULL, url TEXT NOT NULL, title TEXT NOT NULL, "
+ "stream_type TEXT NOT NULL, duration INTEGER NOT NULL, "
+ "uploader TEXT NOT NULL, thumbnail_url TEXT, view_count INTEGER, "
+ "textual_upload_date TEXT, upload_date INTEGER, "
+ "is_upload_date_approximation INTEGER)");
database.execSQL("INSERT INTO streams_new (uid, service_id, url, title, stream_type, duration, uploader, thumbnail_url, view_count, textual_upload_date, upload_date, is_upload_date_approximation)"+
" SELECT uid, service_id, url, title, stream_type, duration, uploader, thumbnail_url, NULL, NULL, NULL, NULL FROM streams");
database.execSQL("INSERT INTO streams_new (uid, service_id, url, title, stream_type, "
+ "duration, uploader, thumbnail_url, view_count, textual_upload_date, "
+ "upload_date, is_upload_date_approximation) "
+ "SELECT uid, service_id, url, ifnull(title, ''), "
+ "ifnull(stream_type, 'VIDEO_STREAM'), ifnull(duration, 0), "
+ "ifnull(uploader, ''), ifnull(thumbnail_url, ''), NULL, NULL, NULL, NULL "
+ "FROM streams WHERE url IS NOT NULL");
database.execSQL("DROP TABLE streams");
database.execSQL("ALTER TABLE streams_new RENAME TO streams");
database.execSQL("CREATE UNIQUE INDEX index_streams_service_id_url ON streams (service_id, url)");
database.execSQL("CREATE UNIQUE INDEX index_streams_service_id_url "
+ "ON streams (service_id, url)");
// Tables for feed feature
database.execSQL("CREATE TABLE IF NOT EXISTS feed (stream_id INTEGER NOT NULL, subscription_id INTEGER NOT NULL, PRIMARY KEY(stream_id, subscription_id), FOREIGN KEY(stream_id) REFERENCES streams(uid) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, FOREIGN KEY(subscription_id) REFERENCES subscriptions(uid) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)");
database.execSQL("CREATE TABLE IF NOT EXISTS feed "
+ "(stream_id INTEGER NOT NULL, subscription_id INTEGER NOT NULL, "
+ "PRIMARY KEY(stream_id, subscription_id), "
+ "FOREIGN KEY(stream_id) REFERENCES streams(uid) "
+ "ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, "
+ "FOREIGN KEY(subscription_id) REFERENCES subscriptions(uid) "
+ "ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)");
database.execSQL("CREATE INDEX index_feed_subscription_id ON feed (subscription_id)");
database.execSQL("CREATE TABLE IF NOT EXISTS feed_group (uid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name TEXT NOT NULL, icon_id INTEGER NOT NULL, sort_order INTEGER NOT NULL)");
database.execSQL("CREATE TABLE IF NOT EXISTS feed_group "
+ "(uid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name TEXT NOT NULL, "
+ "icon_id INTEGER NOT NULL, sort_order INTEGER NOT NULL)");
database.execSQL("CREATE INDEX index_feed_group_sort_order ON feed_group (sort_order)");
database.execSQL("CREATE TABLE IF NOT EXISTS feed_group_subscription_join (group_id INTEGER NOT NULL, subscription_id INTEGER NOT NULL, PRIMARY KEY(group_id, subscription_id), FOREIGN KEY(group_id) REFERENCES feed_group(uid) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, FOREIGN KEY(subscription_id) REFERENCES subscriptions(uid) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)");
database.execSQL("CREATE INDEX index_feed_group_subscription_join_subscription_id ON feed_group_subscription_join (subscription_id)");
database.execSQL("CREATE TABLE IF NOT EXISTS feed_last_updated (subscription_id INTEGER NOT NULL, last_updated INTEGER, PRIMARY KEY(subscription_id), FOREIGN KEY(subscription_id) REFERENCES subscriptions(uid) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)");
database.execSQL("CREATE TABLE IF NOT EXISTS feed_group_subscription_join "
+ "(group_id INTEGER NOT NULL, subscription_id INTEGER NOT NULL, "
+ "PRIMARY KEY(group_id, subscription_id), "
+ "FOREIGN KEY(group_id) REFERENCES feed_group(uid) "
+ "ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, "
+ "FOREIGN KEY(subscription_id) REFERENCES subscriptions(uid) "
+ "ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)");
database.execSQL("CREATE INDEX index_feed_group_subscription_join_subscription_id "
+ "ON feed_group_subscription_join (subscription_id)");
database.execSQL("CREATE TABLE IF NOT EXISTS feed_last_updated "
+ "(subscription_id INTEGER NOT NULL, last_updated INTEGER, "
+ "PRIMARY KEY(subscription_id), "
+ "FOREIGN KEY(subscription_id) REFERENCES subscriptions(uid) "
+ "ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)");
}
};
private Migrations() { }
}

View File

@@ -1,19 +1,25 @@
package org.schabi.newpipe.database.feed.dao
import androidx.room.*
import io.reactivex.Flowable
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import androidx.room.Update
import io.reactivex.rxjava3.core.Flowable
import org.schabi.newpipe.database.feed.model.FeedEntity
import org.schabi.newpipe.database.feed.model.FeedLastUpdatedEntity
import org.schabi.newpipe.database.stream.model.StreamEntity
import org.schabi.newpipe.database.subscription.SubscriptionEntity
import java.util.*
import java.time.OffsetDateTime
@Dao
abstract class FeedDAO {
@Query("DELETE FROM feed")
abstract fun deleteAll(): Int
@Query("""
@Query(
"""
SELECT s.* FROM streams s
INNER JOIN feed f
@@ -22,10 +28,12 @@ abstract class FeedDAO {
ORDER BY s.upload_date IS NULL DESC, s.upload_date DESC, s.uploader ASC
LIMIT 500
""")
"""
)
abstract fun getAllStreams(): Flowable<List<StreamEntity>>
@Query("""
@Query(
"""
SELECT s.* FROM streams s
INNER JOIN feed f
@@ -41,10 +49,12 @@ abstract class FeedDAO {
ORDER BY s.upload_date IS NULL DESC, s.upload_date DESC, s.uploader ASC
LIMIT 500
""")
"""
)
abstract fun getAllStreamsFromGroup(groupId: Long): Flowable<List<StreamEntity>>
@Query("""
@Query(
"""
DELETE FROM feed WHERE
feed.stream_id IN (
@@ -53,12 +63,14 @@ abstract class FeedDAO {
INNER JOIN feed f
ON s.uid = f.stream_id
WHERE s.upload_date < :date
WHERE s.upload_date < :offsetDateTime
)
""")
abstract fun unlinkStreamsOlderThan(date: Date)
"""
)
abstract fun unlinkStreamsOlderThan(offsetDateTime: OffsetDateTime)
@Query("""
@Query(
"""
DELETE FROM feed
WHERE feed.subscription_id = :subscriptionId
@@ -71,7 +83,8 @@ abstract class FeedDAO {
WHERE s.stream_type = "LIVE_STREAM" OR s.stream_type = "AUDIO_LIVE_STREAM"
)
""")
"""
)
abstract fun unlinkOldLivestreams(subscriptionId: Long)
@Insert(onConflict = OnConflictStrategy.IGNORE)
@@ -95,21 +108,24 @@ abstract class FeedDAO {
}
}
@Query("""
@Query(
"""
SELECT MIN(lu.last_updated) FROM feed_last_updated lu
INNER JOIN feed_group_subscription_join fgs
ON fgs.subscription_id = lu.subscription_id AND fgs.group_id = :groupId
""")
abstract fun oldestSubscriptionUpdate(groupId: Long): Flowable<List<Date>>
"""
)
abstract fun oldestSubscriptionUpdate(groupId: Long): Flowable<List<OffsetDateTime>>
@Query("SELECT MIN(last_updated) FROM feed_last_updated")
abstract fun oldestSubscriptionUpdateFromAll(): Flowable<List<Date>>
abstract fun oldestSubscriptionUpdateFromAll(): Flowable<List<OffsetDateTime>>
@Query("SELECT COUNT(*) FROM feed_last_updated WHERE last_updated IS NULL")
abstract fun notLoadedCount(): Flowable<Long>
@Query("""
@Query(
"""
SELECT COUNT(*) FROM subscriptions s
INNER JOIN feed_group_subscription_join fgs
@@ -119,20 +135,24 @@ abstract class FeedDAO {
ON s.uid = lu.subscription_id
WHERE lu.last_updated IS NULL
""")
"""
)
abstract fun notLoadedCountForGroup(groupId: Long): Flowable<Long>
@Query("""
@Query(
"""
SELECT s.* FROM subscriptions s
LEFT JOIN feed_last_updated lu
ON s.uid = lu.subscription_id
WHERE lu.last_updated IS NULL OR lu.last_updated < :outdatedThreshold
""")
abstract fun getAllOutdated(outdatedThreshold: Date): Flowable<List<SubscriptionEntity>>
"""
)
abstract fun getAllOutdated(outdatedThreshold: OffsetDateTime): Flowable<List<SubscriptionEntity>>
@Query("""
@Query(
"""
SELECT s.* FROM subscriptions s
INNER JOIN feed_group_subscription_join fgs
@@ -142,6 +162,7 @@ abstract class FeedDAO {
ON s.uid = lu.subscription_id
WHERE lu.last_updated IS NULL OR lu.last_updated < :outdatedThreshold
""")
abstract fun getAllOutdatedForGroup(groupId: Long, outdatedThreshold: Date): Flowable<List<SubscriptionEntity>>
"""
)
abstract fun getAllOutdatedForGroup(groupId: Long, outdatedThreshold: OffsetDateTime): Flowable<List<SubscriptionEntity>>
}

View File

@@ -1,8 +1,13 @@
package org.schabi.newpipe.database.feed.dao
import androidx.room.*
import io.reactivex.Flowable
import io.reactivex.Maybe
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import androidx.room.Update
import io.reactivex.rxjava3.core.Flowable
import io.reactivex.rxjava3.core.Maybe
import org.schabi.newpipe.database.feed.model.FeedGroupEntity
import org.schabi.newpipe.database.feed.model.FeedGroupSubscriptionEntity

View File

@@ -10,28 +10,31 @@ import org.schabi.newpipe.database.feed.model.FeedEntity.Companion.SUBSCRIPTION_
import org.schabi.newpipe.database.stream.model.StreamEntity
import org.schabi.newpipe.database.subscription.SubscriptionEntity
@Entity(tableName = FEED_TABLE,
primaryKeys = [STREAM_ID, SUBSCRIPTION_ID],
indices = [Index(SUBSCRIPTION_ID)],
foreignKeys = [
ForeignKey(
entity = StreamEntity::class,
parentColumns = [StreamEntity.STREAM_ID],
childColumns = [STREAM_ID],
onDelete = ForeignKey.CASCADE, onUpdate = ForeignKey.CASCADE, deferred = true),
ForeignKey(
entity = SubscriptionEntity::class,
parentColumns = [SubscriptionEntity.SUBSCRIPTION_UID],
childColumns = [SUBSCRIPTION_ID],
onDelete = ForeignKey.CASCADE, onUpdate = ForeignKey.CASCADE, deferred = true)
]
@Entity(
tableName = FEED_TABLE,
primaryKeys = [STREAM_ID, SUBSCRIPTION_ID],
indices = [Index(SUBSCRIPTION_ID)],
foreignKeys = [
ForeignKey(
entity = StreamEntity::class,
parentColumns = [StreamEntity.STREAM_ID],
childColumns = [STREAM_ID],
onDelete = ForeignKey.CASCADE, onUpdate = ForeignKey.CASCADE, deferred = true
),
ForeignKey(
entity = SubscriptionEntity::class,
parentColumns = [SubscriptionEntity.SUBSCRIPTION_UID],
childColumns = [SUBSCRIPTION_ID],
onDelete = ForeignKey.CASCADE, onUpdate = ForeignKey.CASCADE, deferred = true
)
]
)
data class FeedEntity(
@ColumnInfo(name = STREAM_ID)
var streamId: Long,
@ColumnInfo(name = STREAM_ID)
var streamId: Long,
@ColumnInfo(name = SUBSCRIPTION_ID)
var subscriptionId: Long
@ColumnInfo(name = SUBSCRIPTION_ID)
var subscriptionId: Long
) {
companion object {
@@ -40,4 +43,4 @@ data class FeedEntity(
const val STREAM_ID = "stream_id"
const val SUBSCRIPTION_ID = "subscription_id"
}
}
}

View File

@@ -9,22 +9,22 @@ import org.schabi.newpipe.database.feed.model.FeedGroupEntity.Companion.SORT_ORD
import org.schabi.newpipe.local.subscription.FeedGroupIcon
@Entity(
tableName = FEED_GROUP_TABLE,
indices = [Index(SORT_ORDER)]
tableName = FEED_GROUP_TABLE,
indices = [Index(SORT_ORDER)]
)
data class FeedGroupEntity(
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = ID)
val uid: Long,
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = ID)
val uid: Long,
@ColumnInfo(name = NAME)
var name: String,
@ColumnInfo(name = NAME)
var name: String,
@ColumnInfo(name = ICON)
var icon: FeedGroupIcon,
@ColumnInfo(name = ICON)
var icon: FeedGroupIcon,
@ColumnInfo(name = SORT_ORDER)
var sortOrder: Long = -1
@ColumnInfo(name = SORT_ORDER)
var sortOrder: Long = -1
) {
companion object {
const val FEED_GROUP_TABLE = "feed_group"
@@ -36,4 +36,4 @@ data class FeedGroupEntity(
const val GROUP_ALL_ID = -1L
}
}
}

View File

@@ -11,29 +11,31 @@ import org.schabi.newpipe.database.feed.model.FeedGroupSubscriptionEntity.Compan
import org.schabi.newpipe.database.subscription.SubscriptionEntity
@Entity(
tableName = FEED_GROUP_SUBSCRIPTION_TABLE,
primaryKeys = [GROUP_ID, SUBSCRIPTION_ID],
indices = [Index(SUBSCRIPTION_ID)],
foreignKeys = [
ForeignKey(
entity = FeedGroupEntity::class,
parentColumns = [FeedGroupEntity.ID],
childColumns = [GROUP_ID],
onDelete = CASCADE, onUpdate = CASCADE, deferred = true),
tableName = FEED_GROUP_SUBSCRIPTION_TABLE,
primaryKeys = [GROUP_ID, SUBSCRIPTION_ID],
indices = [Index(SUBSCRIPTION_ID)],
foreignKeys = [
ForeignKey(
entity = FeedGroupEntity::class,
parentColumns = [FeedGroupEntity.ID],
childColumns = [GROUP_ID],
onDelete = CASCADE, onUpdate = CASCADE, deferred = true
),
ForeignKey(
entity = SubscriptionEntity::class,
parentColumns = [SubscriptionEntity.SUBSCRIPTION_UID],
childColumns = [SUBSCRIPTION_ID],
onDelete = CASCADE, onUpdate = CASCADE, deferred = true)
]
ForeignKey(
entity = SubscriptionEntity::class,
parentColumns = [SubscriptionEntity.SUBSCRIPTION_UID],
childColumns = [SUBSCRIPTION_ID],
onDelete = CASCADE, onUpdate = CASCADE, deferred = true
)
]
)
data class FeedGroupSubscriptionEntity(
@ColumnInfo(name = GROUP_ID)
var feedGroupId: Long,
@ColumnInfo(name = GROUP_ID)
var feedGroupId: Long,
@ColumnInfo(name = SUBSCRIPTION_ID)
var subscriptionId: Long
@ColumnInfo(name = SUBSCRIPTION_ID)
var subscriptionId: Long
) {
companion object {
@@ -42,4 +44,4 @@ data class FeedGroupSubscriptionEntity(
const val GROUP_ID = "group_id"
const val SUBSCRIPTION_ID = "subscription_id"
}
}
}

View File

@@ -7,31 +7,31 @@ import androidx.room.PrimaryKey
import org.schabi.newpipe.database.feed.model.FeedLastUpdatedEntity.Companion.FEED_LAST_UPDATED_TABLE
import org.schabi.newpipe.database.feed.model.FeedLastUpdatedEntity.Companion.SUBSCRIPTION_ID
import org.schabi.newpipe.database.subscription.SubscriptionEntity
import java.util.*
import java.time.OffsetDateTime
@Entity(
tableName = FEED_LAST_UPDATED_TABLE,
foreignKeys = [
ForeignKey(
entity = SubscriptionEntity::class,
parentColumns = [SubscriptionEntity.SUBSCRIPTION_UID],
childColumns = [SUBSCRIPTION_ID],
onDelete = ForeignKey.CASCADE, onUpdate = ForeignKey.CASCADE, deferred = true)
]
tableName = FEED_LAST_UPDATED_TABLE,
foreignKeys = [
ForeignKey(
entity = SubscriptionEntity::class,
parentColumns = [SubscriptionEntity.SUBSCRIPTION_UID],
childColumns = [SUBSCRIPTION_ID],
onDelete = ForeignKey.CASCADE, onUpdate = ForeignKey.CASCADE, deferred = true
)
]
)
data class FeedLastUpdatedEntity(
@PrimaryKey
@ColumnInfo(name = SUBSCRIPTION_ID)
var subscriptionId: Long,
@PrimaryKey
@ColumnInfo(name = SUBSCRIPTION_ID)
var subscriptionId: Long,
@ColumnInfo(name = LAST_UPDATED)
var lastUpdated: Date? = null
@ColumnInfo(name = LAST_UPDATED)
var lastUpdated: OffsetDateTime? = null
) {
companion object {
const val FEED_LAST_UPDATED_TABLE = "feed_last_updated"
const val SUBSCRIPTION_ID = "subscription_id"
const val LAST_UPDATED = "last_updated"
}
}
}

View File

@@ -1,14 +1,14 @@
package org.schabi.newpipe.database.history.dao;
import androidx.annotation.Nullable;
import androidx.room.Dao;
import androidx.room.Query;
import androidx.annotation.Nullable;
import org.schabi.newpipe.database.history.model.SearchHistoryEntry;
import java.util.List;
import io.reactivex.Flowable;
import io.reactivex.rxjava3.core.Flowable;
import static org.schabi.newpipe.database.history.model.SearchHistoryEntry.CREATION_DATE;
import static org.schabi.newpipe.database.history.model.SearchHistoryEntry.ID;
@@ -18,11 +18,10 @@ import static org.schabi.newpipe.database.history.model.SearchHistoryEntry.TABLE
@Dao
public interface SearchHistoryDAO extends HistoryDAO<SearchHistoryEntry> {
String ORDER_BY_CREATION_DATE = " ORDER BY " + CREATION_DATE + " DESC";
@Query("SELECT * FROM " + TABLE_NAME +
" WHERE " + ID + " = (SELECT MAX(" + ID + ") FROM " + TABLE_NAME + ")")
@Query("SELECT * FROM " + TABLE_NAME
+ " WHERE " + ID + " = (SELECT MAX(" + ID + ") FROM " + TABLE_NAME + ")")
@Nullable
SearchHistoryEntry getLatestEntry();
@@ -37,13 +36,16 @@ public interface SearchHistoryDAO extends HistoryDAO<SearchHistoryEntry> {
@Override
Flowable<List<SearchHistoryEntry>> getAll();
@Query("SELECT * FROM " + TABLE_NAME + " GROUP BY " + SEARCH + ORDER_BY_CREATION_DATE + " LIMIT :limit")
@Query("SELECT * FROM " + TABLE_NAME + " GROUP BY " + SEARCH + ORDER_BY_CREATION_DATE
+ " LIMIT :limit")
Flowable<List<SearchHistoryEntry>> getUniqueEntries(int limit);
@Query("SELECT * FROM " + TABLE_NAME + " WHERE " + SERVICE_ID + " = :serviceId" + ORDER_BY_CREATION_DATE)
@Query("SELECT * FROM " + TABLE_NAME
+ " WHERE " + SERVICE_ID + " = :serviceId" + ORDER_BY_CREATION_DATE)
@Override
Flowable<List<SearchHistoryEntry>> listByService(int serviceId);
@Query("SELECT * FROM " + TABLE_NAME + " WHERE " + SEARCH + " LIKE :query || '%' GROUP BY " + SEARCH + " LIMIT :limit")
@Query("SELECT * FROM " + TABLE_NAME + " WHERE " + SEARCH + " LIKE :query || '%'"
+ " GROUP BY " + SEARCH + " LIMIT :limit")
Flowable<List<SearchHistoryEntry>> getSimilarEntries(String query, int limit);
}

View File

@@ -1,32 +1,34 @@
package org.schabi.newpipe.database.history.dao;
import androidx.annotation.Nullable;
import androidx.room.Dao;
import androidx.room.Query;
import androidx.annotation.Nullable;
import org.schabi.newpipe.database.history.model.StreamHistoryEntity;
import org.schabi.newpipe.database.history.model.StreamHistoryEntry;
import org.schabi.newpipe.database.stream.StreamStatisticsEntry;
import org.schabi.newpipe.database.history.model.StreamHistoryEntity;
import java.util.List;
import io.reactivex.Flowable;
import io.reactivex.rxjava3.core.Flowable;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.JOIN_STREAM_ID;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_ACCESS_DATE;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_HISTORY_TABLE;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_REPEAT_COUNT;
import static org.schabi.newpipe.database.stream.StreamStatisticsEntry.STREAM_LATEST_DATE;
import static org.schabi.newpipe.database.stream.StreamStatisticsEntry.STREAM_WATCH_COUNT;
import static org.schabi.newpipe.database.stream.model.StreamEntity.STREAM_ID;
import static org.schabi.newpipe.database.stream.model.StreamEntity.STREAM_TABLE;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.JOIN_STREAM_ID;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_ACCESS_DATE;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_HISTORY_TABLE;
import static org.schabi.newpipe.database.stream.model.StreamStateEntity.JOIN_STREAM_ID_ALIAS;
import static org.schabi.newpipe.database.stream.model.StreamStateEntity.STREAM_PROGRESS_TIME;
import static org.schabi.newpipe.database.stream.model.StreamStateEntity.STREAM_STATE_TABLE;
@Dao
public abstract class StreamHistoryDAO implements HistoryDAO<StreamHistoryEntity> {
@Query("SELECT * FROM " + STREAM_HISTORY_TABLE +
" WHERE " + STREAM_ACCESS_DATE + " = " +
"(SELECT MAX(" + STREAM_ACCESS_DATE + ") FROM " + STREAM_HISTORY_TABLE + ")")
@Query("SELECT * FROM " + STREAM_HISTORY_TABLE
+ " WHERE " + STREAM_ACCESS_DATE + " = "
+ "(SELECT MAX(" + STREAM_ACCESS_DATE + ") FROM " + STREAM_HISTORY_TABLE + ")")
@Override
@Nullable
public abstract StreamHistoryEntity getLatestEntry();
@@ -40,33 +42,46 @@ public abstract class StreamHistoryDAO implements HistoryDAO<StreamHistoryEntity
public abstract int deleteAll();
@Override
public Flowable<List<StreamHistoryEntity>> listByService(int serviceId) {
public Flowable<List<StreamHistoryEntity>> listByService(final int serviceId) {
throw new UnsupportedOperationException();
}
@Query("SELECT * FROM " + STREAM_TABLE +
" INNER JOIN " + STREAM_HISTORY_TABLE +
" ON " + STREAM_ID + " = " + JOIN_STREAM_ID +
" ORDER BY " + STREAM_ACCESS_DATE + " DESC")
@Query("SELECT * FROM " + STREAM_TABLE
+ " INNER JOIN " + STREAM_HISTORY_TABLE
+ " ON " + STREAM_ID + " = " + JOIN_STREAM_ID
+ " ORDER BY " + STREAM_ACCESS_DATE + " DESC")
public abstract Flowable<List<StreamHistoryEntry>> getHistory();
@Query("SELECT * FROM " + STREAM_HISTORY_TABLE + " WHERE " + JOIN_STREAM_ID +
" = :streamId ORDER BY " + STREAM_ACCESS_DATE + " DESC LIMIT 1")
@Query("SELECT * FROM " + STREAM_TABLE
+ " INNER JOIN " + STREAM_HISTORY_TABLE
+ " ON " + STREAM_ID + " = " + JOIN_STREAM_ID
+ " ORDER BY " + STREAM_ID + " ASC")
public abstract Flowable<List<StreamHistoryEntry>> getHistorySortedById();
@Query("SELECT * FROM " + STREAM_HISTORY_TABLE + " WHERE " + JOIN_STREAM_ID
+ " = :streamId ORDER BY " + STREAM_ACCESS_DATE + " DESC LIMIT 1")
@Nullable
public abstract StreamHistoryEntity getLatestEntry(final long streamId);
public abstract StreamHistoryEntity getLatestEntry(long streamId);
@Query("DELETE FROM " + STREAM_HISTORY_TABLE + " WHERE " + JOIN_STREAM_ID + " = :streamId")
public abstract int deleteStreamHistory(final long streamId);
public abstract int deleteStreamHistory(long streamId);
@Query("SELECT * FROM " + STREAM_TABLE +
@Query("SELECT * FROM " + STREAM_TABLE
// Select the latest entry and watch count for each stream id on history table
" INNER JOIN " +
"(SELECT " + JOIN_STREAM_ID + ", " +
" MAX(" + STREAM_ACCESS_DATE + ") AS " + STREAM_LATEST_DATE + ", " +
" SUM(" + STREAM_REPEAT_COUNT + ") AS " + STREAM_WATCH_COUNT +
" FROM " + STREAM_HISTORY_TABLE + " GROUP BY " + JOIN_STREAM_ID + ")" +
+ " INNER JOIN "
+ "(SELECT " + JOIN_STREAM_ID + ", "
+ " MAX(" + STREAM_ACCESS_DATE + ") AS " + STREAM_LATEST_DATE + ", "
+ " SUM(" + STREAM_REPEAT_COUNT + ") AS " + STREAM_WATCH_COUNT
+ " FROM " + STREAM_HISTORY_TABLE + " GROUP BY " + JOIN_STREAM_ID + ")"
" ON " + STREAM_ID + " = " + JOIN_STREAM_ID)
+ " ON " + STREAM_ID + " = " + JOIN_STREAM_ID
+ " LEFT JOIN "
+ "(SELECT " + JOIN_STREAM_ID + " AS " + JOIN_STREAM_ID_ALIAS + ", "
+ STREAM_PROGRESS_TIME
+ " FROM " + STREAM_STATE_TABLE + " )"
+ " ON " + STREAM_ID + " = " + JOIN_STREAM_ID_ALIAS)
public abstract Flowable<List<StreamStatisticsEntry>> getStatistics();
}

View File

@@ -6,14 +6,13 @@ import androidx.room.Ignore;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import java.util.Date;
import java.time.OffsetDateTime;
import static org.schabi.newpipe.database.history.model.SearchHistoryEntry.SEARCH;
@Entity(tableName = SearchHistoryEntry.TABLE_NAME,
indices = {@Index(value = SEARCH)})
public class SearchHistoryEntry {
public static final String ID = "id";
public static final String TABLE_NAME = "search_history";
public static final String SERVICE_ID = "service_id";
@@ -25,7 +24,7 @@ public class SearchHistoryEntry {
private long id;
@ColumnInfo(name = CREATION_DATE)
private Date creationDate;
private OffsetDateTime creationDate;
@ColumnInfo(name = SERVICE_ID)
private int serviceId;
@@ -33,7 +32,8 @@ public class SearchHistoryEntry {
@ColumnInfo(name = SEARCH)
private String search;
public SearchHistoryEntry(Date creationDate, int serviceId, String search) {
public SearchHistoryEntry(final OffsetDateTime creationDate, final int serviceId,
final String search) {
this.serviceId = serviceId;
this.creationDate = creationDate;
this.search = search;
@@ -43,15 +43,15 @@ public class SearchHistoryEntry {
return id;
}
public void setId(long id) {
public void setId(final long id) {
this.id = id;
}
public Date getCreationDate() {
public OffsetDateTime getCreationDate() {
return creationDate;
}
public void setCreationDate(Date creationDate) {
public void setCreationDate(final OffsetDateTime creationDate) {
this.creationDate = creationDate;
}
@@ -59,7 +59,7 @@ public class SearchHistoryEntry {
return serviceId;
}
public void setServiceId(int serviceId) {
public void setServiceId(final int serviceId) {
this.serviceId = serviceId;
}
@@ -67,13 +67,13 @@ public class SearchHistoryEntry {
return search;
}
public void setSearch(String search) {
public void setSearch(final String search) {
this.search = search;
}
@Ignore
public boolean hasEqualValues(SearchHistoryEntry otherEntry) {
return getServiceId() == otherEntry.getServiceId() &&
getSearch().equals(otherEntry.getSearch());
public boolean hasEqualValues(final SearchHistoryEntry otherEntry) {
return getServiceId() == otherEntry.getServiceId()
&& getSearch().equals(otherEntry.getSearch());
}
}

View File

@@ -1,20 +1,20 @@
package org.schabi.newpipe.database.history.model;
import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Ignore;
import androidx.room.Index;
import androidx.annotation.NonNull;
import org.schabi.newpipe.database.stream.model.StreamEntity;
import java.util.Date;
import java.time.OffsetDateTime;
import static androidx.room.ForeignKey.CASCADE;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_HISTORY_TABLE;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.JOIN_STREAM_ID;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_ACCESS_DATE;
import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STREAM_HISTORY_TABLE;
@Entity(tableName = STREAM_HISTORY_TABLE,
primaryKeys = {JOIN_STREAM_ID, STREAM_ACCESS_DATE},
@@ -27,29 +27,30 @@ import static org.schabi.newpipe.database.history.model.StreamHistoryEntity.STRE
onDelete = CASCADE, onUpdate = CASCADE)
})
public class StreamHistoryEntity {
final public static String STREAM_HISTORY_TABLE = "stream_history";
final public static String JOIN_STREAM_ID = "stream_id";
final public static String STREAM_ACCESS_DATE = "access_date";
final public static String STREAM_REPEAT_COUNT = "repeat_count";
public static final String STREAM_HISTORY_TABLE = "stream_history";
public static final String JOIN_STREAM_ID = "stream_id";
public static final String STREAM_ACCESS_DATE = "access_date";
public static final String STREAM_REPEAT_COUNT = "repeat_count";
@ColumnInfo(name = JOIN_STREAM_ID)
private long streamUid;
@NonNull
@ColumnInfo(name = STREAM_ACCESS_DATE)
private Date accessDate;
private OffsetDateTime accessDate;
@ColumnInfo(name = STREAM_REPEAT_COUNT)
private long repeatCount;
public StreamHistoryEntity(long streamUid, @NonNull Date accessDate, long repeatCount) {
public StreamHistoryEntity(final long streamUid, @NonNull final OffsetDateTime accessDate,
final long repeatCount) {
this.streamUid = streamUid;
this.accessDate = accessDate;
this.repeatCount = repeatCount;
}
@Ignore
public StreamHistoryEntity(long streamUid, @NonNull Date accessDate) {
public StreamHistoryEntity(final long streamUid, @NonNull final OffsetDateTime accessDate) {
this(streamUid, accessDate, 1);
}
@@ -57,15 +58,16 @@ public class StreamHistoryEntity {
return streamUid;
}
public void setStreamUid(long streamUid) {
public void setStreamUid(final long streamUid) {
this.streamUid = streamUid;
}
public Date getAccessDate() {
@NonNull
public OffsetDateTime getAccessDate() {
return accessDate;
}
public void setAccessDate(@NonNull Date accessDate) {
public void setAccessDate(@NonNull final OffsetDateTime accessDate) {
this.accessDate = accessDate;
}
@@ -73,7 +75,7 @@ public class StreamHistoryEntity {
return repeatCount;
}
public void setRepeatCount(long repeatCount) {
public void setRepeatCount(final long repeatCount) {
this.repeatCount = repeatCount;
}
}

View File

@@ -3,20 +3,20 @@ package org.schabi.newpipe.database.history.model
import androidx.room.ColumnInfo
import androidx.room.Embedded
import org.schabi.newpipe.database.stream.model.StreamEntity
import java.util.*
import java.time.OffsetDateTime
data class StreamHistoryEntry(
@Embedded
val streamEntity: StreamEntity,
@Embedded
val streamEntity: StreamEntity,
@ColumnInfo(name = StreamHistoryEntity.JOIN_STREAM_ID)
val streamId: Long,
@ColumnInfo(name = StreamHistoryEntity.JOIN_STREAM_ID)
val streamId: Long,
@ColumnInfo(name = StreamHistoryEntity.STREAM_ACCESS_DATE)
val accessDate: Date,
@ColumnInfo(name = StreamHistoryEntity.STREAM_ACCESS_DATE)
val accessDate: OffsetDateTime,
@ColumnInfo(name = StreamHistoryEntity.STREAM_REPEAT_COUNT)
val repeatCount: Long
@ColumnInfo(name = StreamHistoryEntity.STREAM_REPEAT_COUNT)
val repeatCount: Long
) {
fun toStreamHistoryEntity(): StreamHistoryEntity {
@@ -25,6 +25,6 @@ data class StreamHistoryEntry(
fun hasEqualValues(other: StreamHistoryEntry): Boolean {
return this.streamEntity.uid == other.streamEntity.uid && streamId == other.streamId &&
accessDate.compareTo(other.accessDate) == 0
accessDate.isEqual(other.accessDate)
}
}

View File

@@ -1,7 +1,27 @@
package org.schabi.newpipe.database.playlist;
import org.schabi.newpipe.database.LocalItem;
import org.schabi.newpipe.database.playlist.model.PlaylistRemoteEntity;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public interface PlaylistLocalItem extends LocalItem {
String getOrderingName();
static List<PlaylistLocalItem> merge(
final List<PlaylistMetadataEntry> localPlaylists,
final List<PlaylistRemoteEntity> remotePlaylists) {
final List<PlaylistLocalItem> items = new ArrayList<>(
localPlaylists.size() + remotePlaylists.size());
items.addAll(localPlaylists);
items.addAll(remotePlaylists);
Collections.sort(items, Comparator.comparing(PlaylistLocalItem::getOrderingName,
Comparator.nullsLast(String.CASE_INSENSITIVE_ORDER)));
return items;
}
}

View File

@@ -7,18 +7,19 @@ import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_THUMBNAIL_URL;
public class PlaylistMetadataEntry implements PlaylistLocalItem {
final public static String PLAYLIST_STREAM_COUNT = "streamCount";
public static final String PLAYLIST_STREAM_COUNT = "streamCount";
@ColumnInfo(name = PLAYLIST_ID)
final public long uid;
public final long uid;
@ColumnInfo(name = PLAYLIST_NAME)
final public String name;
public final String name;
@ColumnInfo(name = PLAYLIST_THUMBNAIL_URL)
final public String thumbnailUrl;
public final String thumbnailUrl;
@ColumnInfo(name = PLAYLIST_STREAM_COUNT)
final public long streamCount;
public final long streamCount;
public PlaylistMetadataEntry(long uid, String name, String thumbnailUrl, long streamCount) {
public PlaylistMetadataEntry(final long uid, final String name, final String thumbnailUrl,
final long streamCount) {
this.uid = uid;
this.name = name;
this.thumbnailUrl = thumbnailUrl;

View File

@@ -5,17 +5,22 @@ import androidx.room.Embedded
import org.schabi.newpipe.database.LocalItem
import org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity
import org.schabi.newpipe.database.stream.model.StreamEntity
import org.schabi.newpipe.database.stream.model.StreamStateEntity
import org.schabi.newpipe.extractor.stream.StreamInfoItem
import kotlin.jvm.Throws
class PlaylistStreamEntry(
@Embedded
val streamEntity: StreamEntity,
@Embedded
val streamEntity: StreamEntity,
@ColumnInfo(name = PlaylistStreamEntity.JOIN_STREAM_ID)
val streamId: Long,
@ColumnInfo(name = StreamStateEntity.STREAM_PROGRESS_TIME, defaultValue = "0")
val progressTime: Long,
@ColumnInfo(name = PlaylistStreamEntity.JOIN_INDEX)
val joinIndex: Int
@ColumnInfo(name = PlaylistStreamEntity.JOIN_STREAM_ID)
val streamId: Long,
@ColumnInfo(name = PlaylistStreamEntity.JOIN_INDEX)
val joinIndex: Int
) : LocalItem {
@Throws(IllegalArgumentException::class)

View File

@@ -8,7 +8,7 @@ import org.schabi.newpipe.database.playlist.model.PlaylistEntity;
import java.util.List;
import io.reactivex.Flowable;
import io.reactivex.rxjava3.core.Flowable;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_ID;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_TABLE;
@@ -24,13 +24,16 @@ public abstract class PlaylistDAO implements BasicDAO<PlaylistEntity> {
public abstract int deleteAll();
@Override
public Flowable<List<PlaylistEntity>> listByService(int serviceId) {
public Flowable<List<PlaylistEntity>> listByService(final int serviceId) {
throw new UnsupportedOperationException();
}
@Query("SELECT * FROM " + PLAYLIST_TABLE + " WHERE " + PLAYLIST_ID + " = :playlistId")
public abstract Flowable<List<PlaylistEntity>> getPlaylist(final long playlistId);
public abstract Flowable<List<PlaylistEntity>> getPlaylist(long playlistId);
@Query("DELETE FROM " + PLAYLIST_TABLE + " WHERE " + PLAYLIST_ID + " = :playlistId")
public abstract int deletePlaylist(final long playlistId);
public abstract int deletePlaylist(long playlistId);
@Query("SELECT COUNT(*) FROM " + PLAYLIST_TABLE)
public abstract Flowable<Long> getCount();
}

View File

@@ -9,7 +9,7 @@ import org.schabi.newpipe.database.playlist.model.PlaylistRemoteEntity;
import java.util.List;
import io.reactivex.Flowable;
import io.reactivex.rxjava3.core.Flowable;
import static org.schabi.newpipe.database.playlist.model.PlaylistRemoteEntity.REMOTE_PLAYLIST_ID;
import static org.schabi.newpipe.database.playlist.model.PlaylistRemoteEntity.REMOTE_PLAYLIST_SERVICE_ID;
@@ -27,22 +27,21 @@ public abstract class PlaylistRemoteDAO implements BasicDAO<PlaylistRemoteEntity
public abstract int deleteAll();
@Override
@Query("SELECT * FROM " + REMOTE_PLAYLIST_TABLE +
" WHERE " + REMOTE_PLAYLIST_SERVICE_ID + " = :serviceId")
@Query("SELECT * FROM " + REMOTE_PLAYLIST_TABLE
+ " WHERE " + REMOTE_PLAYLIST_SERVICE_ID + " = :serviceId")
public abstract Flowable<List<PlaylistRemoteEntity>> listByService(int serviceId);
@Query("SELECT * FROM " + REMOTE_PLAYLIST_TABLE + " WHERE " +
REMOTE_PLAYLIST_URL + " = :url AND " +
REMOTE_PLAYLIST_SERVICE_ID + " = :serviceId")
@Query("SELECT * FROM " + REMOTE_PLAYLIST_TABLE + " WHERE "
+ REMOTE_PLAYLIST_URL + " = :url AND " + REMOTE_PLAYLIST_SERVICE_ID + " = :serviceId")
public abstract Flowable<List<PlaylistRemoteEntity>> getPlaylist(long serviceId, String url);
@Query("SELECT " + REMOTE_PLAYLIST_ID + " FROM " + REMOTE_PLAYLIST_TABLE +
" WHERE " +
REMOTE_PLAYLIST_URL + " = :url AND " + REMOTE_PLAYLIST_SERVICE_ID + " = :serviceId")
@Query("SELECT " + REMOTE_PLAYLIST_ID + " FROM " + REMOTE_PLAYLIST_TABLE
+ " WHERE " + REMOTE_PLAYLIST_URL + " = :url "
+ "AND " + REMOTE_PLAYLIST_SERVICE_ID + " = :serviceId")
abstract Long getPlaylistIdInternal(long serviceId, String url);
@Transaction
public long upsert(PlaylistRemoteEntity playlist) {
public long upsert(final PlaylistRemoteEntity playlist) {
final Long playlistId = getPlaylistIdInternal(playlist.getServiceId(), playlist.getUrl());
if (playlistId == null) {
@@ -54,7 +53,7 @@ public abstract class PlaylistRemoteDAO implements BasicDAO<PlaylistRemoteEntity
}
}
@Query("DELETE FROM " + REMOTE_PLAYLIST_TABLE +
" WHERE " + REMOTE_PLAYLIST_ID + " = :playlistId")
public abstract int deletePlaylist(final long playlistId);
@Query("DELETE FROM " + REMOTE_PLAYLIST_TABLE
+ " WHERE " + REMOTE_PLAYLIST_ID + " = :playlistId")
public abstract int deletePlaylist(long playlistId);
}

View File

@@ -11,12 +11,22 @@ import org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity;
import java.util.List;
import io.reactivex.Flowable;
import io.reactivex.rxjava3.core.Flowable;
import static org.schabi.newpipe.database.playlist.PlaylistMetadataEntry.PLAYLIST_STREAM_COUNT;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.*;
import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.*;
import static org.schabi.newpipe.database.stream.model.StreamEntity.*;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_ID;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_NAME;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_TABLE;
import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST_THUMBNAIL_URL;
import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.JOIN_INDEX;
import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.JOIN_PLAYLIST_ID;
import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.JOIN_STREAM_ID;
import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.PLAYLIST_STREAM_JOIN_TABLE;
import static org.schabi.newpipe.database.stream.model.StreamEntity.STREAM_ID;
import static org.schabi.newpipe.database.stream.model.StreamEntity.STREAM_TABLE;
import static org.schabi.newpipe.database.stream.model.StreamStateEntity.JOIN_STREAM_ID_ALIAS;
import static org.schabi.newpipe.database.stream.model.StreamStateEntity.STREAM_PROGRESS_TIME;
import static org.schabi.newpipe.database.stream.model.StreamStateEntity.STREAM_STATE_TABLE;
@Dao
public abstract class PlaylistStreamDAO implements BasicDAO<PlaylistStreamEntity> {
@@ -29,40 +39,46 @@ public abstract class PlaylistStreamDAO implements BasicDAO<PlaylistStreamEntity
public abstract int deleteAll();
@Override
public Flowable<List<PlaylistStreamEntity>> listByService(int serviceId) {
public Flowable<List<PlaylistStreamEntity>> listByService(final int serviceId) {
throw new UnsupportedOperationException();
}
@Query("DELETE FROM " + PLAYLIST_STREAM_JOIN_TABLE +
" WHERE " + JOIN_PLAYLIST_ID + " = :playlistId")
public abstract void deleteBatch(final long playlistId);
@Query("DELETE FROM " + PLAYLIST_STREAM_JOIN_TABLE
+ " WHERE " + JOIN_PLAYLIST_ID + " = :playlistId")
public abstract void deleteBatch(long playlistId);
@Query("SELECT COALESCE(MAX(" + JOIN_INDEX + "), -1)" +
" FROM " + PLAYLIST_STREAM_JOIN_TABLE +
" WHERE " + JOIN_PLAYLIST_ID + " = :playlistId")
public abstract Flowable<Integer> getMaximumIndexOf(final long playlistId);
@Query("SELECT COALESCE(MAX(" + JOIN_INDEX + "), -1)"
+ " FROM " + PLAYLIST_STREAM_JOIN_TABLE
+ " WHERE " + JOIN_PLAYLIST_ID + " = :playlistId")
public abstract Flowable<Integer> getMaximumIndexOf(long playlistId);
@Transaction
@Query("SELECT * FROM " + STREAM_TABLE + " INNER JOIN " +
@Query("SELECT * FROM " + STREAM_TABLE + " INNER JOIN "
// get ids of streams of the given playlist
"(SELECT " + JOIN_STREAM_ID + "," + JOIN_INDEX +
" FROM " + PLAYLIST_STREAM_JOIN_TABLE +
" WHERE " + JOIN_PLAYLIST_ID + " = :playlistId)" +
+ "(SELECT " + JOIN_STREAM_ID + "," + JOIN_INDEX
+ " FROM " + PLAYLIST_STREAM_JOIN_TABLE
+ " WHERE " + JOIN_PLAYLIST_ID + " = :playlistId)"
// then merge with the stream metadata
" ON " + STREAM_ID + " = " + JOIN_STREAM_ID +
" ORDER BY " + JOIN_INDEX + " ASC")
+ " ON " + STREAM_ID + " = " + JOIN_STREAM_ID
+ " LEFT JOIN "
+ "(SELECT " + JOIN_STREAM_ID + " AS " + JOIN_STREAM_ID_ALIAS + ", "
+ STREAM_PROGRESS_TIME
+ " FROM " + STREAM_STATE_TABLE + " )"
+ " ON " + STREAM_ID + " = " + JOIN_STREAM_ID_ALIAS
+ " ORDER BY " + JOIN_INDEX + " ASC")
public abstract Flowable<List<PlaylistStreamEntry>> getOrderedStreamsOf(long playlistId);
@Transaction
@Query("SELECT " + PLAYLIST_ID + ", " + PLAYLIST_NAME + ", " +
PLAYLIST_THUMBNAIL_URL + ", " +
"COALESCE(COUNT(" + JOIN_PLAYLIST_ID + "), 0) AS " + PLAYLIST_STREAM_COUNT +
@Query("SELECT " + PLAYLIST_ID + ", " + PLAYLIST_NAME + ", " + PLAYLIST_THUMBNAIL_URL + ", "
+ "COALESCE(COUNT(" + JOIN_PLAYLIST_ID + "), 0) AS " + PLAYLIST_STREAM_COUNT
" FROM " + PLAYLIST_TABLE +
" LEFT JOIN " + PLAYLIST_STREAM_JOIN_TABLE +
" ON " + PLAYLIST_ID + " = " + JOIN_PLAYLIST_ID +
" GROUP BY " + JOIN_PLAYLIST_ID +
" ORDER BY " + PLAYLIST_NAME + " COLLATE NOCASE ASC")
+ " FROM " + PLAYLIST_TABLE
+ " LEFT JOIN " + PLAYLIST_STREAM_JOIN_TABLE
+ " ON " + PLAYLIST_ID + " = " + JOIN_PLAYLIST_ID
+ " GROUP BY " + JOIN_PLAYLIST_ID
+ " ORDER BY " + PLAYLIST_NAME + " COLLATE NOCASE ASC")
public abstract Flowable<List<PlaylistMetadataEntry>> getPlaylistMetadata();
}

View File

@@ -11,10 +11,10 @@ import static org.schabi.newpipe.database.playlist.model.PlaylistEntity.PLAYLIST
@Entity(tableName = PLAYLIST_TABLE,
indices = {@Index(value = {PLAYLIST_NAME})})
public class PlaylistEntity {
final public static String PLAYLIST_TABLE = "playlists";
final public static String PLAYLIST_ID = "uid";
final public static String PLAYLIST_NAME = "name";
final public static String PLAYLIST_THUMBNAIL_URL = "thumbnail_url";
public static final String PLAYLIST_TABLE = "playlists";
public static final String PLAYLIST_ID = "uid";
public static final String PLAYLIST_NAME = "name";
public static final String PLAYLIST_THUMBNAIL_URL = "thumbnail_url";
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = PLAYLIST_ID)
@@ -26,7 +26,7 @@ public class PlaylistEntity {
@ColumnInfo(name = PLAYLIST_THUMBNAIL_URL)
private String thumbnailUrl;
public PlaylistEntity(String name, String thumbnailUrl) {
public PlaylistEntity(final String name, final String thumbnailUrl) {
this.name = name;
this.thumbnailUrl = thumbnailUrl;
}
@@ -35,7 +35,7 @@ public class PlaylistEntity {
return uid;
}
public void setUid(long uid) {
public void setUid(final long uid) {
this.uid = uid;
}
@@ -43,7 +43,7 @@ public class PlaylistEntity {
return name;
}
public void setName(String name) {
public void setName(final String name) {
this.name = name;
}
@@ -51,7 +51,7 @@ public class PlaylistEntity {
return thumbnailUrl;
}
public void setThumbnailUrl(String thumbnailUrl) {
public void setThumbnailUrl(final String thumbnailUrl) {
this.thumbnailUrl = thumbnailUrl;
}
}

View File

@@ -24,14 +24,14 @@ import static org.schabi.newpipe.database.playlist.model.PlaylistRemoteEntity.RE
@Index(value = {REMOTE_PLAYLIST_SERVICE_ID, REMOTE_PLAYLIST_URL}, unique = true)
})
public class PlaylistRemoteEntity implements PlaylistLocalItem {
final public static String REMOTE_PLAYLIST_TABLE = "remote_playlists";
final public static String REMOTE_PLAYLIST_ID = "uid";
final public static String REMOTE_PLAYLIST_SERVICE_ID = "service_id";
final public static String REMOTE_PLAYLIST_NAME = "name";
final public static String REMOTE_PLAYLIST_URL = "url";
final public static String REMOTE_PLAYLIST_THUMBNAIL_URL = "thumbnail_url";
final public static String REMOTE_PLAYLIST_UPLOADER_NAME = "uploader";
final public static String REMOTE_PLAYLIST_STREAM_COUNT = "stream_count";
public static final String REMOTE_PLAYLIST_TABLE = "remote_playlists";
public static final String REMOTE_PLAYLIST_ID = "uid";
public static final String REMOTE_PLAYLIST_SERVICE_ID = "service_id";
public static final String REMOTE_PLAYLIST_NAME = "name";
public static final String REMOTE_PLAYLIST_URL = "url";
public static final String REMOTE_PLAYLIST_THUMBNAIL_URL = "thumbnail_url";
public static final String REMOTE_PLAYLIST_UPLOADER_NAME = "uploader";
public static final String REMOTE_PLAYLIST_STREAM_COUNT = "stream_count";
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = REMOTE_PLAYLIST_ID)
@@ -55,8 +55,9 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
@ColumnInfo(name = REMOTE_PLAYLIST_STREAM_COUNT)
private Long streamCount;
public PlaylistRemoteEntity(int serviceId, String name, String url, String thumbnailUrl,
String uploader, Long streamCount) {
public PlaylistRemoteEntity(final int serviceId, final String name, final String url,
final String thumbnailUrl, final String uploader,
final Long streamCount) {
this.serviceId = serviceId;
this.name = name;
this.url = url;
@@ -68,7 +69,8 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
@Ignore
public PlaylistRemoteEntity(final PlaylistInfo info) {
this(info.getServiceId(), info.getName(), info.getUrl(),
info.getThumbnailUrl() == null ? info.getUploaderAvatarUrl() : info.getThumbnailUrl(),
info.getThumbnailUrl() == null
? info.getUploaderAvatarUrl() : info.getThumbnailUrl(),
info.getUploaderName(), info.getStreamCount());
}
@@ -90,7 +92,7 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
return uid;
}
public void setUid(long uid) {
public void setUid(final long uid) {
this.uid = uid;
}
@@ -98,7 +100,7 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
return serviceId;
}
public void setServiceId(int serviceId) {
public void setServiceId(final int serviceId) {
this.serviceId = serviceId;
}
@@ -106,7 +108,7 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
return name;
}
public void setName(String name) {
public void setName(final String name) {
this.name = name;
}
@@ -114,7 +116,7 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
return thumbnailUrl;
}
public void setThumbnailUrl(String thumbnailUrl) {
public void setThumbnailUrl(final String thumbnailUrl) {
this.thumbnailUrl = thumbnailUrl;
}
@@ -122,7 +124,7 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
return url;
}
public void setUrl(String url) {
public void setUrl(final String url) {
this.url = url;
}
@@ -130,7 +132,7 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
return uploader;
}
public void setUploader(String uploader) {
public void setUploader(final String uploader) {
this.uploader = uploader;
}
@@ -138,7 +140,7 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
return streamCount;
}
public void setStreamCount(Long streamCount) {
public void setStreamCount(final Long streamCount) {
this.streamCount = streamCount;
}

View File

@@ -30,11 +30,10 @@ import static org.schabi.newpipe.database.playlist.model.PlaylistStreamEntity.PL
onDelete = CASCADE, onUpdate = CASCADE, deferred = true)
})
public class PlaylistStreamEntity {
final public static String PLAYLIST_STREAM_JOIN_TABLE = "playlist_stream_join";
final public static String JOIN_PLAYLIST_ID = "playlist_id";
final public static String JOIN_STREAM_ID = "stream_id";
final public static String JOIN_INDEX = "join_index";
public static final String PLAYLIST_STREAM_JOIN_TABLE = "playlist_stream_join";
public static final String JOIN_PLAYLIST_ID = "playlist_id";
public static final String JOIN_STREAM_ID = "stream_id";
public static final String JOIN_INDEX = "join_index";
@ColumnInfo(name = JOIN_PLAYLIST_ID)
private long playlistUid;
@@ -55,23 +54,23 @@ public class PlaylistStreamEntity {
return playlistUid;
}
public void setPlaylistUid(final long playlistUid) {
this.playlistUid = playlistUid;
}
public long getStreamUid() {
return streamUid;
}
public void setStreamUid(final long streamUid) {
this.streamUid = streamUid;
}
public int getIndex() {
return index;
}
public void setPlaylistUid(long playlistUid) {
this.playlistUid = playlistUid;
}
public void setStreamUid(long streamUid) {
this.streamUid = streamUid;
}
public void setIndex(int index) {
public void setIndex(final int index) {
this.index = index;
}
}

View File

@@ -5,23 +5,26 @@ import androidx.room.Embedded
import org.schabi.newpipe.database.LocalItem
import org.schabi.newpipe.database.history.model.StreamHistoryEntity
import org.schabi.newpipe.database.stream.model.StreamEntity
import org.schabi.newpipe.database.stream.model.StreamStateEntity.STREAM_PROGRESS_TIME
import org.schabi.newpipe.extractor.stream.StreamInfoItem
import java.util.*
import java.time.OffsetDateTime
class StreamStatisticsEntry(
@Embedded
val streamEntity: StreamEntity,
@Embedded
val streamEntity: StreamEntity,
@ColumnInfo(name = StreamHistoryEntity.JOIN_STREAM_ID)
val streamId: Long,
@ColumnInfo(name = STREAM_PROGRESS_TIME, defaultValue = "0")
val progressTime: Long,
@ColumnInfo(name = STREAM_LATEST_DATE)
val latestAccessDate: Date,
@ColumnInfo(name = StreamHistoryEntity.JOIN_STREAM_ID)
val streamId: Long,
@ColumnInfo(name = STREAM_WATCH_COUNT)
val watchCount: Long
@ColumnInfo(name = STREAM_LATEST_DATE)
val latestAccessDate: OffsetDateTime,
@ColumnInfo(name = STREAM_WATCH_COUNT)
val watchCount: Long
) : LocalItem {
fun toStreamInfoItem(): StreamInfoItem {
val item = StreamInfoItem(streamEntity.serviceId, streamEntity.url, streamEntity.title, streamEntity.streamType)
item.duration = streamEntity.duration

View File

@@ -1,15 +1,19 @@
package org.schabi.newpipe.database.stream.dao
import androidx.room.*
import io.reactivex.Flowable
import androidx.room.ColumnInfo
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import io.reactivex.rxjava3.core.Flowable
import org.schabi.newpipe.database.BasicDAO
import org.schabi.newpipe.database.stream.model.StreamEntity
import org.schabi.newpipe.database.stream.model.StreamEntity.Companion.STREAM_ID
import org.schabi.newpipe.extractor.stream.StreamType
import org.schabi.newpipe.extractor.stream.StreamType.AUDIO_LIVE_STREAM
import org.schabi.newpipe.extractor.stream.StreamType.LIVE_STREAM
import java.util.*
import kotlin.collections.ArrayList
import java.time.OffsetDateTime
@Dao
abstract class StreamDAO : BasicDAO<StreamEntity> {
@@ -31,10 +35,12 @@ abstract class StreamDAO : BasicDAO<StreamEntity> {
@Insert(onConflict = OnConflictStrategy.IGNORE)
internal abstract fun silentInsertAllInternal(streams: List<StreamEntity>): List<Long>
@Query("""
@Query(
"""
SELECT uid, stream_type, textual_upload_date, upload_date, is_upload_date_approximation, duration
FROM streams WHERE url = :url AND service_id = :serviceId
""")
"""
)
internal abstract fun getMinimalStreamForCompare(serviceId: Int, url: String): StreamCompareFeed?
@Transaction
@@ -75,12 +81,17 @@ abstract class StreamDAO : BasicDAO<StreamEntity> {
private fun compareAndUpdateStream(newerStream: StreamEntity) {
val existentMinimalStream = getMinimalStreamForCompare(newerStream.serviceId, newerStream.url)
?: throw IllegalStateException("Stream cannot be null just after insertion.")
?: throw IllegalStateException("Stream cannot be null just after insertion.")
newerStream.uid = existentMinimalStream.uid
val isNewerStreamLive = newerStream.streamType == AUDIO_LIVE_STREAM || newerStream.streamType == LIVE_STREAM
if (!isNewerStreamLive) {
if (existentMinimalStream.uploadDate != null && existentMinimalStream.isUploadDateApproximation != true) {
// Use the existent upload date if the newer stream does not have a better precision
// (i.e. is an approximation). This is done to prevent unnecessary changes.
val hasBetterPrecision =
newerStream.uploadDate != null && newerStream.isUploadDateApproximation != true
if (existentMinimalStream.uploadDate != null && !hasBetterPrecision) {
newerStream.uploadDate = existentMinimalStream.uploadDate
newerStream.textualUploadDate = existentMinimalStream.textualUploadDate
newerStream.isUploadDateApproximation = existentMinimalStream.isUploadDateApproximation
@@ -89,11 +100,11 @@ abstract class StreamDAO : BasicDAO<StreamEntity> {
if (existentMinimalStream.duration > 0 && newerStream.duration < 0) {
newerStream.duration = existentMinimalStream.duration
}
}
}
@Query("""
@Query(
"""
DELETE FROM streams WHERE
NOT EXISTS (SELECT 1 FROM stream_history sh
@@ -104,28 +115,30 @@ abstract class StreamDAO : BasicDAO<StreamEntity> {
AND NOT EXISTS (SELECT 1 FROM feed f
WHERE f.stream_id = streams.uid)
""")
"""
)
abstract fun deleteOrphans(): Int
/**
* Minimal entry class used when comparing/updating an existent stream.
*/
internal data class StreamCompareFeed(
@ColumnInfo(name = STREAM_ID)
var uid: Long = 0,
@ColumnInfo(name = STREAM_ID)
var uid: Long = 0,
@ColumnInfo(name = StreamEntity.STREAM_TYPE)
var streamType: StreamType,
@ColumnInfo(name = StreamEntity.STREAM_TYPE)
var streamType: StreamType,
@ColumnInfo(name = StreamEntity.STREAM_TEXTUAL_UPLOAD_DATE)
var textualUploadDate: String? = null,
@ColumnInfo(name = StreamEntity.STREAM_TEXTUAL_UPLOAD_DATE)
var textualUploadDate: String? = null,
@ColumnInfo(name = StreamEntity.STREAM_UPLOAD_DATE)
var uploadDate: Date? = null,
@ColumnInfo(name = StreamEntity.STREAM_UPLOAD_DATE)
var uploadDate: OffsetDateTime? = null,
@ColumnInfo(name = StreamEntity.STREAM_IS_UPLOAD_DATE_APPROXIMATION)
var isUploadDateApproximation: Boolean? = null,
@ColumnInfo(name = StreamEntity.STREAM_IS_UPLOAD_DATE_APPROXIMATION)
var isUploadDateApproximation: Boolean? = null,
@ColumnInfo(name = StreamEntity.STREAM_DURATION)
var duration: Long)
@ColumnInfo(name = StreamEntity.STREAM_DURATION)
var duration: Long
)
}

View File

@@ -11,7 +11,7 @@ import org.schabi.newpipe.database.stream.model.StreamStateEntity;
import java.util.List;
import io.reactivex.Flowable;
import io.reactivex.rxjava3.core.Flowable;
import static org.schabi.newpipe.database.stream.model.StreamStateEntity.JOIN_STREAM_ID;
import static org.schabi.newpipe.database.stream.model.StreamStateEntity.STREAM_STATE_TABLE;
@@ -27,21 +27,21 @@ public abstract class StreamStateDAO implements BasicDAO<StreamStateEntity> {
public abstract int deleteAll();
@Override
public Flowable<List<StreamStateEntity>> listByService(int serviceId) {
public Flowable<List<StreamStateEntity>> listByService(final int serviceId) {
throw new UnsupportedOperationException();
}
@Query("SELECT * FROM " + STREAM_STATE_TABLE + " WHERE " + JOIN_STREAM_ID + " = :streamId")
public abstract Flowable<List<StreamStateEntity>> getState(final long streamId);
public abstract Flowable<List<StreamStateEntity>> getState(long streamId);
@Query("DELETE FROM " + STREAM_STATE_TABLE + " WHERE " + JOIN_STREAM_ID + " = :streamId")
public abstract int deleteState(final long streamId);
public abstract int deleteState(long streamId);
@Insert(onConflict = OnConflictStrategy.IGNORE)
abstract void silentInsertInternal(final StreamStateEntity streamState);
abstract void silentInsertInternal(StreamStateEntity streamState);
@Transaction
public long upsert(StreamStateEntity stream) {
public long upsert(final StreamStateEntity stream) {
silentInsertInternal(stream);
return update(stream);
}

View File

@@ -1,6 +1,10 @@
package org.schabi.newpipe.database.stream.model
import androidx.room.*
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.Index
import androidx.room.PrimaryKey
import org.schabi.newpipe.database.stream.model.StreamEntity.Companion.STREAM_SERVICE_ID
import org.schabi.newpipe.database.stream.model.StreamEntity.Companion.STREAM_TABLE
import org.schabi.newpipe.database.stream.model.StreamEntity.Companion.STREAM_URL
@@ -10,75 +14,75 @@ import org.schabi.newpipe.extractor.stream.StreamInfoItem
import org.schabi.newpipe.extractor.stream.StreamType
import org.schabi.newpipe.player.playqueue.PlayQueueItem
import java.io.Serializable
import java.util.*
import java.time.OffsetDateTime
@Entity(tableName = STREAM_TABLE,
indices = [
Index(value = [STREAM_SERVICE_ID, STREAM_URL], unique = true)
]
@Entity(
tableName = STREAM_TABLE,
indices = [
Index(value = [STREAM_SERVICE_ID, STREAM_URL], unique = true)
]
)
data class StreamEntity(
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = STREAM_ID)
var uid: Long = 0,
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = STREAM_ID)
var uid: Long = 0,
@ColumnInfo(name = STREAM_SERVICE_ID)
var serviceId: Int,
@ColumnInfo(name = STREAM_SERVICE_ID)
var serviceId: Int,
@ColumnInfo(name = STREAM_URL)
var url: String,
@ColumnInfo(name = STREAM_URL)
var url: String,
@ColumnInfo(name = STREAM_TITLE)
var title: String,
@ColumnInfo(name = STREAM_TITLE)
var title: String,
@ColumnInfo(name = STREAM_TYPE)
var streamType: StreamType,
@ColumnInfo(name = STREAM_TYPE)
var streamType: StreamType,
@ColumnInfo(name = STREAM_DURATION)
var duration: Long,
@ColumnInfo(name = STREAM_DURATION)
var duration: Long,
@ColumnInfo(name = STREAM_UPLOADER)
var uploader: String,
@ColumnInfo(name = STREAM_UPLOADER)
var uploader: String,
@ColumnInfo(name = STREAM_THUMBNAIL_URL)
var thumbnailUrl: String? = null,
@ColumnInfo(name = STREAM_THUMBNAIL_URL)
var thumbnailUrl: String? = null,
@ColumnInfo(name = STREAM_VIEWS)
var viewCount: Long? = null,
@ColumnInfo(name = STREAM_VIEWS)
var viewCount: Long? = null,
@ColumnInfo(name = STREAM_TEXTUAL_UPLOAD_DATE)
var textualUploadDate: String? = null,
@ColumnInfo(name = STREAM_TEXTUAL_UPLOAD_DATE)
var textualUploadDate: String? = null,
@ColumnInfo(name = STREAM_UPLOAD_DATE)
var uploadDate: Date? = null,
@ColumnInfo(name = STREAM_UPLOAD_DATE)
var uploadDate: OffsetDateTime? = null,
@ColumnInfo(name = STREAM_IS_UPLOAD_DATE_APPROXIMATION)
var isUploadDateApproximation: Boolean? = null
@ColumnInfo(name = STREAM_IS_UPLOAD_DATE_APPROXIMATION)
var isUploadDateApproximation: Boolean? = null
) : Serializable {
@Ignore
constructor(item: StreamInfoItem) : this(
serviceId = item.serviceId, url = item.url, title = item.name,
streamType = item.streamType, duration = item.duration, uploader = item.uploaderName,
thumbnailUrl = item.thumbnailUrl, viewCount = item.viewCount,
textualUploadDate = item.textualUploadDate, uploadDate = item.uploadDate?.date()?.time,
isUploadDateApproximation = item.uploadDate?.isApproximation
serviceId = item.serviceId, url = item.url, title = item.name,
streamType = item.streamType, duration = item.duration, uploader = item.uploaderName,
thumbnailUrl = item.thumbnailUrl, viewCount = item.viewCount,
textualUploadDate = item.textualUploadDate, uploadDate = item.uploadDate?.offsetDateTime(),
isUploadDateApproximation = item.uploadDate?.isApproximation
)
@Ignore
constructor(info: StreamInfo) : this(
serviceId = info.serviceId, url = info.url, title = info.name,
streamType = info.streamType, duration = info.duration, uploader = info.uploaderName,
thumbnailUrl = info.thumbnailUrl, viewCount = info.viewCount,
textualUploadDate = info.textualUploadDate, uploadDate = info.uploadDate?.date()?.time,
isUploadDateApproximation = info.uploadDate?.isApproximation
serviceId = info.serviceId, url = info.url, title = info.name,
streamType = info.streamType, duration = info.duration, uploader = info.uploaderName,
thumbnailUrl = info.thumbnailUrl, viewCount = info.viewCount,
textualUploadDate = info.textualUploadDate, uploadDate = info.uploadDate?.offsetDateTime(),
isUploadDateApproximation = info.uploadDate?.isApproximation
)
@Ignore
constructor(item: PlayQueueItem) : this(
serviceId = item.serviceId, url = item.url, title = item.title,
streamType = item.streamType, duration = item.duration, uploader = item.uploader,
thumbnailUrl = item.thumbnailUrl
serviceId = item.serviceId, url = item.url, title = item.title,
streamType = item.streamType, duration = item.duration, uploader = item.uploader,
thumbnailUrl = item.thumbnailUrl
)
fun toStreamInfoItem(): StreamInfoItem {
@@ -90,7 +94,7 @@ data class StreamEntity(
if (viewCount != null) item.viewCount = viewCount as Long
item.textualUploadDate = textualUploadDate
item.uploadDate = uploadDate?.let {
DateWrapper(Calendar.getInstance().apply { time = it }, isUploadDateApproximation ?: false)
DateWrapper(it, isUploadDateApproximation ?: false)
}
return item

View File

@@ -1,10 +1,9 @@
package org.schabi.newpipe.database.stream.model;
import androidx.annotation.Nullable;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.annotation.Nullable;
import java.util.concurrent.TimeUnit;
@@ -21,14 +20,20 @@ import static org.schabi.newpipe.database.stream.model.StreamStateEntity.STREAM_
onDelete = CASCADE, onUpdate = CASCADE)
})
public class StreamStateEntity {
final public static String STREAM_STATE_TABLE = "stream_state";
final public static String JOIN_STREAM_ID = "stream_id";
final public static String STREAM_PROGRESS_TIME = "progress_time";
public static final String STREAM_STATE_TABLE = "stream_state";
public static final String JOIN_STREAM_ID = "stream_id";
// This additional field is required for the SQL query because 'stream_id' is used
// for some other joins already
public static final String JOIN_STREAM_ID_ALIAS = "stream_id_alias";
public static final String STREAM_PROGRESS_TIME = "progress_time";
/** Playback state will not be saved, if playback time less than this threshold */
/**
* Playback state will not be saved, if playback time is less than this threshold.
*/
private static final int PLAYBACK_SAVE_THRESHOLD_START_SECONDS = 5;
/** Playback state will not be saved, if time left less than this threshold */
/**
* Playback state will not be saved, if time left is less than this threshold.
*/
private static final int PLAYBACK_SAVE_THRESHOLD_END_SECONDS = 10;
@ColumnInfo(name = JOIN_STREAM_ID)
@@ -37,7 +42,7 @@ public class StreamStateEntity {
@ColumnInfo(name = STREAM_PROGRESS_TIME)
private long progressTime;
public StreamStateEntity(long streamUid, long progressTime) {
public StreamStateEntity(final long streamUid, final long progressTime) {
this.streamUid = streamUid;
this.progressTime = progressTime;
}
@@ -46,7 +51,7 @@ public class StreamStateEntity {
return streamUid;
}
public void setStreamUid(long streamUid) {
public void setStreamUid(final long streamUid) {
this.streamUid = streamUid;
}
@@ -54,21 +59,23 @@ public class StreamStateEntity {
return progressTime;
}
public void setProgressTime(long progressTime) {
public void setProgressTime(final long progressTime) {
this.progressTime = progressTime;
}
public boolean isValid(int durationInSeconds) {
public boolean isValid(final int durationInSeconds) {
final int seconds = (int) TimeUnit.MILLISECONDS.toSeconds(progressTime);
return seconds > PLAYBACK_SAVE_THRESHOLD_START_SECONDS
&& seconds < durationInSeconds - PLAYBACK_SAVE_THRESHOLD_END_SECONDS;
}
@Override
public boolean equals(@Nullable Object obj) {
public boolean equals(@Nullable final Object obj) {
if (obj instanceof StreamStateEntity) {
return ((StreamStateEntity) obj).streamUid == streamUid
&& ((StreamStateEntity) obj).progressTime == progressTime;
} else return false;
} else {
return false;
}
}
}

View File

@@ -1,8 +1,12 @@
package org.schabi.newpipe.database.subscription
import androidx.room.*
import io.reactivex.Flowable
import io.reactivex.Maybe
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import io.reactivex.rxjava3.core.Flowable
import io.reactivex.rxjava3.core.Maybe
import org.schabi.newpipe.database.BasicDAO
@Dao
@@ -16,6 +20,51 @@ abstract class SubscriptionDAO : BasicDAO<SubscriptionEntity> {
@Query("SELECT * FROM subscriptions ORDER BY name COLLATE NOCASE ASC")
abstract override fun getAll(): Flowable<List<SubscriptionEntity>>
@Query(
"""
SELECT * FROM subscriptions
WHERE name LIKE '%' || :filter || '%'
ORDER BY name COLLATE NOCASE ASC
"""
)
abstract fun getSubscriptionsFiltered(filter: String): Flowable<List<SubscriptionEntity>>
@Query(
"""
SELECT * FROM subscriptions s
LEFT JOIN feed_group_subscription_join fgs
ON s.uid = fgs.subscription_id
WHERE (fgs.subscription_id IS NULL OR fgs.group_id = :currentGroupId)
ORDER BY name COLLATE NOCASE ASC
"""
)
abstract fun getSubscriptionsOnlyUngrouped(
currentGroupId: Long
): Flowable<List<SubscriptionEntity>>
@Query(
"""
SELECT * FROM subscriptions s
LEFT JOIN feed_group_subscription_join fgs
ON s.uid = fgs.subscription_id
WHERE (fgs.subscription_id IS NULL OR fgs.group_id = :currentGroupId)
AND s.name LIKE '%' || :filter || '%'
ORDER BY name COLLATE NOCASE ASC
"""
)
abstract fun getSubscriptionsOnlyUngroupedFiltered(
currentGroupId: Long,
filter: String
): Flowable<List<SubscriptionEntity>>
@Query("SELECT * FROM subscriptions WHERE url LIKE :url AND service_id = :serviceId")
abstract fun getSubscriptionFlowable(serviceId: Int, url: String): Flowable<List<SubscriptionEntity>>
@@ -48,7 +97,7 @@ abstract class SubscriptionDAO : BasicDAO<SubscriptionEntity> {
entity.uid = uidFromInsert
} else {
val subscriptionIdFromDb = getSubscriptionIdInternal(entity.serviceId, entity.url)
?: throw IllegalStateException("Subscription cannot be null just after insertion.")
?: throw IllegalStateException("Subscription cannot be null just after insertion.")
entity.uid = subscriptionIdFromDb
update(entity)

View File

@@ -1,11 +1,11 @@
package org.schabi.newpipe.database.subscription;
import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import androidx.annotation.NonNull;
import org.schabi.newpipe.extractor.channel.ChannelInfo;
import org.schabi.newpipe.extractor.channel.ChannelInfoItem;
@@ -18,15 +18,14 @@ import static org.schabi.newpipe.database.subscription.SubscriptionEntity.SUBSCR
@Entity(tableName = SUBSCRIPTION_TABLE,
indices = {@Index(value = {SUBSCRIPTION_SERVICE_ID, SUBSCRIPTION_URL}, unique = true)})
public class SubscriptionEntity {
public static final String SUBSCRIPTION_UID = "uid";
public static final String SUBSCRIPTION_TABLE = "subscriptions";
public static final String SUBSCRIPTION_SERVICE_ID = "service_id";
public static final String SUBSCRIPTION_URL = "url";
public static final String SUBSCRIPTION_NAME = "name";
public static final String SUBSCRIPTION_AVATAR_URL = "avatar_url";
public static final String SUBSCRIPTION_SUBSCRIBER_COUNT = "subscriber_count";
public static final String SUBSCRIPTION_DESCRIPTION = "description";
public static final String SUBSCRIPTION_UID = "uid";
public static final String SUBSCRIPTION_TABLE = "subscriptions";
public static final String SUBSCRIPTION_SERVICE_ID = "service_id";
public static final String SUBSCRIPTION_URL = "url";
public static final String SUBSCRIPTION_NAME = "name";
public static final String SUBSCRIPTION_AVATAR_URL = "avatar_url";
public static final String SUBSCRIPTION_SUBSCRIBER_COUNT = "subscriber_count";
public static final String SUBSCRIPTION_DESCRIPTION = "description";
@PrimaryKey(autoGenerate = true)
private long uid = 0;
@@ -49,11 +48,21 @@ public class SubscriptionEntity {
@ColumnInfo(name = SUBSCRIPTION_DESCRIPTION)
private String description;
@Ignore
public static SubscriptionEntity from(@NonNull final ChannelInfo info) {
final SubscriptionEntity result = new SubscriptionEntity();
result.setServiceId(info.getServiceId());
result.setUrl(info.getUrl());
result.setData(info.getName(), info.getAvatarUrl(), info.getDescription(),
info.getSubscriberCount());
return result;
}
public long getUid() {
return uid;
}
public void setUid(long uid) {
public void setUid(final long uid) {
this.uid = uid;
}
@@ -61,7 +70,7 @@ public class SubscriptionEntity {
return serviceId;
}
public void setServiceId(int serviceId) {
public void setServiceId(final int serviceId) {
this.serviceId = serviceId;
}
@@ -69,7 +78,7 @@ public class SubscriptionEntity {
return url;
}
public void setUrl(String url) {
public void setUrl(final String url) {
this.url = url;
}
@@ -77,7 +86,7 @@ public class SubscriptionEntity {
return name;
}
public void setName(String name) {
public void setName(final String name) {
this.name = name;
}
@@ -85,7 +94,7 @@ public class SubscriptionEntity {
return avatarUrl;
}
public void setAvatarUrl(String avatarUrl) {
public void setAvatarUrl(final String avatarUrl) {
this.avatarUrl = avatarUrl;
}
@@ -93,7 +102,7 @@ public class SubscriptionEntity {
return subscriberCount;
}
public void setSubscriberCount(Long subscriberCount) {
public void setSubscriberCount(final Long subscriberCount) {
this.subscriberCount = subscriberCount;
}
@@ -101,36 +110,75 @@ public class SubscriptionEntity {
return description;
}
public void setDescription(String description) {
public void setDescription(final String description) {
this.description = description;
}
@Ignore
public void setData(final String name,
final String avatarUrl,
final String description,
final Long subscriberCount) {
this.setName(name);
this.setAvatarUrl(avatarUrl);
this.setDescription(description);
this.setSubscriberCount(subscriberCount);
public void setData(final String n, final String au, final String d, final Long sc) {
this.setName(n);
this.setAvatarUrl(au);
this.setDescription(d);
this.setSubscriberCount(sc);
}
@Ignore
public ChannelInfoItem toChannelInfoItem() {
ChannelInfoItem item = new ChannelInfoItem(getServiceId(), getUrl(), getName());
final ChannelInfoItem item = new ChannelInfoItem(getServiceId(), getUrl(), getName());
item.setThumbnailUrl(getAvatarUrl());
item.setSubscriberCount(getSubscriberCount());
item.setDescription(getDescription());
return item;
}
@Ignore
public static SubscriptionEntity from(@NonNull ChannelInfo info) {
SubscriptionEntity result = new SubscriptionEntity();
result.setServiceId(info.getServiceId());
result.setUrl(info.getUrl());
result.setData(info.getName(), info.getAvatarUrl(), info.getDescription(), info.getSubscriberCount());
// TODO: Remove these generated methods by migrating this class to a data class from Kotlin.
@Override
@SuppressWarnings("EqualsReplaceableByObjectsCall")
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final SubscriptionEntity that = (SubscriptionEntity) o;
if (uid != that.uid) {
return false;
}
if (serviceId != that.serviceId) {
return false;
}
if (!url.equals(that.url)) {
return false;
}
if (name != null ? !name.equals(that.name) : that.name != null) {
return false;
}
if (avatarUrl != null ? !avatarUrl.equals(that.avatarUrl) : that.avatarUrl != null) {
return false;
}
if (subscriberCount != null
? !subscriberCount.equals(that.subscriberCount)
: that.subscriberCount != null) {
return false;
}
return description != null
? description.equals(that.description)
: that.description == null;
}
@Override
public int hashCode() {
int result = (int) (uid ^ (uid >>> 32));
result = 31 * result + serviceId;
result = 31 * result + url.hashCode();
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (avatarUrl != null ? avatarUrl.hashCode() : 0);
result = 31 * result + (subscriberCount != null ? subscriberCount.hashCode() : 0);
result = 31 * result + (description != null ? description.hashCode() : 0);
return result;
}
}

View File

@@ -1,19 +1,21 @@
package org.schabi.newpipe.download;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.ViewTreeObserver;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.FragmentTransaction;
import org.schabi.newpipe.R;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.DeviceUtils;
import org.schabi.newpipe.util.ThemeHelper;
import org.schabi.newpipe.views.FocusOverlayView;
import us.shandian.giga.service.DownloadManagerService;
import us.shandian.giga.ui.fragment.MissionsFragment;
@@ -25,9 +27,9 @@ public class DownloadActivity extends AppCompatActivity {
private static final String MISSIONS_FRAGMENT_TAG = "fragment_tag";
@Override
protected void onCreate(Bundle savedInstanceState) {
protected void onCreate(final Bundle savedInstanceState) {
// Service
Intent i = new Intent();
final Intent i = new Intent();
i.setClass(this, DownloadManagerService.class);
startService(i);
@@ -36,27 +38,32 @@ public class DownloadActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_downloader);
Toolbar toolbar = findViewById(R.id.toolbar);
final Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(R.string.downloads_title);
actionBar.setDisplayShowTitleEnabled(true);
}
getWindow().getDecorView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
getWindow().getDecorView().getViewTreeObserver()
.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
updateFragments();
getWindow().getDecorView().getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
});
if (DeviceUtils.isTv(this)) {
FocusOverlayView.setupFocusObserver(this);
}
}
private void updateFragments() {
MissionsFragment fragment = new MissionsFragment();
final MissionsFragment fragment = new MissionsFragment();
getSupportFragmentManager().beginTransaction()
.replace(R.id.frame, fragment, MISSIONS_FRAGMENT_TAG)
@@ -65,9 +72,9 @@ public class DownloadActivity extends AppCompatActivity {
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
public boolean onCreateOptionsMenu(final Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
final MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.download_menu, menu);
@@ -75,7 +82,7 @@ public class DownloadActivity extends AppCompatActivity {
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();

View File

@@ -10,7 +10,6 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.util.Log;
import android.util.SparseArray;
import android.view.LayoutInflater;
@@ -34,6 +33,7 @@ import androidx.appcompat.view.menu.ActionMenuItemView;
import androidx.appcompat.widget.Toolbar;
import androidx.documentfile.provider.DocumentFile;
import androidx.fragment.app.DialogFragment;
import androidx.preference.PreferenceManager;
import com.nononsenseapps.filepicker.Utils;
@@ -49,6 +49,7 @@ import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.extractor.stream.SubtitlesStream;
import org.schabi.newpipe.extractor.stream.VideoStream;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.ErrorInfo;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.settings.NewPipeSettings;
import org.schabi.newpipe.util.FilePickerActivityHelper;
@@ -69,7 +70,7 @@ import java.util.Locale;
import icepick.Icepick;
import icepick.State;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
import us.shandian.giga.get.MissionRecoveryInfo;
import us.shandian.giga.io.StoredDirectoryHelper;
import us.shandian.giga.io.StoredFileHelper;
@@ -81,25 +82,33 @@ import us.shandian.giga.service.MissionState;
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheckedChangeListener, AdapterView.OnItemSelectedListener {
public class DownloadDialog extends DialogFragment
implements RadioGroup.OnCheckedChangeListener, AdapterView.OnItemSelectedListener {
private static final String TAG = "DialogFragment";
private static final boolean DEBUG = MainActivity.DEBUG;
private static final int REQUEST_DOWNLOAD_SAVE_AS = 0x1230;
@State
protected StreamInfo currentInfo;
StreamInfo currentInfo;
@State
protected StreamSizeWrapper<AudioStream> wrappedAudioStreams = StreamSizeWrapper.empty();
StreamSizeWrapper<AudioStream> wrappedAudioStreams = StreamSizeWrapper.empty();
@State
protected StreamSizeWrapper<VideoStream> wrappedVideoStreams = StreamSizeWrapper.empty();
StreamSizeWrapper<VideoStream> wrappedVideoStreams = StreamSizeWrapper.empty();
@State
protected StreamSizeWrapper<SubtitlesStream> wrappedSubtitleStreams = StreamSizeWrapper.empty();
StreamSizeWrapper<SubtitlesStream> wrappedSubtitleStreams = StreamSizeWrapper.empty();
@State
protected int selectedVideoIndex = 0;
int selectedVideoIndex = 0;
@State
protected int selectedAudioIndex = 0;
int selectedAudioIndex = 0;
@State
protected int selectedSubtitleIndex = 0;
int selectedSubtitleIndex = 0;
private StoredDirectoryHelper mainStorageAudio = null;
private StoredDirectoryHelper mainStorageVideo = null;
private DownloadManager downloadManager = null;
private ActionMenuItemView okButton = null;
private Context context;
private boolean askForSavePath;
private StreamItemAdapter<AudioStream, Stream> audioStreamsAdapter;
private StreamItemAdapter<VideoStream, AudioStream> videoStreamsAdapter;
@@ -115,15 +124,16 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
private SharedPreferences prefs;
public static DownloadDialog newInstance(StreamInfo info) {
DownloadDialog dialog = new DownloadDialog();
public static DownloadDialog newInstance(final StreamInfo info) {
final DownloadDialog dialog = new DownloadDialog();
dialog.setInfo(info);
return dialog;
}
public static DownloadDialog newInstance(Context context, StreamInfo info) {
final ArrayList<VideoStream> streamsList = new ArrayList<>(ListHelper.getSortedStreamVideosList(context,
info.getVideoStreams(), info.getVideoOnlyStreams(), false));
public static DownloadDialog newInstance(final Context context, final StreamInfo info) {
final ArrayList<VideoStream> streamsList = new ArrayList<>(ListHelper
.getSortedStreamVideosList(context, info.getVideoStreams(),
info.getVideoOnlyStreams(), false));
final int selectedStreamIndex = ListHelper.getDefaultResolutionIndex(context, streamsList);
final DownloadDialog instance = newInstance(info);
@@ -135,57 +145,61 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
return instance;
}
private void setInfo(StreamInfo info) {
private void setInfo(final StreamInfo info) {
this.currentInfo = info;
}
public void setAudioStreams(List<AudioStream> audioStreams) {
public void setAudioStreams(final List<AudioStream> audioStreams) {
setAudioStreams(new StreamSizeWrapper<>(audioStreams, getContext()));
}
public void setAudioStreams(StreamSizeWrapper<AudioStream> wrappedAudioStreams) {
this.wrappedAudioStreams = wrappedAudioStreams;
public void setAudioStreams(final StreamSizeWrapper<AudioStream> was) {
this.wrappedAudioStreams = was;
}
public void setVideoStreams(List<VideoStream> videoStreams) {
public void setVideoStreams(final List<VideoStream> videoStreams) {
setVideoStreams(new StreamSizeWrapper<>(videoStreams, getContext()));
}
public void setVideoStreams(StreamSizeWrapper<VideoStream> wrappedVideoStreams) {
this.wrappedVideoStreams = wrappedVideoStreams;
}
public void setSubtitleStreams(List<SubtitlesStream> subtitleStreams) {
setSubtitleStreams(new StreamSizeWrapper<>(subtitleStreams, getContext()));
}
public void setSubtitleStreams(StreamSizeWrapper<SubtitlesStream> wrappedSubtitleStreams) {
this.wrappedSubtitleStreams = wrappedSubtitleStreams;
}
public void setSelectedVideoStream(int selectedVideoIndex) {
this.selectedVideoIndex = selectedVideoIndex;
}
public void setSelectedAudioStream(int selectedAudioIndex) {
this.selectedAudioIndex = selectedAudioIndex;
}
public void setSelectedSubtitleStream(int selectedSubtitleIndex) {
this.selectedSubtitleIndex = selectedSubtitleIndex;
}
/*//////////////////////////////////////////////////////////////////////////
// LifeCycle
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (DEBUG)
Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]");
public void setVideoStreams(final StreamSizeWrapper<VideoStream> wvs) {
this.wrappedVideoStreams = wvs;
}
if (!PermissionHelper.checkStoragePermissions(getActivity(), PermissionHelper.DOWNLOAD_DIALOG_REQUEST_CODE)) {
public void setSubtitleStreams(final List<SubtitlesStream> subtitleStreams) {
setSubtitleStreams(new StreamSizeWrapper<>(subtitleStreams, getContext()));
}
public void setSubtitleStreams(
final StreamSizeWrapper<SubtitlesStream> wss) {
this.wrappedSubtitleStreams = wss;
}
public void setSelectedVideoStream(final int svi) {
this.selectedVideoIndex = svi;
}
public void setSelectedAudioStream(final int sai) {
this.selectedAudioIndex = sai;
}
public void setSelectedSubtitleStream(final int ssi) {
this.selectedSubtitleIndex = ssi;
}
@Override
public void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (DEBUG) {
Log.d(TAG, "onCreate() called with: "
+ "savedInstanceState = [" + savedInstanceState + "]");
}
if (!PermissionHelper.checkStoragePermissions(getActivity(),
PermissionHelper.DOWNLOAD_DIALOG_REQUEST_CODE)) {
getDialog().dismiss();
return;
}
@@ -195,31 +209,38 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
setStyle(STYLE_NO_TITLE, ThemeHelper.getDialogTheme(context));
Icepick.restoreInstanceState(this, savedInstanceState);
SparseArray<SecondaryStreamHelper<AudioStream>> secondaryStreams = new SparseArray<>(4);
List<VideoStream> videoStreams = wrappedVideoStreams.getStreamsList();
final SparseArray<SecondaryStreamHelper<AudioStream>> secondaryStreams
= new SparseArray<>(4);
final List<VideoStream> videoStreams = wrappedVideoStreams.getStreamsList();
for (int i = 0; i < videoStreams.size(); i++) {
if (!videoStreams.get(i).isVideoOnly()) continue;
AudioStream audioStream = SecondaryStreamHelper.getAudioStreamFor(wrappedAudioStreams.getStreamsList(), videoStreams.get(i));
if (!videoStreams.get(i).isVideoOnly()) {
continue;
}
final AudioStream audioStream = SecondaryStreamHelper
.getAudioStreamFor(wrappedAudioStreams.getStreamsList(), videoStreams.get(i));
if (audioStream != null) {
secondaryStreams.append(i, new SecondaryStreamHelper<>(wrappedAudioStreams, audioStream));
secondaryStreams
.append(i, new SecondaryStreamHelper<>(wrappedAudioStreams, audioStream));
} else if (DEBUG) {
Log.w(TAG, "No audio stream candidates for video format " + videoStreams.get(i).getFormat().name());
Log.w(TAG, "No audio stream candidates for video format "
+ videoStreams.get(i).getFormat().name());
}
}
this.videoStreamsAdapter = new StreamItemAdapter<>(context, wrappedVideoStreams, secondaryStreams);
this.videoStreamsAdapter = new StreamItemAdapter<>(context, wrappedVideoStreams,
secondaryStreams);
this.audioStreamsAdapter = new StreamItemAdapter<>(context, wrappedAudioStreams);
this.subtitleStreamsAdapter = new StreamItemAdapter<>(context, wrappedSubtitleStreams);
Intent intent = new Intent(context, DownloadManagerService.class);
final Intent intent = new Intent(context, DownloadManagerService.class);
context.startService(intent);
context.bindService(intent, new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName cname, IBinder service) {
DownloadManagerBinder mgr = (DownloadManagerBinder) service;
public void onServiceConnected(final ComponentName cname, final IBinder service) {
final DownloadManagerBinder mgr = (DownloadManagerBinder) service;
mainStorageAudio = mgr.getMainStorageAudio();
mainStorageVideo = mgr.getMainStorageVideo();
@@ -232,25 +253,34 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
}
@Override
public void onServiceDisconnected(ComponentName name) {
public void onServiceDisconnected(final ComponentName name) {
// nothing to do
}
}, Context.BIND_AUTO_CREATE);
}
/*//////////////////////////////////////////////////////////////////////////
// Inits
//////////////////////////////////////////////////////////////////////////*/
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (DEBUG)
Log.d(TAG, "onCreateView() called with: inflater = [" + inflater + "], container = [" + container + "], savedInstanceState = [" + savedInstanceState + "]");
public View onCreateView(@NonNull final LayoutInflater inflater, final ViewGroup container,
final Bundle savedInstanceState) {
if (DEBUG) {
Log.d(TAG, "onCreateView() called with: "
+ "inflater = [" + inflater + "], container = [" + container + "], "
+ "savedInstanceState = [" + savedInstanceState + "]");
}
return inflater.inflate(R.layout.download_dialog, container);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
public void onViewCreated(@NonNull final View view, @Nullable final Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
nameEditText = view.findViewById(R.id.file_name);
nameEditText.setText(FilenameUtils.createFilename(getContext(), currentInfo.getName()));
selectedAudioIndex = ListHelper.getDefaultAudioFormat(getContext(), currentInfo.getAudioStreams());
selectedAudioIndex = ListHelper
.getDefaultAudioFormat(getContext(), currentInfo.getAudioStreams());
selectedSubtitleIndex = getSubtitleIndexBy(subtitleStreamsAdapter.getAll());
@@ -266,27 +296,26 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
initToolbar(view.findViewById(R.id.toolbar));
setupDownloadOptions();
prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
prefs = PreferenceManager.getDefaultSharedPreferences(requireContext());
int threads = prefs.getInt(getString(R.string.default_download_threads), 3);
final int threads = prefs.getInt(getString(R.string.default_download_threads), 3);
threadsCountTextView.setText(String.valueOf(threads));
threadsSeekBar.setProgress(threads - 1);
threadsSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekbar, int progress, boolean fromUser) {
progress++;
prefs.edit().putInt(getString(R.string.default_download_threads), progress).apply();
threadsCountTextView.setText(String.valueOf(progress));
public void onProgressChanged(final SeekBar seekbar, final int progress,
final boolean fromUser) {
final int newProgress = progress + 1;
prefs.edit().putInt(getString(R.string.default_download_threads), newProgress)
.apply();
threadsCountTextView.setText(String.valueOf(newProgress));
}
@Override
public void onStartTrackingTouch(SeekBar p1) {
}
public void onStartTrackingTouch(final SeekBar p1) { }
@Override
public void onStopTrackingTouch(SeekBar p1) {
}
public void onStopTrackingTouch(final SeekBar p1) { }
});
fetchStreamsSize();
@@ -295,17 +324,20 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
private void fetchStreamsSize() {
disposables.clear();
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedVideoStreams).subscribe(result -> {
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedVideoStreams)
.subscribe(result -> {
if (radioStreamsGroup.getCheckedRadioButtonId() == R.id.video_button) {
setupVideoSpinner();
}
}));
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedAudioStreams).subscribe(result -> {
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedAudioStreams)
.subscribe(result -> {
if (radioStreamsGroup.getCheckedRadioButtonId() == R.id.audio_button) {
setupAudioSpinner();
}
}));
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedSubtitleStreams).subscribe(result -> {
disposables.add(StreamSizeWrapper.fetchSizeForWrapper(wrappedSubtitleStreams)
.subscribe(result -> {
if (radioStreamsGroup.getCheckedRadioButtonId() == R.id.subtitle_button) {
setupSubtitleSpinner();
}
@@ -318,14 +350,22 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
disposables.clear();
}
/*//////////////////////////////////////////////////////////////////////////
// Radio group Video&Audio options - Listener
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
public void onSaveInstanceState(@NonNull final Bundle outState) {
super.onSaveInstanceState(outState);
Icepick.saveInstanceState(this, outState);
}
/*//////////////////////////////////////////////////////////////////////////
// Streams Spinner Listener
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_DOWNLOAD_SAVE_AS && resultCode == Activity.RESULT_OK) {
@@ -335,39 +375,38 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
}
if (FilePickerActivityHelper.isOwnFileUri(context, data.getData())) {
File file = Utils.getFileForUri(data.getData());
checkSelectedDownload(null, Uri.fromFile(file), file.getName(), StoredFileHelper.DEFAULT_MIME);
final File file = Utils.getFileForUri(data.getData());
checkSelectedDownload(null, Uri.fromFile(file), file.getName(),
StoredFileHelper.DEFAULT_MIME);
return;
}
DocumentFile docFile = DocumentFile.fromSingleUri(context, data.getData());
final DocumentFile docFile = DocumentFile.fromSingleUri(context, data.getData());
if (docFile == null) {
showFailedDialog(R.string.general_error);
return;
}
// check if the selected file was previously used
checkSelectedDownload(null, data.getData(), docFile.getName(), docFile.getType());
checkSelectedDownload(null, data.getData(), docFile.getName(),
docFile.getType());
}
}
/*//////////////////////////////////////////////////////////////////////////
// Inits
//////////////////////////////////////////////////////////////////////////*/
private void initToolbar(Toolbar toolbar) {
if (DEBUG) Log.d(TAG, "initToolbar() called with: toolbar = [" + toolbar + "]");
boolean isLight = ThemeHelper.isLightThemeSelected(getActivity());
private void initToolbar(final Toolbar toolbar) {
if (DEBUG) {
Log.d(TAG, "initToolbar() called with: toolbar = [" + toolbar + "]");
}
toolbar.setTitle(R.string.download_dialog_title);
toolbar.setNavigationIcon(isLight ? R.drawable.ic_arrow_back_black_24dp : R.drawable.ic_arrow_back_white_24dp);
toolbar.setNavigationIcon(
ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_arrow_back));
toolbar.inflateMenu(R.menu.dialog_url);
toolbar.setNavigationOnClickListener(v -> getDialog().dismiss());
toolbar.setNavigationOnClickListener(v -> requireDialog().dismiss());
toolbar.setNavigationContentDescription(R.string.cancel);
okButton = toolbar.findViewById(R.id.okay);
okButton.setEnabled(false);// disable until the download service connection is done
okButton.setEnabled(false); // disable until the download service connection is done
toolbar.setOnMenuItemClickListener(item -> {
if (item.getItemId() == R.id.okay) {
@@ -381,8 +420,14 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
});
}
/*//////////////////////////////////////////////////////////////////////////
// Utils
//////////////////////////////////////////////////////////////////////////*/
private void setupAudioSpinner() {
if (getContext() == null) return;
if (getContext() == null) {
return;
}
streamsSpinner.setAdapter(audioStreamsAdapter);
streamsSpinner.setSelection(selectedAudioIndex);
@@ -390,7 +435,9 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
}
private void setupVideoSpinner() {
if (getContext() == null) return;
if (getContext() == null) {
return;
}
streamsSpinner.setAdapter(videoStreamsAdapter);
streamsSpinner.setSelection(selectedVideoIndex);
@@ -398,21 +445,21 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
}
private void setupSubtitleSpinner() {
if (getContext() == null) return;
if (getContext() == null) {
return;
}
streamsSpinner.setAdapter(subtitleStreamsAdapter);
streamsSpinner.setSelection(selectedSubtitleIndex);
setRadioButtonsState(true);
}
/*//////////////////////////////////////////////////////////////////////////
// Radio group Video&Audio options - Listener
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
if (DEBUG)
Log.d(TAG, "onCheckedChanged() called with: group = [" + group + "], checkedId = [" + checkedId + "]");
public void onCheckedChanged(final RadioGroup group, @IdRes final int checkedId) {
if (DEBUG) {
Log.d(TAG, "onCheckedChanged() called with: "
+ "group = [" + group + "], checkedId = [" + checkedId + "]");
}
boolean flag = true;
switch (checkedId) {
@@ -431,14 +478,14 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
threadsSeekBar.setEnabled(flag);
}
/*//////////////////////////////////////////////////////////////////////////
// Streams Spinner Listener
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (DEBUG)
Log.d(TAG, "onItemSelected() called with: parent = [" + parent + "], view = [" + view + "], position = [" + position + "], id = [" + id + "]");
public void onItemSelected(final AdapterView<?> parent, final View view,
final int position, final long id) {
if (DEBUG) {
Log.d(TAG, "onItemSelected() called with: "
+ "parent = [" + parent + "], view = [" + view + "], "
+ "position = [" + position + "], id = [" + id + "]");
}
switch (radioStreamsGroup.getCheckedRadioButtonId()) {
case R.id.audio_button:
selectedAudioIndex = position;
@@ -453,13 +500,9 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
public void onNothingSelected(final AdapterView<?> parent) {
}
/*//////////////////////////////////////////////////////////////////////////
// Utils
//////////////////////////////////////////////////////////////////////////*/
protected void setupDownloadOptions() {
setRadioButtonsState(false);
@@ -474,7 +517,23 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
videoButton.setVisibility(isVideoStreamsAvailable ? View.VISIBLE : View.GONE);
subtitleButton.setVisibility(isSubtitleStreamsAvailable ? View.VISIBLE : View.GONE);
if (isVideoStreamsAvailable) {
prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
final String defaultMedia = prefs.getString(getString(R.string.last_used_download_type),
getString(R.string.last_download_type_video_key));
if (isVideoStreamsAvailable
&& (defaultMedia.equals(getString(R.string.last_download_type_video_key)))) {
videoButton.setChecked(true);
setupVideoSpinner();
} else if (isAudioStreamsAvailable
&& (defaultMedia.equals(getString(R.string.last_download_type_audio_key)))) {
audioButton.setChecked(true);
setupAudioSpinner();
} else if (isSubtitleStreamsAvailable
&& (defaultMedia.equals(getString(R.string.last_download_type_subtitle_key)))) {
subtitleButton.setChecked(true);
setupSubtitleSpinner();
} else if (isVideoStreamsAvailable) {
videoButton.setChecked(true);
setupVideoSpinner();
} else if (isAudioStreamsAvailable) {
@@ -484,30 +543,36 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
subtitleButton.setChecked(true);
setupSubtitleSpinner();
} else {
Toast.makeText(getContext(), R.string.no_streams_available_download, Toast.LENGTH_SHORT).show();
Toast.makeText(getContext(), R.string.no_streams_available_download,
Toast.LENGTH_SHORT).show();
getDialog().dismiss();
}
}
private void setRadioButtonsState(boolean enabled) {
private void setRadioButtonsState(final boolean enabled) {
radioStreamsGroup.findViewById(R.id.audio_button).setEnabled(enabled);
radioStreamsGroup.findViewById(R.id.video_button).setEnabled(enabled);
radioStreamsGroup.findViewById(R.id.subtitle_button).setEnabled(enabled);
}
private int getSubtitleIndexBy(List<SubtitlesStream> streams) {
private int getSubtitleIndexBy(final List<SubtitlesStream> streams) {
final Localization preferredLocalization = NewPipe.getPreferredLocalization();
int candidate = 0;
for (int i = 0; i < streams.size(); i++) {
final Locale streamLocale = streams.get(i).getLocale();
final boolean languageEquals = streamLocale.getLanguage() != null && preferredLocalization.getLanguageCode() != null &&
streamLocale.getLanguage().equals(new Locale(preferredLocalization.getLanguageCode()).getLanguage());
final boolean countryEquals = streamLocale.getCountry() != null && streamLocale.getCountry().equals(preferredLocalization.getCountryCode());
final boolean languageEquals = streamLocale.getLanguage() != null
&& preferredLocalization.getLanguageCode() != null
&& streamLocale.getLanguage()
.equals(new Locale(preferredLocalization.getLanguageCode()).getLanguage());
final boolean countryEquals = streamLocale.getCountry() != null
&& streamLocale.getCountry().equals(preferredLocalization.getCountryCode());
if (languageEquals) {
if (countryEquals) return i;
if (countryEquals) {
return i;
}
candidate = i;
}
@@ -516,20 +581,13 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
return candidate;
}
StoredDirectoryHelper mainStorageAudio = null;
StoredDirectoryHelper mainStorageVideo = null;
DownloadManager downloadManager = null;
ActionMenuItemView okButton = null;
Context context;
boolean askForSavePath;
private String getNameEditText() {
String str = nameEditText.getText().toString().trim();
final String str = nameEditText.getText().toString().trim();
return FilenameUtils.createFilename(context, str.isEmpty() ? currentInfo.getName() : str);
}
private void showFailedDialog(@StringRes int msg) {
private void showFailedDialog(@StringRes final int msg) {
assureCorrectAppLanguage(getContext());
new AlertDialog.Builder(context)
.setTitle(R.string.general_error)
@@ -539,20 +597,22 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
.show();
}
private void showErrorActivity(Exception e) {
private void showErrorActivity(final Exception e) {
ErrorActivity.reportError(
context,
Collections.singletonList(e),
null,
null,
ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "-", "-", R.string.general_error)
ErrorInfo
.make(UserAction.SOMETHING_ELSE, "-", "-", R.string.general_error)
);
}
private void prepareSelectedDownload() {
StoredDirectoryHelper mainStorage;
MediaFormat format;
String mime;
final StoredDirectoryHelper mainStorage;
final MediaFormat format;
final String mime;
final String selectedMediaType;
// first, build the filename and get the output folder (if possible)
// later, run a very very very large file checking logic
@@ -561,9 +621,10 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
switch (radioStreamsGroup.getCheckedRadioButtonId()) {
case R.id.audio_button:
selectedMediaType = getString(R.string.last_download_type_audio_key);
mainStorage = mainStorageAudio;
format = audioStreamsAdapter.getItem(selectedAudioIndex).getFormat();
switch(format) {
switch (format) {
case WEBMA_OPUS:
mime = "audio/ogg";
filename += "opus";
@@ -575,16 +636,18 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
}
break;
case R.id.video_button:
selectedMediaType = getString(R.string.last_download_type_video_key);
mainStorage = mainStorageVideo;
format = videoStreamsAdapter.getItem(selectedVideoIndex).getFormat();
mime = format.mimeType;
filename += format.suffix;
break;
case R.id.subtitle_button:
mainStorage = mainStorageVideo;// subtitle & video files go together
selectedMediaType = getString(R.string.last_download_type_subtitle_key);
mainStorage = mainStorageVideo; // subtitle & video files go together
format = subtitleStreamsAdapter.getItem(selectedSubtitleIndex).getFormat();
mime = format.mimeType;
filename += format == MediaFormat.TTML ? MediaFormat.SRT.suffix : format.suffix;
filename += (format == MediaFormat.TTML ? MediaFormat.SRT : format).suffix;
break;
default:
throw new RuntimeException("No stream selected");
@@ -596,23 +659,25 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
// * save path not defined (via download settings)
// * the user checked the "ask where to download" option
if (!askForSavePath)
Toast.makeText(context, getString(R.string.no_available_dir), Toast.LENGTH_LONG).show();
if (!askForSavePath) {
Toast.makeText(context, getString(R.string.no_available_dir),
Toast.LENGTH_LONG).show();
}
if (NewPipeSettings.useStorageAccessFramework(context)) {
StoredFileHelper.requestSafWithFileCreation(this, REQUEST_DOWNLOAD_SAVE_AS, filename, mime);
StoredFileHelper.requestSafWithFileCreation(this, REQUEST_DOWNLOAD_SAVE_AS,
filename, mime);
} else {
File initialSavePath;
if (radioStreamsGroup.getCheckedRadioButtonId() == R.id.audio_button)
if (radioStreamsGroup.getCheckedRadioButtonId() == R.id.audio_button) {
initialSavePath = NewPipeSettings.getDir(Environment.DIRECTORY_MUSIC);
else
} else {
initialSavePath = NewPipeSettings.getDir(Environment.DIRECTORY_MOVIES);
}
initialSavePath = new File(initialSavePath, filename);
startActivityForResult(
FilePickerActivityHelper.chooseFileToSave(context, initialSavePath.getAbsolutePath()),
REQUEST_DOWNLOAD_SAVE_AS
);
startActivityForResult(FilePickerActivityHelper.chooseFileToSave(context,
initialSavePath.getAbsolutePath()), REQUEST_DOWNLOAD_SAVE_AS);
}
return;
@@ -620,9 +685,16 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
// check for existing file with the same name
checkSelectedDownload(mainStorage, mainStorage.findFile(filename), filename, mime);
// remember the last media type downloaded by the user
prefs.edit()
.putString(getString(R.string.last_used_download_type), selectedMediaType)
.apply();
}
private void checkSelectedDownload(StoredDirectoryHelper mainStorage, Uri targetFile, String filename, String mime) {
private void checkSelectedDownload(final StoredDirectoryHelper mainStorage,
final Uri targetFile, final String filename,
final String mime) {
StoredFileHelper storage;
try {
@@ -631,20 +703,24 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
storage = new StoredFileHelper(context, null, targetFile, "");
} else if (targetFile == null) {
// the file does not exist, but it is probably used in a pending download
storage = new StoredFileHelper(mainStorage.getUri(), filename, mime, mainStorage.getTag());
storage = new StoredFileHelper(mainStorage.getUri(), filename, mime,
mainStorage.getTag());
} else {
// the target filename is already use, attempt to use it
storage = new StoredFileHelper(context, mainStorage.getUri(), targetFile, mainStorage.getTag());
storage = new StoredFileHelper(context, mainStorage.getUri(), targetFile,
mainStorage.getTag());
}
} catch (Exception e) {
} catch (final Exception e) {
showErrorActivity(e);
return;
}
// check if is our file
MissionState state = downloadManager.checkForExistingMission(storage);
@StringRes int msgBtn;
@StringRes int msgBody;
final MissionState state = downloadManager.checkForExistingMission(storage);
@StringRes
final int msgBtn;
@StringRes
final int msgBody;
switch (state) {
case Finished:
@@ -697,8 +773,7 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
return;
}
AlertDialog.Builder askDialog = new AlertDialog.Builder(context)
final AlertDialog.Builder askDialog = new AlertDialog.Builder(context)
.setTitle(R.string.download_dialog_title)
.setMessage(msgBody)
.setNegativeButton(android.R.string.cancel, null);
@@ -738,24 +813,28 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
} else {
try {
// try take (or steal) the file
storageNew = new StoredFileHelper(context, mainStorage.getUri(), targetFile, mainStorage.getTag());
} catch (IOException e) {
Log.e(TAG, "Failed to take (or steal) the file in " + targetFile.toString());
storageNew = new StoredFileHelper(context, mainStorage.getUri(),
targetFile, mainStorage.getTag());
} catch (final IOException e) {
Log.e(TAG, "Failed to take (or steal) the file in "
+ targetFile.toString());
storageNew = null;
}
}
if (storageNew != null && storageNew.canWrite())
if (storageNew != null && storageNew.canWrite()) {
continueSelectedDownload(storageNew);
else
} else {
showFailedDialog(R.string.error_file_creation);
}
break;
case PendingRunning:
storageNew = mainStorage.createUniqueFile(filename, mime);
if (storageNew == null)
if (storageNew == null) {
showFailedDialog(R.string.error_file_creation);
else
} else {
continueSelectedDownload(storageNew);
}
break;
}
});
@@ -763,7 +842,7 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
askDialog.create().show();
}
private void continueSelectedDownload(@NonNull StoredFileHelper storage) {
private void continueSelectedDownload(@NonNull final StoredFileHelper storage) {
if (!storage.canWrite()) {
showFailedDialog(R.string.permission_denied);
return;
@@ -771,19 +850,21 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
// check if the selected file has to be overwritten, by simply checking its length
try {
if (storage.length() > 0) storage.truncate();
} catch (IOException e) {
if (storage.length() > 0) {
storage.truncate();
}
} catch (final IOException e) {
Log.e(TAG, "failed to truncate the file: " + storage.getUri().toString(), e);
showFailedDialog(R.string.overwrite_failed);
return;
}
Stream selectedStream;
final Stream selectedStream;
Stream secondaryStream = null;
char kind;
final char kind;
int threads = threadsSeekBar.getProgress() + 1;
String[] urls;
MissionRecoveryInfo[] recoveryInfo;
final String[] urls;
final MissionRecoveryInfo[] recoveryInfo;
String psName = null;
String[] psArgs = null;
long nearLength = 0;
@@ -804,20 +885,22 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
kind = 'v';
selectedStream = videoStreamsAdapter.getItem(selectedVideoIndex);
SecondaryStreamHelper<AudioStream> secondary = videoStreamsAdapter
final SecondaryStreamHelper<AudioStream> secondary = videoStreamsAdapter
.getAllSecondary()
.get(wrappedVideoStreams.getStreamsList().indexOf(selectedStream));
if (secondary != null) {
secondaryStream = secondary.getStream();
if (selectedStream.getFormat() == MediaFormat.MPEG_4)
if (selectedStream.getFormat() == MediaFormat.MPEG_4) {
psName = Postprocessing.ALGORITHM_MP4_FROM_DASH_MUXER;
else
} else {
psName = Postprocessing.ALGORITHM_WEBM_MUXER;
}
psArgs = null;
long videoSize = wrappedVideoStreams.getSizeInBytes((VideoStream) selectedStream);
final long videoSize = wrappedVideoStreams
.getSizeInBytes((VideoStream) selectedStream);
// set nearLength, only, if both sizes are fetched or known. This probably
// does not work on slow networks but is later updated in the downloader
@@ -827,7 +910,7 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
}
break;
case R.id.subtitle_button:
threads = 1;// use unique thread for subtitles due small file size
threads = 1; // use unique thread for subtitles due small file size
kind = 's';
selectedStream = subtitleStreamsAdapter.getItem(selectedSubtitleIndex);
@@ -835,7 +918,7 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
psName = Postprocessing.ALGORITHM_TTML_CONVERTER;
psArgs = new String[]{
selectedStream.getFormat().getSuffix(),
"false",// ignore empty frames
"false" // ignore empty frames
};
}
break;
@@ -854,14 +937,12 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
urls = new String[]{
selectedStream.getUrl(), secondaryStream.getUrl()
};
recoveryInfo = new MissionRecoveryInfo[]{
new MissionRecoveryInfo(selectedStream), new MissionRecoveryInfo(secondaryStream)
};
recoveryInfo = new MissionRecoveryInfo[]{new MissionRecoveryInfo(selectedStream),
new MissionRecoveryInfo(secondaryStream)};
}
DownloadManagerService.startMission(
context, urls, storage, kind, threads, currentInfo.getUrl(), psName, psArgs, nearLength, recoveryInfo
);
DownloadManagerService.startMission(context, urls, storage, kind, threads,
currentInfo.getUrl(), psName, psArgs, nearLength, recoveryInfo);
dismiss();
}

View File

@@ -1,11 +1,11 @@
package org.schabi.newpipe.fragments;
/**
* Indicates that the current fragment can handle back presses
* Indicates that the current fragment can handle back presses.
*/
public interface BackPressable {
/**
* A back press was delegated to this fragment
* A back press was delegated to this fragment.
*
* @return if the back press was handled
*/

View File

@@ -1,9 +1,8 @@
package org.schabi.newpipe.fragments;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import android.util.Log;
import android.view.View;
import android.widget.Button;
@@ -11,47 +10,53 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.jakewharton.rxbinding2.view.RxView;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import com.jakewharton.rxbinding4.view.RxView;
import org.schabi.newpipe.BaseFragment;
import org.schabi.newpipe.MainActivity;
import org.schabi.newpipe.R;
import org.schabi.newpipe.ReCaptchaActivity;
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
import org.schabi.newpipe.extractor.exceptions.ContentNotSupportedException;
import org.schabi.newpipe.extractor.exceptions.ReCaptchaException;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.ErrorInfo;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.ExceptionUtils;
import org.schabi.newpipe.util.InfoCache;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import icepick.State;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.disposables.Disposable;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
public abstract class BaseStateFragment<I> extends BaseFragment implements ViewContract<I> {
@State
protected AtomicBoolean wasLoading = new AtomicBoolean();
protected AtomicBoolean isLoading = new AtomicBoolean();
@Nullable
protected View emptyStateView;
private View emptyStateView;
@Nullable
protected ProgressBar loadingProgressBar;
private ProgressBar loadingProgressBar;
private Disposable errorDisposable;
protected View errorPanelRoot;
protected Button errorButtonRetry;
protected TextView errorTextView;
private Button errorButtonRetry;
private TextView errorTextView;
@Override
public void onViewCreated(View rootView, Bundle savedInstanceState) {
public void onViewCreated(final View rootView, final Bundle savedInstanceState) {
super.onViewCreated(rootView, savedInstanceState);
doInitialLoadLogic();
}
@@ -62,14 +67,20 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
wasLoading.set(isLoading.get());
}
@Override
public void onDestroy() {
super.onDestroy();
if (errorDisposable != null) {
errorDisposable.dispose();
}
}
/*//////////////////////////////////////////////////////////////////////////
// Init
//////////////////////////////////////////////////////////////////////////*/
@Override
protected void initViews(View rootView, Bundle savedInstanceState) {
protected void initViews(final View rootView, final Bundle savedInstanceState) {
super.initViews(rootView, savedInstanceState);
emptyStateView = rootView.findViewById(R.id.empty_state_view);
@@ -83,7 +94,7 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
@Override
protected void initListeners() {
super.initListeners();
RxView.clicks(errorButtonRetry)
errorDisposable = RxView.clicks(errorButtonRetry)
.debounce(300, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> onRetryButtonClicked());
@@ -105,8 +116,10 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
startLoading(true);
}
protected void startLoading(boolean forceLoad) {
if (DEBUG) Log.d(TAG, "startLoading() called with: forceLoad = [" + forceLoad + "]");
protected void startLoading(final boolean forceLoad) {
if (DEBUG) {
Log.d(TAG, "startLoading() called with: forceLoad = [" + forceLoad + "]");
}
showLoading();
isLoading.set(true);
}
@@ -117,42 +130,62 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
@Override
public void showLoading() {
if (emptyStateView != null) animateView(emptyStateView, false, 150);
if (loadingProgressBar != null) animateView(loadingProgressBar, true, 400);
if (emptyStateView != null) {
animateView(emptyStateView, false, 150);
}
if (loadingProgressBar != null) {
animateView(loadingProgressBar, true, 400);
}
animateView(errorPanelRoot, false, 150);
}
@Override
public void hideLoading() {
if (emptyStateView != null) animateView(emptyStateView, false, 150);
if (loadingProgressBar != null) animateView(loadingProgressBar, false, 0);
if (emptyStateView != null) {
animateView(emptyStateView, false, 150);
}
if (loadingProgressBar != null) {
animateView(loadingProgressBar, false, 0);
}
animateView(errorPanelRoot, false, 150);
}
@Override
public void showEmptyState() {
isLoading.set(false);
if (emptyStateView != null) animateView(emptyStateView, true, 200);
if (loadingProgressBar != null) animateView(loadingProgressBar, false, 0);
if (emptyStateView != null) {
animateView(emptyStateView, true, 200);
}
if (loadingProgressBar != null) {
animateView(loadingProgressBar, false, 0);
}
animateView(errorPanelRoot, false, 150);
}
@Override
public void showError(String message, boolean showRetryButton) {
if (DEBUG) Log.d(TAG, "showError() called with: message = [" + message + "], showRetryButton = [" + showRetryButton + "]");
public void showError(final String message, final boolean showRetryButton) {
if (DEBUG) {
Log.d(TAG, "showError() called with: "
+ "message = [" + message + "], showRetryButton = [" + showRetryButton + "]");
}
isLoading.set(false);
InfoCache.getInstance().clearCache();
hideLoading();
errorTextView.setText(message);
if (showRetryButton) animateView(errorButtonRetry, true, 600);
else animateView(errorButtonRetry, false, 0);
if (showRetryButton) {
animateView(errorButtonRetry, true, 600);
} else {
animateView(errorButtonRetry, false, 0);
}
animateView(errorPanelRoot, true, 300);
}
@Override
public void handleResult(I result) {
if (DEBUG) Log.d(TAG, "handleResult() called with: result = [" + result + "]");
public void handleResult(final I result) {
if (DEBUG) {
Log.d(TAG, "handleResult() called with: result = [" + result + "]");
}
hideLoading();
}
@@ -161,21 +194,28 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
//////////////////////////////////////////////////////////////////////////*/
/**
* Default implementation handles some general exceptions
* Default implementation handles some general exceptions.
*
* @return if the exception was handled
* @param exception The exception that should be handled
* @return If the exception was handled
*/
protected boolean onError(Throwable exception) {
if (DEBUG) Log.d(TAG, "onError() called with: exception = [" + exception + "]");
protected boolean onError(final Throwable exception) {
if (DEBUG) {
Log.d(TAG, "onError() called with: exception = [" + exception + "]");
}
isLoading.set(false);
if (isDetached() || isRemoving()) {
if (DEBUG) Log.w(TAG, "onError() is detached or removing = [" + exception + "]");
if (DEBUG) {
Log.w(TAG, "onError() is detached or removing = [" + exception + "]");
}
return true;
}
if (ExtractorHelper.isInterruptedCaused(exception)) {
if (DEBUG) Log.w(TAG, "onError() isInterruptedCaused! = [" + exception + "]");
if (ExceptionUtils.isInterruptedCaused(exception)) {
if (DEBUG) {
Log.w(TAG, "onError() isInterruptedCaused! = [" + exception + "]");
}
return true;
}
@@ -185,54 +225,84 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
} else if (exception instanceof ContentNotAvailableException) {
showError(getString(R.string.content_not_available), false);
return true;
} else if (exception instanceof IOException) {
} else if (ExceptionUtils.isNetworkRelated(exception)) {
showError(getString(R.string.network_error), true);
return true;
} else if (exception instanceof ContentNotSupportedException) {
showError(getString(R.string.content_not_supported), false);
return true;
}
return false;
}
public void onReCaptchaException(ReCaptchaException exception) {
if (DEBUG) Log.d(TAG, "onReCaptchaException() called");
public void onReCaptchaException(final ReCaptchaException exception) {
if (DEBUG) {
Log.d(TAG, "onReCaptchaException() called");
}
Toast.makeText(activity, R.string.recaptcha_request_toast, Toast.LENGTH_LONG).show();
// Starting ReCaptcha Challenge Activity
Intent intent = new Intent(activity, ReCaptchaActivity.class);
final Intent intent = new Intent(activity, ReCaptchaActivity.class);
intent.putExtra(ReCaptchaActivity.RECAPTCHA_URL_EXTRA, exception.getUrl());
startActivityForResult(intent, ReCaptchaActivity.RECAPTCHA_REQUEST);
showError(getString(R.string.recaptcha_request_toast), false);
}
public void onUnrecoverableError(Throwable exception, UserAction userAction, String serviceName, String request, @StringRes int errorId) {
onUnrecoverableError(Collections.singletonList(exception), userAction, serviceName, request, errorId);
public void onUnrecoverableError(final Throwable exception, final UserAction userAction,
final String serviceName, final String request,
@StringRes final int errorId) {
onUnrecoverableError(Collections.singletonList(exception), userAction, serviceName,
request, errorId);
}
public void onUnrecoverableError(List<Throwable> exception, UserAction userAction, String serviceName, String request, @StringRes int errorId) {
if (DEBUG) Log.d(TAG, "onUnrecoverableError() called with: exception = [" + exception + "]");
public void onUnrecoverableError(final List<Throwable> exception, final UserAction userAction,
final String serviceName, final String request,
@StringRes final int errorId) {
if (DEBUG) {
Log.d(TAG, "onUnrecoverableError() called with: exception = [" + exception + "]");
}
if (serviceName == null) serviceName = "none";
if (request == null) request = "none";
ErrorActivity.reportError(getContext(), exception, MainActivity.class, null, ErrorActivity.ErrorInfo.make(userAction, serviceName, request, errorId));
ErrorActivity.reportError(getContext(), exception, MainActivity.class, null,
ErrorInfo.make(userAction, serviceName == null ? "none" : serviceName,
request == null ? "none" : request, errorId));
}
public void showSnackBarError(Throwable exception, UserAction userAction, String serviceName, String request, @StringRes int errorId) {
showSnackBarError(Collections.singletonList(exception), userAction, serviceName, request, errorId);
public void showSnackBarError(final Throwable exception, final UserAction userAction,
final String serviceName, final String request,
@StringRes final int errorId) {
showSnackBarError(Collections.singletonList(exception), userAction, serviceName, request,
errorId);
}
/**
* Show a SnackBar and only call ErrorActivity#reportError IF we a find a valid view (otherwise the error screen appears)
* Show a SnackBar and only call
* {@link ErrorActivity#reportError(Context, List, Class, View, ErrorInfo)}
* IF we a find a valid view (otherwise the error screen appears).
*
* @param exception List of the exceptions to show
* @param userAction The user action that caused the exception
* @param serviceName The service where the exception happened
* @param request The page that was requested
* @param errorId The ID of the error
*/
public void showSnackBarError(List<Throwable> exception, UserAction userAction, String serviceName, String request, @StringRes int errorId) {
public void showSnackBarError(final List<Throwable> exception, final UserAction userAction,
final String serviceName, final String request,
@StringRes final int errorId) {
if (DEBUG) {
Log.d(TAG, "showSnackBarError() called with: exception = [" + exception + "], userAction = [" + userAction + "], request = [" + request + "], errorId = [" + errorId + "]");
Log.d(TAG, "showSnackBarError() called with: "
+ "exception = [" + exception + "], userAction = [" + userAction + "], "
+ "request = [" + request + "], errorId = [" + errorId + "]");
}
View rootView = activity != null ? activity.findViewById(android.R.id.content) : null;
if (rootView == null && getView() != null) rootView = getView();
if (rootView == null) return;
if (rootView == null && getView() != null) {
rootView = getView();
}
if (rootView == null) {
return;
}
ErrorActivity.reportError(getContext(), exception, MainActivity.class, rootView,
ErrorActivity.ErrorInfo.make(userAction, serviceName, request, errorId));
ErrorInfo.make(userAction, serviceName, request, errorId));
}
}

View File

@@ -1,24 +1,26 @@
package org.schabi.newpipe.fragments;
import android.os.Bundle;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import org.schabi.newpipe.BaseFragment;
import org.schabi.newpipe.R;
public class BlankFragment extends BaseFragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container,
final Bundle savedInstanceState) {
setTitle("NewPipe");
return inflater.inflate(R.layout.fragment_blank, container, false);
}
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
public void setUserVisibleHint(final boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
setTitle("NewPipe");
// leave this inline. Will make it harder for copy cats.

View File

@@ -1,17 +1,19 @@
package org.schabi.newpipe.fragments;
import android.os.Bundle;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import org.schabi.newpipe.BaseFragment;
import org.schabi.newpipe.R;
public class EmptyFragment extends BaseFragment {
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container,
final Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_empty, container, false);
}
}

View File

@@ -1,7 +1,9 @@
package org.schabi.newpipe.fragments;
import android.content.Context;
import android.content.res.ColorStateList;
import android.os.Bundle;
import androidx.preference.PreferenceManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -25,11 +27,13 @@ import org.schabi.newpipe.BaseFragment;
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.ErrorInfo;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.settings.tabs.Tab;
import org.schabi.newpipe.settings.tabs.TabsManager;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.ThemeHelper;
import org.schabi.newpipe.views.ScrollableTabLayout;
import java.util.ArrayList;
@@ -40,24 +44,27 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
private SelectedTabsPagerAdapter pagerAdapter;
private ScrollableTabLayout tabLayout;
private List<Tab> tabsList = new ArrayList<>();
private final List<Tab> tabsList = new ArrayList<>();
private TabsManager tabsManager;
private boolean hasTabsChanged = false;
private boolean previousYoutubeRestrictedModeEnabled;
private String youtubeRestrictedModeEnabledKey;
/*//////////////////////////////////////////////////////////////////////////
// Fragment's LifeCycle
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onCreate(Bundle savedInstanceState) {
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
tabsManager = TabsManager.getManager(activity);
tabsManager.setSavedTabsListener(() -> {
if (DEBUG) {
Log.d(TAG, "TabsManager.SavedTabsChangeListener: onTabsChanged called, isResumed = " + isResumed());
Log.d(TAG, "TabsManager.SavedTabsChangeListener: "
+ "onTabsChanged called, isResumed = " + isResumed());
}
if (isResumed()) {
setupTabs();
@@ -65,20 +72,29 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
hasTabsChanged = true;
}
});
youtubeRestrictedModeEnabledKey = getString(R.string.youtube_restricted_mode_enabled);
previousYoutubeRestrictedModeEnabled =
PreferenceManager.getDefaultSharedPreferences(requireContext())
.getBoolean(youtubeRestrictedModeEnabledKey, false);
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
public View onCreateView(@NonNull final LayoutInflater inflater,
@Nullable final ViewGroup container,
@Nullable final Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_main, container, false);
}
@Override
protected void initViews(View rootView, Bundle savedInstanceState) {
protected void initViews(final View rootView, final Bundle savedInstanceState) {
super.initViews(rootView, savedInstanceState);
tabLayout = rootView.findViewById(R.id.main_tab_layout);
viewPager = rootView.findViewById(R.id.pager);
tabLayout.setTabIconTint(ColorStateList.valueOf(
ThemeHelper.resolveColorFromAttr(requireContext(), R.attr.colorAccent)));
tabLayout.setupWithViewPager(viewPager);
tabLayout.addOnTabSelectedListener(this);
@@ -89,14 +105,24 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
public void onResume() {
super.onResume();
if (hasTabsChanged) setupTabs();
final boolean youtubeRestrictedModeEnabled =
PreferenceManager.getDefaultSharedPreferences(requireContext())
.getBoolean(youtubeRestrictedModeEnabledKey, false);
if (previousYoutubeRestrictedModeEnabled != youtubeRestrictedModeEnabled) {
previousYoutubeRestrictedModeEnabled = youtubeRestrictedModeEnabled;
setupTabs();
} else if (hasTabsChanged) {
setupTabs();
}
}
@Override
public void onDestroy() {
super.onDestroy();
tabsManager.unsetSavedTabsListener();
if (viewPager != null) viewPager.setAdapter(null);
if (viewPager != null) {
viewPager.setAdapter(null);
}
}
/*//////////////////////////////////////////////////////////////////////////
@@ -104,27 +130,28 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
if (DEBUG) Log.d(TAG, "onCreateOptionsMenu() called with: menu = [" + menu + "], inflater = [" + inflater + "]");
if (DEBUG) {
Log.d(TAG, "onCreateOptionsMenu() called with: "
+ "menu = [" + menu + "], inflater = [" + inflater + "]");
}
inflater.inflate(R.menu.main_fragment_menu, menu);
ActionBar supportActionBar = activity.getSupportActionBar();
final ActionBar supportActionBar = activity.getSupportActionBar();
if (supportActionBar != null) {
supportActionBar.setDisplayHomeAsUpEnabled(false);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case R.id.action_search:
try {
NavigationHelper.openSearchFragment(
getFragmentManager(),
ServiceHelper.getSelectedServiceId(activity),
"");
} catch (Exception e) {
NavigationHelper.openSearchFragment(getFM(),
ServiceHelper.getSelectedServiceId(activity), "");
} catch (final Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
}
return true;
@@ -141,7 +168,8 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
tabsList.addAll(tabsManager.getTabs());
if (pagerAdapter == null || !pagerAdapter.sameTabs(tabsList)) {
pagerAdapter = new SelectedTabsPagerAdapter(requireContext(), getChildFragmentManager(), tabsList);
pagerAdapter = new SelectedTabsPagerAdapter(requireContext(),
getChildFragmentManager(), tabsList);
}
viewPager.setAdapter(null);
@@ -165,31 +193,37 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
}
}
private void updateTitleForTab(int tabPosition) {
private void updateTitleForTab(final int tabPosition) {
setTitle(tabsList.get(tabPosition).getTabName(requireContext()));
}
@Override
public void onTabSelected(TabLayout.Tab selectedTab) {
if (DEBUG) Log.d(TAG, "onTabSelected() called with: selectedTab = [" + selectedTab + "]");
public void onTabSelected(final TabLayout.Tab selectedTab) {
if (DEBUG) {
Log.d(TAG, "onTabSelected() called with: selectedTab = [" + selectedTab + "]");
}
updateTitleForTab(selectedTab.getPosition());
}
@Override
public void onTabUnselected(TabLayout.Tab tab) {
}
public void onTabUnselected(final TabLayout.Tab tab) { }
@Override
public void onTabReselected(TabLayout.Tab tab) {
if (DEBUG) Log.d(TAG, "onTabReselected() called with: tab = [" + tab + "]");
public void onTabReselected(final TabLayout.Tab tab) {
if (DEBUG) {
Log.d(TAG, "onTabReselected() called with: tab = [" + tab + "]");
}
updateTitleForTab(tab.getPosition());
}
private static class SelectedTabsPagerAdapter extends FragmentStatePagerAdapterMenuWorkaround {
private static final class SelectedTabsPagerAdapter
extends FragmentStatePagerAdapterMenuWorkaround {
private final Context context;
private final List<Tab> internalTabsList;
private SelectedTabsPagerAdapter(Context context, FragmentManager fragmentManager, List<Tab> tabsList) {
private SelectedTabsPagerAdapter(final Context context,
final FragmentManager fragmentManager,
final List<Tab> tabsList) {
super(fragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
this.context = context;
this.internalTabsList = new ArrayList<>(tabsList);
@@ -197,20 +231,20 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
@NonNull
@Override
public Fragment getItem(int position) {
public Fragment getItem(final int position) {
final Tab tab = internalTabsList.get(position);
Throwable throwable = null;
Fragment fragment = null;
try {
fragment = tab.getFragment(context);
} catch (ExtractionException e) {
} catch (final ExtractionException e) {
throwable = e;
}
if (throwable != null) {
ErrorActivity.reportError(context, throwable, null, null,
ErrorActivity.ErrorInfo.make(UserAction.UI_ERROR, "none", "", R.string.app_ui_crash));
ErrorActivity.reportError(context, throwable, null, null, ErrorInfo
.make(UserAction.UI_ERROR, "none", "", R.string.app_ui_crash));
return new BlankFragment();
}
@@ -222,7 +256,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
}
@Override
public int getItemPosition(Object object) {
public int getItemPosition(final Object object) {
// Causes adapter to reload all Fragments when
// notifyDataSetChanged is called
return POSITION_NONE;
@@ -233,7 +267,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
return internalTabsList.size();
}
public boolean sameTabs(List<Tab> tabsToCompare) {
public boolean sameTabs(final List<Tab> tabsToCompare) {
return internalTabsList.equals(tabsToCompare);
}
}

View File

@@ -9,23 +9,26 @@ import androidx.recyclerview.widget.StaggeredGridLayoutManager;
* if the view is scrolled below the last item.
*/
public abstract class OnScrollBelowItemsListener extends RecyclerView.OnScrollListener {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
public void onScrolled(final RecyclerView recyclerView, final int dx, final int dy) {
super.onScrolled(recyclerView, dx, dy);
if (dy > 0) {
int pastVisibleItems = 0, visibleItemCount, totalItemCount;
RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
int pastVisibleItems = 0;
final RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
visibleItemCount = layoutManager.getChildCount();
totalItemCount = layoutManager.getItemCount();
final int visibleItemCount = layoutManager.getChildCount();
final int totalItemCount = layoutManager.getItemCount();
// Already covers the GridLayoutManager case
if (layoutManager instanceof LinearLayoutManager) {
pastVisibleItems = ((LinearLayoutManager) layoutManager).findFirstVisibleItemPosition();
pastVisibleItems = ((LinearLayoutManager) layoutManager)
.findFirstVisibleItemPosition();
} else if (layoutManager instanceof StaggeredGridLayoutManager) {
int[] positions = ((StaggeredGridLayoutManager) layoutManager).findFirstVisibleItemPositions(null);
if (positions != null && positions.length > 0) pastVisibleItems = positions[0];
final int[] positions = ((StaggeredGridLayoutManager) layoutManager)
.findFirstVisibleItemPositions(null);
if (positions != null && positions.length > 0) {
pastVisibleItems = positions[0];
}
}
if ((visibleItemCount + pastVisibleItems) >= totalItemCount) {

View File

@@ -2,8 +2,11 @@ package org.schabi.newpipe.fragments;
public interface ViewContract<I> {
void showLoading();
void hideLoading();
void showEmptyState();
void showError(String message, boolean showRetryButton);
void handleResult(I result);

View File

@@ -1,20 +1,29 @@
package org.schabi.newpipe.fragments.detail;
import org.schabi.newpipe.player.playqueue.PlayQueue;
import java.io.Serializable;
class StackItem implements Serializable {
private final int serviceId;
private String url;
private String title;
private final String url;
private PlayQueue playQueue;
StackItem(int serviceId, String url, String title) {
StackItem(final int serviceId, final String url,
final String title, final PlayQueue playQueue) {
this.serviceId = serviceId;
this.url = url;
this.title = title;
this.playQueue = playQueue;
}
public void setTitle(String title) {
this.title = title;
public void setUrl(final String url) {
this.url = url;
}
public void setPlayQueue(final PlayQueue queue) {
this.playQueue = queue;
}
public int getServiceId() {
@@ -25,10 +34,18 @@ class StackItem implements Serializable {
return title;
}
public void setTitle(final String title) {
this.title = title;
}
public String getUrl() {
return url;
}
public PlayQueue getPlayQueue() {
return playQueue;
}
@Override
public String toString() {
return getServiceId() + ":" + getUrl() + " > " + getTitle();

View File

@@ -1,27 +1,32 @@
package org.schabi.newpipe.fragments.detail;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
public class TabAdaptor extends FragmentPagerAdapter {
public class TabAdapter extends FragmentPagerAdapter {
private final List<Fragment> mFragmentList = new ArrayList<>();
private final List<String> mFragmentTitleList = new ArrayList<>();
private final FragmentManager fragmentManager;
public TabAdaptor(FragmentManager fm) {
super(fm);
public TabAdapter(final FragmentManager fm) {
// if changed to BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT => crash if enqueueing stream in
// the background and then clicking on it to open VideoDetailFragment:
// "Cannot setMaxLifecycle for Fragment not attached to FragmentManager"
super(fm, BEHAVIOR_SET_USER_VISIBLE_HINT);
this.fragmentManager = fm;
}
@NonNull
@Override
public Fragment getItem(int position) {
public Fragment getItem(final int position) {
return mFragmentList.get(position);
}
@@ -30,7 +35,7 @@ public class TabAdaptor extends FragmentPagerAdapter {
return mFragmentList.size();
}
public void addFragment(Fragment fragment, String title) {
public void addFragment(final Fragment fragment, final String title) {
mFragmentList.add(fragment);
mFragmentTitleList.add(title);
}
@@ -40,46 +45,51 @@ public class TabAdaptor extends FragmentPagerAdapter {
mFragmentTitleList.clear();
}
public void removeItem(int position){
public void removeItem(final int position) {
mFragmentList.remove(position == 0 ? 0 : position - 1);
mFragmentTitleList.remove(position == 0 ? 0 : position - 1);
}
public void updateItem(int position, Fragment fragment){
public void updateItem(final int position, final Fragment fragment) {
mFragmentList.set(position, fragment);
}
public void updateItem(String title, Fragment fragment){
int index = mFragmentTitleList.indexOf(title);
if(index != -1){
public void updateItem(final String title, final Fragment fragment) {
final int index = mFragmentTitleList.indexOf(title);
if (index != -1) {
updateItem(index, fragment);
}
}
@Override
public int getItemPosition(Object object) {
if (mFragmentList.contains(object)) return mFragmentList.indexOf(object);
else return POSITION_NONE;
public int getItemPosition(@NonNull final Object object) {
if (mFragmentList.contains(object)) {
return mFragmentList.indexOf(object);
} else {
return POSITION_NONE;
}
}
public int getItemPositionByTitle(String title) {
public int getItemPositionByTitle(final String title) {
return mFragmentTitleList.indexOf(title);
}
@Nullable
public String getItemTitle(int position) {
public String getItemTitle(final int position) {
if (position < 0 || position >= mFragmentTitleList.size()) {
return null;
}
return mFragmentTitleList.get(position);
}
public void notifyDataSetUpdate(){
public void notifyDataSetUpdate() {
notifyDataSetChanged();
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
public void destroyItem(@NonNull final ViewGroup container,
final int position,
@NonNull final Object object) {
fragmentManager.beginTransaction().remove((Fragment) object).commitNowAllowingStateLoss();
}

View File

@@ -6,18 +6,18 @@ import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.preference.PreferenceManager;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.InfoItem;
import org.schabi.newpipe.extractor.channel.ChannelInfoItem;
@@ -29,18 +29,29 @@ import org.schabi.newpipe.fragments.BaseStateFragment;
import org.schabi.newpipe.fragments.OnScrollBelowItemsListener;
import org.schabi.newpipe.info_list.InfoItemDialog;
import org.schabi.newpipe.info_list.InfoListAdapter;
import org.schabi.newpipe.player.helper.PlayerHolder;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.OnClickGesture;
import org.schabi.newpipe.util.StateSaver;
import org.schabi.newpipe.util.StreamDialogEntry;
import org.schabi.newpipe.views.SuperScrollLayoutManager;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Queue;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implements ListViewContract<I, N>, StateSaver.WriteRead, SharedPreferences.OnSharedPreferenceChangeListener {
public abstract class BaseListFragment<I, N> extends BaseStateFragment<I>
implements ListViewContract<I, N>, StateSaver.WriteRead,
SharedPreferences.OnSharedPreferenceChangeListener {
private static final int LIST_MODE_UPDATE_FLAG = 0x32;
protected org.schabi.newpipe.util.SavedState savedState;
private boolean useDefaultStateSaving = true;
private int updateFlags = 0;
/*//////////////////////////////////////////////////////////////////////////
// Views
@@ -48,16 +59,14 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
protected InfoListAdapter infoListAdapter;
protected RecyclerView itemsList;
private int updateFlags = 0;
private static final int LIST_MODE_UPDATE_FLAG = 0x32;
private int focusedPosition = -1;
/*//////////////////////////////////////////////////////////////////////////
// LifeCycle
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onAttach(Context context) {
public void onAttach(final Context context) {
super.onAttach(context);
if (infoListAdapter == null) {
@@ -71,7 +80,7 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
}
@Override
public void onCreate(Bundle savedInstanceState) {
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
PreferenceManager.getDefaultSharedPreferences(activity)
@@ -81,7 +90,9 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
@Override
public void onDestroy() {
super.onDestroy();
if (useDefaultStateSaving) StateSaver.onDestroy(savedState);
if (useDefaultStateSaving) {
StateSaver.onDestroy(savedState);
}
PreferenceManager.getDefaultSharedPreferences(activity)
.unregisterOnSharedPreferenceChangeListener(this);
}
@@ -93,8 +104,9 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
if (updateFlags != 0) {
if ((updateFlags & LIST_MODE_UPDATE_FLAG) != 0) {
final boolean useGrid = isGridLayout();
itemsList.setLayoutManager(useGrid ? getGridLayoutManager() : getListLayoutManager());
infoListAdapter.setGridItemVariants(useGrid);
itemsList.setLayoutManager(useGrid
? getGridLayoutManager() : getListLayoutManager());
infoListAdapter.setUseGridVariant(useGrid);
infoListAdapter.notifyDataSetChanged();
}
updateFlags = 0;
@@ -105,16 +117,14 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
// State Saving
//////////////////////////////////////////////////////////////////////////*/
protected StateSaver.SavedState savedState;
protected boolean useDefaultStateSaving = true;
/**
* If the default implementation of {@link StateSaver.WriteRead} should be used.
*
* @see StateSaver
* @param useDefaultStateSaving Whether the default implementation should be used
*/
public void useDefaultStateSaving(boolean useDefault) {
this.useDefaultStateSaving = useDefault;
public void setUseDefaultStateSaving(final boolean useDefaultStateSaving) {
this.useDefaultStateSaving = useDefaultStateSaving;
}
@Override
@@ -123,30 +133,81 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
return "." + infoListAdapter.getItemsList().size() + ".list";
}
@Override
public void writeTo(Queue<Object> objectsToSave) {
if (useDefaultStateSaving) objectsToSave.add(infoListAdapter.getItemsList());
}
@Override
@SuppressWarnings("unchecked")
public void readFrom(@NonNull Queue<Object> savedObjects) throws Exception {
if (useDefaultStateSaving) {
infoListAdapter.getItemsList().clear();
infoListAdapter.getItemsList().addAll((List<InfoItem>) savedObjects.poll());
private int getFocusedPosition() {
try {
final View focusedItem = itemsList.getFocusedChild();
final RecyclerView.ViewHolder itemHolder =
itemsList.findContainingViewHolder(focusedItem);
return itemHolder.getAdapterPosition();
} catch (final NullPointerException e) {
return -1;
}
}
@Override
public void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
if (useDefaultStateSaving) savedState = StateSaver.tryToSave(activity.isChangingConfigurations(), savedState, bundle, this);
public void writeTo(final Queue<Object> objectsToSave) {
if (!useDefaultStateSaving) {
return;
}
objectsToSave.add(infoListAdapter.getItemsList());
objectsToSave.add(getFocusedPosition());
}
@Override
protected void onRestoreInstanceState(@NonNull Bundle bundle) {
@SuppressWarnings("unchecked")
public void readFrom(@NonNull final Queue<Object> savedObjects) throws Exception {
if (!useDefaultStateSaving) {
return;
}
infoListAdapter.getItemsList().clear();
infoListAdapter.getItemsList().addAll((List<InfoItem>) savedObjects.poll());
restoreFocus((Integer) savedObjects.poll());
}
private void restoreFocus(final Integer position) {
if (position == null || position < 0) {
return;
}
itemsList.post(() -> {
final RecyclerView.ViewHolder focusedHolder =
itemsList.findViewHolderForAdapterPosition(position);
if (focusedHolder != null) {
focusedHolder.itemView.requestFocus();
}
});
}
@Override
public void onSaveInstanceState(final Bundle bundle) {
super.onSaveInstanceState(bundle);
if (useDefaultStateSaving) {
savedState = StateSaver
.tryToSave(activity.isChangingConfigurations(), savedState, bundle, this);
}
}
@Override
protected void onRestoreInstanceState(@NonNull final Bundle bundle) {
super.onRestoreInstanceState(bundle);
if (useDefaultStateSaving) savedState = StateSaver.tryToRestore(bundle, this);
if (useDefaultStateSaving) {
savedState = StateSaver.tryToRestore(bundle, this);
}
}
@Override
public void onStop() {
focusedPosition = getFocusedPosition();
super.onStop();
}
@Override
public void onStart() {
super.onStart();
restoreFocus(focusedPosition);
}
/*//////////////////////////////////////////////////////////////////////////
@@ -162,36 +223,39 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
}
protected RecyclerView.LayoutManager getListLayoutManager() {
return new LinearLayoutManager(activity);
return new SuperScrollLayoutManager(activity);
}
protected RecyclerView.LayoutManager getGridLayoutManager() {
final Resources resources = activity.getResources();
int width = resources.getDimensionPixelSize(R.dimen.video_item_grid_thumbnail_image_width);
width += (24 * resources.getDisplayMetrics().density);
final int spanCount = (int) Math.floor(resources.getDisplayMetrics().widthPixels / (double)width);
final int spanCount = (int) Math.floor(resources.getDisplayMetrics().widthPixels
/ (double) width);
final GridLayoutManager lm = new GridLayoutManager(activity, spanCount);
lm.setSpanSizeLookup(infoListAdapter.getSpanSizeLookup(spanCount));
return lm;
}
@Override
protected void initViews(View rootView, Bundle savedInstanceState) {
protected void initViews(final View rootView, final Bundle savedInstanceState) {
super.initViews(rootView, savedInstanceState);
final boolean useGrid = isGridLayout();
itemsList = rootView.findViewById(R.id.items_list);
itemsList.setLayoutManager(useGrid ? getGridLayoutManager() : getListLayoutManager());
infoListAdapter.setGridItemVariants(useGrid);
infoListAdapter.setUseGridVariant(useGrid);
infoListAdapter.setFooter(getListFooter());
infoListAdapter.setHeader(getListHeader());
itemsList.setAdapter(infoListAdapter);
}
protected void onItemSelected(InfoItem selectedItem) {
if (DEBUG) Log.d(TAG, "onItemSelected() called with: selectedItem = [" + selectedItem + "]");
protected void onItemSelected(final InfoItem selectedItem) {
if (DEBUG) {
Log.d(TAG, "onItemSelected() called with: selectedItem = [" + selectedItem + "]");
}
}
@Override
@@ -199,26 +263,26 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
super.initListeners();
infoListAdapter.setOnStreamSelectedListener(new OnClickGesture<StreamInfoItem>() {
@Override
public void selected(StreamInfoItem selectedItem) {
public void selected(final StreamInfoItem selectedItem) {
onStreamSelected(selectedItem);
}
@Override
public void held(StreamInfoItem selectedItem) {
public void held(final StreamInfoItem selectedItem) {
showStreamDialog(selectedItem);
}
});
infoListAdapter.setOnChannelSelectedListener(new OnClickGesture<ChannelInfoItem>() {
@Override
public void selected(ChannelInfoItem selectedItem) {
public void selected(final ChannelInfoItem selectedItem) {
try {
onItemSelected(selectedItem);
NavigationHelper.openChannelFragment(getFM(),
selectedItem.getServiceId(),
selectedItem.getUrl(),
selectedItem.getName());
} catch (Exception e) {
} catch (final Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
}
}
@@ -226,14 +290,14 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
infoListAdapter.setOnPlaylistSelectedListener(new OnClickGesture<PlaylistInfoItem>() {
@Override
public void selected(PlaylistInfoItem selectedItem) {
public void selected(final PlaylistInfoItem selectedItem) {
try {
onItemSelected(selectedItem);
NavigationHelper.openPlaylistFragment(getFM(),
selectedItem.getServiceId(),
selectedItem.getUrl(),
selectedItem.getName());
} catch (Exception e) {
} catch (final Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
}
}
@@ -241,7 +305,7 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
infoListAdapter.setOnCommentsSelectedListener(new OnClickGesture<CommentsInfoItem>() {
@Override
public void selected(CommentsInfoItem selectedItem) {
public void selected(final CommentsInfoItem selectedItem) {
onItemSelected(selectedItem);
}
});
@@ -249,16 +313,17 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
itemsList.clearOnScrollListeners();
itemsList.addOnScrollListener(new OnScrollBelowItemsListener() {
@Override
public void onScrolledDown(RecyclerView recyclerView) {
public void onScrolledDown(final RecyclerView recyclerView) {
onScrollToBottom();
}
});
}
private void onStreamSelected(StreamInfoItem selectedItem) {
private void onStreamSelected(final StreamInfoItem selectedItem) {
onItemSelected(selectedItem);
NavigationHelper.openVideoDetailFragment(getFM(),
selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName());
NavigationHelper.openVideoDetailFragment(requireContext(), getFM(),
selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName(),
null, false);
}
protected void onScrollToBottom() {
@@ -268,31 +333,36 @@ 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 || activity == null) return;
if (context == null || context.getResources() == null || activity == null) {
return;
}
final ArrayList<StreamDialogEntry> entries = new ArrayList<>();
if (PlayerHolder.getType() != null) {
entries.add(StreamDialogEntry.enqueue);
}
if (item.getStreamType() == StreamType.AUDIO_STREAM) {
StreamDialogEntry.setEnabledEntries(
StreamDialogEntry.enqueue_on_background,
entries.addAll(Arrays.asList(
StreamDialogEntry.start_here_on_background,
StreamDialogEntry.append_playlist,
StreamDialogEntry.share);
} else {
StreamDialogEntry.setEnabledEntries(
StreamDialogEntry.enqueue_on_background,
StreamDialogEntry.enqueue_on_popup,
StreamDialogEntry.share
));
} else {
entries.addAll(Arrays.asList(
StreamDialogEntry.start_here_on_background,
StreamDialogEntry.start_here_on_popup,
StreamDialogEntry.append_playlist,
StreamDialogEntry.share);
StreamDialogEntry.share
));
}
StreamDialogEntry.setEnabledEntries(entries);
new InfoItemDialog(activity, item, StreamDialogEntry.getCommands(context), (dialog, which) ->
StreamDialogEntry.clickOn(which, this, item)).show();
new InfoItemDialog(activity, item, StreamDialogEntry.getCommands(context),
(dialog, which) -> StreamDialogEntry.clickOn(which, this, item)).show();
}
/*//////////////////////////////////////////////////////////////////////////
@@ -300,17 +370,16 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
if (DEBUG) Log.d(TAG, "onCreateOptionsMenu() called with: menu = [" + menu + "], inflater = [" + inflater + "]");
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
if (DEBUG) {
Log.d(TAG, "onCreateOptionsMenu() called with: "
+ "menu = [" + menu + "], inflater = [" + inflater + "]");
}
super.onCreateOptionsMenu(menu, inflater);
ActionBar supportActionBar = activity.getSupportActionBar();
final ActionBar supportActionBar = activity.getSupportActionBar();
if (supportActionBar != null) {
supportActionBar.setDisplayShowTitleEnabled(true);
if (useAsFrontPage) {
supportActionBar.setDisplayHomeAsUpEnabled(false);
} else {
supportActionBar.setDisplayHomeAsUpEnabled(true);
}
supportActionBar.setDisplayHomeAsUpEnabled(!useAsFrontPage);
}
}
@@ -339,7 +408,7 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
}
@Override
public void showError(String message, boolean showRetryButton) {
public void showError(final String message, final boolean showRetryButton) {
super.showError(message, showRetryButton);
showListFooter(false);
animateView(itemsList, false, 200);
@@ -361,25 +430,28 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
}
@Override
public void handleNextItems(N result) {
public void handleNextItems(final N result) {
isLoading.set(false);
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences,
final String key) {
if (key.equals(getString(R.string.list_view_mode_key))) {
updateFlags |= LIST_MODE_UPDATE_FLAG;
}
}
protected boolean isGridLayout() {
final String list_mode = PreferenceManager.getDefaultSharedPreferences(activity).getString(getString(R.string.list_view_mode_key), getString(R.string.list_view_mode_value));
if ("auto".equals(list_mode)) {
final String listMode = PreferenceManager.getDefaultSharedPreferences(activity)
.getString(getString(R.string.list_view_mode_key),
getString(R.string.list_view_mode_value));
if ("auto".equals(listMode)) {
final Configuration configuration = getResources().getConfiguration();
return configuration.orientation == Configuration.ORIENTATION_LANDSCAPE
&& configuration.isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE);
} else {
return "grid".equals(list_mode);
return "grid".equals(listMode);
}
}
}

View File

@@ -9,19 +9,20 @@ import androidx.annotation.NonNull;
import org.schabi.newpipe.extractor.ListExtractor;
import org.schabi.newpipe.extractor.ListInfo;
import org.schabi.newpipe.extractor.Page;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.views.NewPipeRecyclerView;
import java.util.Queue;
import icepick.State;
import io.reactivex.Single;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.schedulers.Schedulers;
public abstract class BaseListInfoFragment<I extends ListInfo>
extends BaseListFragment<I, ListExtractor.InfoItemsPage> {
@State
protected int serviceId = Constants.NO_SERVICE_ID;
@State
@@ -30,11 +31,11 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
protected String url;
protected I currentInfo;
protected String currentNextPageUrl;
protected Page currentNextPage;
protected Disposable currentWorker;
@Override
protected void initViews(View rootView, Bundle savedInstanceState) {
protected void initViews(final View rootView, final Bundle savedInstanceState) {
super.initViews(rootView, savedInstanceState);
setTitle(name);
showListFooter(hasMoreItems());
@@ -43,7 +44,9 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
@Override
public void onPause() {
super.onPause();
if (currentWorker != null) currentWorker.dispose();
if (currentWorker != null) {
currentWorker.dispose();
}
}
@Override
@@ -73,18 +76,18 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
//////////////////////////////////////////////////////////////////////////*/
@Override
public void writeTo(Queue<Object> objectsToSave) {
public void writeTo(final Queue<Object> objectsToSave) {
super.writeTo(objectsToSave);
objectsToSave.add(currentInfo);
objectsToSave.add(currentNextPageUrl);
objectsToSave.add(currentNextPage);
}
@Override
@SuppressWarnings("unchecked")
public void readFrom(@NonNull Queue<Object> savedObjects) throws Exception {
public void readFrom(@NonNull final Queue<Object> savedObjects) throws Exception {
super.readFrom(savedObjects);
currentInfo = (I) savedObjects.poll();
currentNextPageUrl = (String) savedObjects.poll();
currentNextPage = (Page) savedObjects.poll();
}
/*//////////////////////////////////////////////////////////////////////////
@@ -92,10 +95,14 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
//////////////////////////////////////////////////////////////////////////*/
protected void doInitialLoadLogic() {
if (DEBUG) Log.d(TAG, "doInitialLoadLogic() called");
if (DEBUG) {
Log.d(TAG, "doInitialLoadLogic() called");
}
if (currentInfo == null) {
startLoading(false);
} else handleResult(currentInfo);
} else {
handleResult(currentInfo);
}
}
/**
@@ -103,55 +110,79 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
* You can use the default implementations from {@link org.schabi.newpipe.util.ExtractorHelper}.
*
* @param forceLoad allow or disallow the result to come from the cache
* @return Rx {@link Single} containing the {@link ListInfo}
*/
protected abstract Single<I> loadResult(boolean forceLoad);
@Override
public void startLoading(boolean forceLoad) {
public void startLoading(final boolean forceLoad) {
super.startLoading(forceLoad);
showListFooter(false);
infoListAdapter.clearStreamItemList();
currentInfo = null;
if (currentWorker != null) currentWorker.dispose();
if (currentWorker != null) {
currentWorker.dispose();
}
currentWorker = loadResult(forceLoad)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe((@NonNull I result) -> {
isLoading.set(false);
currentInfo = result;
currentNextPageUrl = result.getNextPageUrl();
currentNextPage = result.getNextPage();
handleResult(result);
}, (@NonNull Throwable throwable) -> onError(throwable));
}, this::onError);
}
/**
* Implement the logic to load more items<br/>
* You can use the default implementations from {@link org.schabi.newpipe.util.ExtractorHelper}
* Implement the logic to load more items.
* <p>You can use the default implementations
* from {@link org.schabi.newpipe.util.ExtractorHelper}.</p>
*
* @return Rx {@link Single} containing the {@link ListExtractor.InfoItemsPage}
*/
protected abstract Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic();
protected void loadMoreItems() {
isLoading.set(true);
if (currentWorker != null) currentWorker.dispose();
if (currentWorker != null) {
currentWorker.dispose();
}
forbidDownwardFocusScroll();
currentWorker = loadMoreItemsLogic()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe((@io.reactivex.annotations.NonNull ListExtractor.InfoItemsPage InfoItemsPage) -> {
.doFinally(this::allowDownwardFocusScroll)
.subscribe((@NonNull ListExtractor.InfoItemsPage InfoItemsPage) -> {
isLoading.set(false);
handleNextItems(InfoItemsPage);
}, (@io.reactivex.annotations.NonNull Throwable throwable) -> {
}, (@NonNull Throwable throwable) -> {
isLoading.set(false);
onError(throwable);
});
}
private void forbidDownwardFocusScroll() {
if (itemsList instanceof NewPipeRecyclerView) {
((NewPipeRecyclerView) itemsList).setFocusScrollAllowed(false);
}
}
private void allowDownwardFocusScroll() {
if (itemsList instanceof NewPipeRecyclerView) {
((NewPipeRecyclerView) itemsList).setFocusScrollAllowed(true);
}
}
@Override
public void handleNextItems(ListExtractor.InfoItemsPage result) {
public void handleNextItems(final ListExtractor.InfoItemsPage result) {
super.handleNextItems(result);
currentNextPageUrl = result.getNextPageUrl();
currentNextPage = result.getNextPage();
infoListAdapter.addInfoItemList(result.getItems());
showListFooter(hasMoreItems());
@@ -159,7 +190,7 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
@Override
protected boolean hasMoreItems() {
return !TextUtils.isEmpty(currentNextPageUrl);
return Page.isValid(currentNextPage);
}
/*//////////////////////////////////////////////////////////////////////////
@@ -167,13 +198,13 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
//////////////////////////////////////////////////////////////////////////*/
@Override
public void handleResult(@NonNull I result) {
public void handleResult(@NonNull final I result) {
super.handleResult(result);
name = result.getName();
setTitle(name);
if (infoListAdapter.getItemsList().size() == 0) {
if (infoListAdapter.getItemsList().isEmpty()) {
if (result.getRelatedItems().size() > 0) {
infoListAdapter.addInfoItemList(result.getRelatedItems());
showListFooter(hasMoreItems());
@@ -188,9 +219,9 @@ public abstract class BaseListInfoFragment<I extends ListInfo>
// Utils
//////////////////////////////////////////////////////////////////////////*/
protected void setInitialData(int serviceId, String url, String name) {
this.serviceId = serviceId;
this.url = url;
this.name = !TextUtils.isEmpty(name) ? name : "";
protected void setInitialData(final int sid, final String u, final String title) {
this.serviceId = sid;
this.url = u;
this.name = !TextUtils.isEmpty(title) ? title : "";
}
}

View File

@@ -4,12 +4,9 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.ActionBar;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@@ -21,7 +18,13 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.jakewharton.rxbinding2.view.RxView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import com.jakewharton.rxbinding4.view.RxView;
import org.schabi.newpipe.R;
import org.schabi.newpipe.database.subscription.SubscriptionEntity;
@@ -29,13 +32,14 @@ import org.schabi.newpipe.extractor.InfoItem;
import org.schabi.newpipe.extractor.ListExtractor;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.channel.ChannelInfo;
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
import org.schabi.newpipe.extractor.exceptions.ContentNotSupportedException;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.fragments.list.BaseListInfoFragment;
import org.schabi.newpipe.local.subscription.SubscriptionManager;
import org.schabi.newpipe.player.playqueue.ChannelPlayQueue;
import org.schabi.newpipe.player.playqueue.PlayQueue;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.AnimationUtils;
import org.schabi.newpipe.util.ExtractorHelper;
@@ -43,61 +47,63 @@ import org.schabi.newpipe.util.ImageDisplayConstants;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ShareUtils;
import org.schabi.newpipe.util.ThemeHelper;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.Single;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Action;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
import io.reactivex.rxjava3.disposables.Disposable;
import io.reactivex.rxjava3.functions.Action;
import io.reactivex.rxjava3.functions.Consumer;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.schedulers.Schedulers;
import static org.schabi.newpipe.util.AnimationUtils.animateBackgroundColor;
import static org.schabi.newpipe.util.AnimationUtils.animateTextColor;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
public class ChannelFragment extends BaseListInfoFragment<ChannelInfo>
implements View.OnClickListener {
private static final int BUTTON_DEBOUNCE_INTERVAL = 100;
private final CompositeDisposable disposables = new CompositeDisposable();
private Disposable subscribeButtonMonitor;
private SubscriptionManager subscriptionManager;
/*//////////////////////////////////////////////////////////////////////////
// Views
//////////////////////////////////////////////////////////////////////////*/
private SubscriptionManager subscriptionManager;
private View headerRootLayout;
private ImageView headerChannelBanner;
private ImageView headerAvatarView;
private TextView headerTitleView;
private ImageView headerSubChannelAvatarView;
private TextView headerSubChannelTitleView;
private TextView headerSubscribersTextView;
private Button headerSubscribeButton;
private View playlistCtrl;
private LinearLayout headerPlayAllButton;
private LinearLayout headerPopupButton;
private LinearLayout headerBackgroundButton;
private MenuItem menuRssButton;
private TextView contentNotSupportedTextView;
private TextView kaomojiTextView;
private TextView noVideosTextView;
public static ChannelFragment getInstance(int serviceId, String url, String name) {
ChannelFragment instance = new ChannelFragment();
public static ChannelFragment getInstance(final int serviceId, final String url,
final String name) {
final ChannelFragment instance = new ChannelFragment();
instance.setInitialData(serviceId, url, name);
return instance;
}
/*//////////////////////////////////////////////////////////////////////////
// LifeCycle
//////////////////////////////////////////////////////////////////////////*/
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
public void setUserVisibleHint(final boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (activity != null
&& useAsFrontPage
@@ -106,22 +112,40 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
}
}
/*//////////////////////////////////////////////////////////////////////////
// LifeCycle
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onAttach(Context context) {
public void onAttach(final Context context) {
super.onAttach(context);
subscriptionManager = new SubscriptionManager(activity);
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
public View onCreateView(@NonNull final LayoutInflater inflater,
@Nullable final ViewGroup container,
@Nullable final Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_channel, container, false);
}
@Override
public void onViewCreated(final View rootView, final Bundle savedInstanceState) {
super.onViewCreated(rootView, savedInstanceState);
contentNotSupportedTextView = rootView.findViewById(R.id.error_content_not_supported);
kaomojiTextView = rootView.findViewById(R.id.channel_kaomoji);
noVideosTextView = rootView.findViewById(R.id.channel_no_videos);
}
@Override
public void onDestroy() {
super.onDestroy();
if (disposables != null) disposables.clear();
if (subscribeButtonMonitor != null) subscribeButtonMonitor.dispose();
if (disposables != null) {
disposables.clear();
}
if (subscribeButtonMonitor != null) {
subscribeButtonMonitor.dispose();
}
}
/*//////////////////////////////////////////////////////////////////////////
@@ -129,14 +153,18 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
//////////////////////////////////////////////////////////////////////////*/
protected View getListHeader() {
headerRootLayout = activity.getLayoutInflater().inflate(R.layout.channel_header, itemsList, false);
headerRootLayout = activity.getLayoutInflater()
.inflate(R.layout.channel_header, itemsList, false);
headerChannelBanner = headerRootLayout.findViewById(R.id.channel_banner_image);
headerAvatarView = headerRootLayout.findViewById(R.id.channel_avatar_view);
headerTitleView = headerRootLayout.findViewById(R.id.channel_title_view);
headerSubscribersTextView = headerRootLayout.findViewById(R.id.channel_subscriber_view);
headerSubscribeButton = headerRootLayout.findViewById(R.id.channel_subscribe_button);
playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control);
headerSubChannelAvatarView =
headerRootLayout.findViewById(R.id.sub_channel_avatar_view);
headerSubChannelTitleView =
headerRootLayout.findViewById(R.id.sub_channel_title_view);
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button);
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button);
@@ -145,21 +173,31 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
return headerRootLayout;
}
@Override
protected void initListeners() {
super.initListeners();
headerSubChannelTitleView.setOnClickListener(this);
headerSubChannelAvatarView.setOnClickListener(this);
}
/*//////////////////////////////////////////////////////////////////////////
// Menu
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
ActionBar supportActionBar = activity.getSupportActionBar();
final ActionBar supportActionBar = activity.getSupportActionBar();
if (useAsFrontPage && supportActionBar != null) {
supportActionBar.setDisplayHomeAsUpEnabled(false);
} else {
inflater.inflate(R.menu.menu_channel, menu);
if (DEBUG) Log.d(TAG, "onCreateOptionsMenu() called with: menu = [" + menu +
"], inflater = [" + inflater + "]");
if (DEBUG) {
Log.d(TAG, "onCreateOptionsMenu() called with: "
+ "menu = [" + menu + "], inflater = [" + inflater + "]");
}
menuRssButton = menu.findItem(R.id.menu_item_rss);
}
}
@@ -167,13 +205,13 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
private void openRssFeed() {
final ChannelInfo info = currentInfo;
if (info != null) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(info.getFeedUrl()));
final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(info.getFeedUrl()));
startActivity(intent);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case R.id.action_settings:
NavigationHelper.openSettings(requireContext());
@@ -201,18 +239,16 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
// Channel Subscription
//////////////////////////////////////////////////////////////////////////*/
private static final int BUTTON_DEBOUNCE_INTERVAL = 100;
private void monitorSubscription(final ChannelInfo info) {
final Consumer<Throwable> onError = (Throwable throwable) -> {
animateView(headerSubscribeButton, false, 100);
showSnackBarError(throwable, UserAction.SUBSCRIPTION,
NewPipe.getNameOfService(currentInfo.getServiceId()),
"Get subscription status",
0);
animateView(headerSubscribeButton, false, 100);
showSnackBarError(throwable, UserAction.SUBSCRIPTION,
NewPipe.getNameOfService(currentInfo.getServiceId()),
"Get subscription status", 0);
};
final Observable<List<SubscriptionEntity>> observable = subscriptionManager.subscriptionTable()
final Observable<List<SubscriptionEntity>> observable = subscriptionManager
.subscriptionTable()
.getSubscriptionFlowable(info.getServiceId(), info.getUrl())
.toObservable();
@@ -221,17 +257,19 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
.subscribe(getSubscribeUpdateMonitor(info), onError));
disposables.add(observable
// Some updates are very rapid (when calling the updateSubscription(info), for example)
// so only update the UI for the latest emission ("sync" the subscribe button's state)
// Some updates are very rapid
// (for example when calling the updateSubscription(info))
// so only update the UI for the latest emission
// ("sync" the subscribe button's state)
.debounce(100, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe((List<SubscriptionEntity> subscriptionEntities) ->
updateSubscribeButton(!subscriptionEntities.isEmpty())
, onError));
updateSubscribeButton(!subscriptionEntities.isEmpty()), onError));
}
private Function<Object, Object> mapOnSubscribe(final SubscriptionEntity subscription, ChannelInfo info) {
private Function<Object, Object> mapOnSubscribe(final SubscriptionEntity subscription,
final ChannelInfo info) {
return (@NonNull Object o) -> {
subscriptionManager.insertSubscription(subscription, info);
return o;
@@ -246,9 +284,13 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
}
private void updateSubscription(final ChannelInfo info) {
if (DEBUG) Log.d(TAG, "updateSubscription() called with: info = [" + info + "]");
if (DEBUG) {
Log.d(TAG, "updateSubscription() called with: info = [" + info + "]");
}
final Action onComplete = () -> {
if (DEBUG) Log.d(TAG, "Updated subscription: " + info.getUrl());
if (DEBUG) {
Log.d(TAG, "Updated subscription: " + info.getUrl());
}
};
final Consumer<Throwable> onError = (@NonNull Throwable throwable) ->
@@ -264,9 +306,12 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
.subscribe(onComplete, onError));
}
private Disposable monitorSubscribeButton(final Button subscribeButton, final Function<Object, Object> action) {
private Disposable monitorSubscribeButton(final Button subscribeButton,
final Function<Object, Object> action) {
final Consumer<Object> onNext = (@NonNull Object o) -> {
if (DEBUG) Log.d(TAG, "Changed subscription status to this channel!");
if (DEBUG) {
Log.d(TAG, "Changed subscription status to this channel!");
}
};
final Consumer<Throwable> onError = (@NonNull Throwable throwable) ->
@@ -287,47 +332,64 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
private Consumer<List<SubscriptionEntity>> getSubscribeUpdateMonitor(final ChannelInfo info) {
return (List<SubscriptionEntity> subscriptionEntities) -> {
if (DEBUG)
Log.d(TAG, "subscriptionManager.subscriptionTable.doOnNext() called with: subscriptionEntities = [" + subscriptionEntities + "]");
if (subscribeButtonMonitor != null) subscribeButtonMonitor.dispose();
if (DEBUG) {
Log.d(TAG, "subscriptionManager.subscriptionTable.doOnNext() called with: "
+ "subscriptionEntities = [" + subscriptionEntities + "]");
}
if (subscribeButtonMonitor != null) {
subscribeButtonMonitor.dispose();
}
if (subscriptionEntities.isEmpty()) {
if (DEBUG) Log.d(TAG, "No subscription to this channel!");
SubscriptionEntity channel = new SubscriptionEntity();
if (DEBUG) {
Log.d(TAG, "No subscription to this channel!");
}
final SubscriptionEntity channel = new SubscriptionEntity();
channel.setServiceId(info.getServiceId());
channel.setUrl(info.getUrl());
channel.setData(info.getName(),
info.getAvatarUrl(),
info.getDescription(),
info.getSubscriberCount());
subscribeButtonMonitor = monitorSubscribeButton(headerSubscribeButton, mapOnSubscribe(channel, info));
subscribeButtonMonitor = monitorSubscribeButton(headerSubscribeButton,
mapOnSubscribe(channel, info));
} else {
if (DEBUG) Log.d(TAG, "Found subscription to this channel!");
if (DEBUG) {
Log.d(TAG, "Found subscription to this channel!");
}
final SubscriptionEntity subscription = subscriptionEntities.get(0);
subscribeButtonMonitor = monitorSubscribeButton(headerSubscribeButton, mapOnUnsubscribe(subscription));
subscribeButtonMonitor = monitorSubscribeButton(headerSubscribeButton,
mapOnUnsubscribe(subscription));
}
};
}
private void updateSubscribeButton(boolean isSubscribed) {
if (DEBUG) Log.d(TAG, "updateSubscribeButton() called with: isSubscribed = [" + isSubscribed + "]");
private void updateSubscribeButton(final boolean isSubscribed) {
if (DEBUG) {
Log.d(TAG, "updateSubscribeButton() called with: "
+ "isSubscribed = [" + isSubscribed + "]");
}
boolean isButtonVisible = headerSubscribeButton.getVisibility() == View.VISIBLE;
int backgroundDuration = isButtonVisible ? 300 : 0;
int textDuration = isButtonVisible ? 200 : 0;
final boolean isButtonVisible = headerSubscribeButton.getVisibility() == View.VISIBLE;
final int backgroundDuration = isButtonVisible ? 300 : 0;
final int textDuration = isButtonVisible ? 200 : 0;
int subscribeBackground = ContextCompat.getColor(activity, R.color.subscribe_background_color);
int subscribeText = ContextCompat.getColor(activity, R.color.subscribe_text_color);
int subscribedBackground = ContextCompat.getColor(activity, R.color.subscribed_background_color);
int subscribedText = ContextCompat.getColor(activity, R.color.subscribed_text_color);
final int subscribeBackground = ThemeHelper
.resolveColorFromAttr(activity, R.attr.colorPrimary);
final int subscribeText = ContextCompat.getColor(activity, R.color.subscribe_text_color);
final int subscribedBackground = ContextCompat
.getColor(activity, R.color.subscribed_background_color);
final int subscribedText = ContextCompat.getColor(activity, R.color.subscribed_text_color);
if (!isSubscribed) {
headerSubscribeButton.setText(R.string.subscribe_button_title);
animateBackgroundColor(headerSubscribeButton, backgroundDuration, subscribedBackground, subscribeBackground);
animateBackgroundColor(headerSubscribeButton, backgroundDuration, subscribedBackground,
subscribeBackground);
animateTextColor(headerSubscribeButton, textDuration, subscribedText, subscribeText);
} else {
headerSubscribeButton.setText(R.string.subscribed_button_title);
animateBackgroundColor(headerSubscribeButton, backgroundDuration, subscribeBackground, subscribedBackground);
animateBackgroundColor(headerSubscribeButton, backgroundDuration, subscribeBackground,
subscribedBackground);
animateTextColor(headerSubscribeButton, textDuration, subscribeText, subscribedText);
}
@@ -340,14 +402,42 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
@Override
protected Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
return ExtractorHelper.getMoreChannelItems(serviceId, url, currentNextPageUrl);
return ExtractorHelper.getMoreChannelItems(serviceId, url, currentNextPage);
}
@Override
protected Single<ChannelInfo> loadResult(boolean forceLoad) {
protected Single<ChannelInfo> loadResult(final boolean forceLoad) {
return ExtractorHelper.getChannelInfo(serviceId, url, forceLoad);
}
/*//////////////////////////////////////////////////////////////////////////
// OnClick
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onClick(final View v) {
if (isLoading.get() || currentInfo == null) {
return;
}
switch (v.getId()) {
case R.id.sub_channel_avatar_view:
case R.id.sub_channel_title_view:
if (!TextUtils.isEmpty(currentInfo.getParentChannelUrl())) {
try {
NavigationHelper.openChannelFragment(getFM(), currentInfo.getServiceId(),
currentInfo.getParentChannelUrl(),
currentInfo.getParentChannelName());
} catch (final Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
}
} else if (DEBUG) {
Log.i(TAG, "Can't open parent channel because we got no channel URL");
}
break;
}
}
/*//////////////////////////////////////////////////////////////////////////
// Contract
//////////////////////////////////////////////////////////////////////////*/
@@ -356,47 +446,99 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
public void showLoading() {
super.showLoading();
imageLoader.cancelDisplayTask(headerChannelBanner);
imageLoader.cancelDisplayTask(headerAvatarView);
IMAGE_LOADER.cancelDisplayTask(headerChannelBanner);
IMAGE_LOADER.cancelDisplayTask(headerAvatarView);
IMAGE_LOADER.cancelDisplayTask(headerSubChannelAvatarView);
animateView(headerSubscribeButton, false, 100);
}
@Override
public void handleResult(@NonNull ChannelInfo result) {
public void handleResult(@NonNull final ChannelInfo result) {
super.handleResult(result);
headerRootLayout.setVisibility(View.VISIBLE);
imageLoader.displayImage(result.getBannerUrl(), headerChannelBanner,
IMAGE_LOADER.displayImage(result.getBannerUrl(), headerChannelBanner,
ImageDisplayConstants.DISPLAY_BANNER_OPTIONS);
imageLoader.displayImage(result.getAvatarUrl(), headerAvatarView,
IMAGE_LOADER.displayImage(result.getAvatarUrl(), headerAvatarView,
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
IMAGE_LOADER.displayImage(result.getParentChannelAvatarUrl(), headerSubChannelAvatarView,
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
headerSubscribersTextView.setVisibility(View.VISIBLE);
if (result.getSubscriberCount() >= 0) {
headerSubscribersTextView.setText(Localization.shortSubscriberCount(activity, result.getSubscriberCount()));
headerSubscribersTextView.setText(Localization
.shortSubscriberCount(activity, result.getSubscriberCount()));
} else {
headerSubscribersTextView.setText(R.string.subscribers_count_not_available);
}
if (menuRssButton != null) menuRssButton.setVisible(!TextUtils.isEmpty(result.getFeedUrl()));
if (!TextUtils.isEmpty(currentInfo.getParentChannelName())) {
headerSubChannelTitleView.setText(String.format(
getString(R.string.channel_created_by),
currentInfo.getParentChannelName())
);
headerSubChannelTitleView.setVisibility(View.VISIBLE);
headerSubChannelAvatarView.setVisibility(View.VISIBLE);
} else {
headerSubChannelTitleView.setVisibility(View.GONE);
}
if (menuRssButton != null) {
menuRssButton.setVisible(!TextUtils.isEmpty(result.getFeedUrl()));
}
playlistCtrl.setVisibility(View.VISIBLE);
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(), UserAction.REQUESTED_CHANNEL, NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);
final List<Throwable> errors = new ArrayList<>(result.getErrors());
if (!errors.isEmpty()) {
// handling ContentNotSupportedException not to show the error but an appropriate string
// so that crashes won't be sent uselessly and the user will understand what happened
errors.removeIf(throwable -> {
if (throwable instanceof ContentNotSupportedException) {
showContentNotSupported();
}
return throwable instanceof ContentNotSupportedException;
});
if (!errors.isEmpty()) {
showSnackBarError(errors, UserAction.REQUESTED_CHANNEL,
NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);
}
}
if (disposables != null) disposables.clear();
if (subscribeButtonMonitor != null) subscribeButtonMonitor.dispose();
if (disposables != null) {
disposables.clear();
}
if (subscribeButtonMonitor != null) {
subscribeButtonMonitor.dispose();
}
updateSubscription(result);
monitorSubscription(result);
headerPlayAllButton.setOnClickListener(
view -> NavigationHelper.playOnMainPlayer(activity, getPlayQueue(), false));
headerPopupButton.setOnClickListener(
view -> NavigationHelper.playOnPopupPlayer(activity, getPlayQueue(), false));
headerBackgroundButton.setOnClickListener(
view -> NavigationHelper.playOnBackgroundPlayer(activity, getPlayQueue(), false));
headerPlayAllButton.setOnClickListener(view -> NavigationHelper
.playOnMainPlayer(activity, getPlayQueue()));
headerPopupButton.setOnClickListener(view -> NavigationHelper
.playOnPopupPlayer(activity, getPlayQueue(), false));
headerBackgroundButton.setOnClickListener(view -> NavigationHelper
.playOnBackgroundPlayer(activity, getPlayQueue(), false));
headerPopupButton.setOnLongClickListener(view -> {
NavigationHelper.enqueueOnPopupPlayer(activity, getPlayQueue(), true);
return true;
});
headerBackgroundButton.setOnLongClickListener(view -> {
NavigationHelper.enqueueOnBackgroundPlayer(activity, getPlayQueue(), true);
return true;
});
}
private void showContentNotSupported() {
contentNotSupportedTextView.setVisibility(View.VISIBLE);
kaomojiTextView.setText("(︶︹︺)");
kaomojiTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 45f);
noVideosTextView.setVisibility(View.GONE);
}
private PlayQueue getPlayQueue() {
@@ -405,22 +547,17 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
private PlayQueue getPlayQueue(final int index) {
final List<StreamInfoItem> streamItems = new ArrayList<>();
for (InfoItem i : infoListAdapter.getItemsList()) {
for (final InfoItem i : infoListAdapter.getItemsList()) {
if (i instanceof StreamInfoItem) {
streamItems.add((StreamInfoItem) i);
}
}
return new ChannelPlayQueue(
currentInfo.getServiceId(),
currentInfo.getUrl(),
currentInfo.getNextPageUrl(),
streamItems,
index
);
return new ChannelPlayQueue(currentInfo.getServiceId(), currentInfo.getUrl(),
currentInfo.getNextPage(), streamItems, index);
}
@Override
public void handleNextItems(ListExtractor.InfoItemsPage result) {
public void handleNextItems(final ListExtractor.InfoItemsPage result) {
super.handleNextItems(result);
if (!result.getErrors().isEmpty()) {
@@ -437,10 +574,12 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
//////////////////////////////////////////////////////////////////////////*/
@Override
protected boolean onError(Throwable exception) {
if (super.onError(exception)) return true;
protected boolean onError(final Throwable exception) {
if (super.onError(exception)) {
return true;
}
int errorId = exception instanceof ExtractionException
final int errorId = exception instanceof ExtractionException
? R.string.parsing_error : R.string.general_error;
onUnrecoverableError(exception, UserAction.REQUESTED_CHANNEL,
@@ -454,8 +593,10 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
//////////////////////////////////////////////////////////////////////////*/
@Override
public void setTitle(String title) {
public void setTitle(final String title) {
super.setTitle(title);
if (!useAsFrontPage) headerTitleView.setText(title);
if (!useAsFrontPage) {
headerTitleView.setText(title);
}
}
}

View File

@@ -2,14 +2,15 @@ package org.schabi.newpipe.fragments.list.comments;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.ListExtractor;
import org.schabi.newpipe.extractor.NewPipe;
@@ -19,22 +20,15 @@ import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.AnimationUtils;
import org.schabi.newpipe.util.ExtractorHelper;
import io.reactivex.Single;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> {
private final CompositeDisposable disposables = new CompositeDisposable();
private CompositeDisposable disposables = new CompositeDisposable();
/*//////////////////////////////////////////////////////////////////////////
// Views
//////////////////////////////////////////////////////////////////////////*/
private boolean mIsVisibleToUser = false;
public static CommentsFragment getInstance(int serviceId, String url, String name) {
CommentsFragment instance = new CommentsFragment();
public static CommentsFragment getInstance(final int serviceId, final String url,
final String name) {
final CommentsFragment instance = new CommentsFragment();
instance.setInitialData(serviceId, url, name);
return instance;
}
@@ -44,39 +38,36 @@ public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> {
//////////////////////////////////////////////////////////////////////////*/
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
mIsVisibleToUser = isVisibleToUser;
}
@Override
public void onAttach(Context context) {
public void onAttach(final Context context) {
super.onAttach(context);
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
public View onCreateView(@NonNull final LayoutInflater inflater,
@Nullable final ViewGroup container,
@Nullable final Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_comments, container, false);
}
@Override
public void onDestroy() {
super.onDestroy();
if (disposables != null) disposables.clear();
if (disposables != null) {
disposables.clear();
}
}
/*//////////////////////////////////////////////////////////////////////////
// Load and handle
//////////////////////////////////////////////////////////////////////////*/
@Override
protected Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
return ExtractorHelper.getMoreCommentItems(serviceId, currentInfo, currentNextPageUrl);
return ExtractorHelper.getMoreCommentItems(serviceId, currentInfo, currentNextPage);
}
@Override
protected Single<CommentsInfo> loadResult(boolean forceLoad) {
protected Single<CommentsInfo> loadResult(final boolean forceLoad) {
return ExtractorHelper.getCommentsInfo(serviceId, url, forceLoad);
}
@@ -90,27 +81,28 @@ public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> {
}
@Override
public void handleResult(@NonNull CommentsInfo result) {
public void handleResult(@NonNull final CommentsInfo result) {
super.handleResult(result);
AnimationUtils.slideUp(getView(),120, 150, 0.06f);
AnimationUtils.slideUp(requireView(), 120, 150, 0.06f);
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(), UserAction.REQUESTED_COMMENTS, NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);
showSnackBarError(result.getErrors(), UserAction.REQUESTED_COMMENTS,
NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);
}
if (disposables != null) disposables.clear();
if (disposables != null) {
disposables.clear();
}
}
@Override
public void handleNextItems(ListExtractor.InfoItemsPage result) {
public void handleNextItems(final ListExtractor.InfoItemsPage result) {
super.handleNextItems(result);
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(),
UserAction.REQUESTED_COMMENTS,
NewPipe.getNameOfService(serviceId),
"Get next page of: " + url,
showSnackBarError(result.getErrors(), UserAction.REQUESTED_COMMENTS,
NewPipe.getNameOfService(serviceId), "Get next page of: " + url,
R.string.general_error);
}
}
@@ -120,11 +112,14 @@ public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> {
//////////////////////////////////////////////////////////////////////////*/
@Override
protected boolean onError(Throwable exception) {
if (super.onError(exception)) return true;
protected boolean onError(final Throwable exception) {
if (super.onError(exception)) {
return true;
}
hideLoading();
showSnackBarError(exception, UserAction.REQUESTED_COMMENTS, NewPipe.getNameOfService(serviceId), url, R.string.error_unable_to_load_comments);
showSnackBarError(exception, UserAction.REQUESTED_COMMENTS,
NewPipe.getNameOfService(serviceId), url, R.string.error_unable_to_load_comments);
return true;
}
@@ -133,14 +128,10 @@ public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> {
//////////////////////////////////////////////////////////////////////////*/
@Override
public void setTitle(String title) {
return;
}
public void setTitle(final String title) { }
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
return;
}
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) { }
@Override
protected boolean isGridLayout() {

View File

@@ -10,9 +10,8 @@ import org.schabi.newpipe.util.KioskTranslator;
import org.schabi.newpipe.util.ServiceHelper;
public class DefaultKioskFragment extends KioskFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (serviceId < 0) {
@@ -25,7 +24,9 @@ public class DefaultKioskFragment extends KioskFragment {
super.onResume();
if (serviceId != ServiceHelper.getSelectedServiceId(requireContext())) {
if (currentWorker != null) currentWorker.dispose();
if (currentWorker != null) {
currentWorker.dispose();
}
updateSelectedDefaultKiosk();
reloadContent();
}
@@ -43,9 +44,10 @@ public class DefaultKioskFragment extends KioskFragment {
name = kioskTranslatedName;
currentInfo = null;
currentNextPageUrl = null;
} catch (ExtractionException e) {
onUnrecoverableError(e, UserAction.REQUESTED_KIOSK, "none", "Loading default kiosk from selected service", 0);
currentNextPage = null;
} catch (final ExtractionException e) {
onUnrecoverableError(e, UserAction.REQUESTED_KIOSK, "none",
"Loading default kiosk from selected service", 0);
}
}
}

View File

@@ -1,17 +1,16 @@
package org.schabi.newpipe.fragments.list.kiosk;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.ListExtractor;
import org.schabi.newpipe.extractor.NewPipe;
@@ -27,55 +26,55 @@ import org.schabi.newpipe.util.KioskTranslator;
import org.schabi.newpipe.util.Localization;
import icepick.State;
import io.reactivex.Single;
import io.reactivex.rxjava3.core.Single;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
/**
* Created by Christian Schabesberger on 23.09.17.
*
* <p>
* Copyright (C) Christian Schabesberger 2017 <chris.schabesberger@mailbox.org>
* KioskFragment.java is part of NewPipe.
*
* </p>
* <p>
* NewPipe is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* </p>
* <p>
* NewPipe is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* </p>
* <p>
* You should have received a copy of the GNU General Public License
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
* </p>
*/
public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
@State
protected String kioskId = "";
protected String kioskTranslatedName;
String kioskId = "";
String kioskTranslatedName;
@State
protected ContentCountry contentCountry;
ContentCountry contentCountry;
/*//////////////////////////////////////////////////////////////////////////
// Views
//////////////////////////////////////////////////////////////////////////*/
public static KioskFragment getInstance(int serviceId)
throws ExtractionException {
public static KioskFragment getInstance(final int serviceId) throws ExtractionException {
return getInstance(serviceId, NewPipe.getService(serviceId)
.getKioskList()
.getDefaultKioskId());
.getKioskList().getDefaultKioskId());
}
public static KioskFragment getInstance(int serviceId, String kioskId)
public static KioskFragment getInstance(final int serviceId, final String kioskId)
throws ExtractionException {
KioskFragment instance = new KioskFragment();
StreamingService service = NewPipe.getService(serviceId);
ListLinkHandlerFactory kioskLinkHandlerFactory = service.getKioskList()
final KioskFragment instance = new KioskFragment();
final StreamingService service = NewPipe.getService(serviceId);
final ListLinkHandlerFactory kioskLinkHandlerFactory = service.getKioskList()
.getListLinkHandlerFactoryByType(kioskId);
instance.setInitialData(serviceId,
kioskLinkHandlerFactory.fromId(kioskId).getUrl(), kioskId);
@@ -88,7 +87,7 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onCreate(Bundle savedInstanceState) {
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
kioskTranslatedName = KioskTranslator.getTranslatedKioskName(kioskId, activity);
@@ -97,12 +96,12 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
}
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
public void setUserVisibleHint(final boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if(useAsFrontPage && isVisibleToUser && activity != null) {
if (useAsFrontPage && isVisibleToUser && activity != null) {
try {
setTitle(kioskTranslatedName);
} catch (Exception e) {
} catch (final Exception e) {
onUnrecoverableError(e, UserAction.UI_ERROR,
"none",
"none", R.string.app_ui_crash);
@@ -111,7 +110,9 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
public View onCreateView(@NonNull final LayoutInflater inflater,
@Nullable final ViewGroup container,
@Nullable final Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_kiosk, container, false);
}
@@ -129,9 +130,9 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
ActionBar supportActionBar = activity.getSupportActionBar();
final ActionBar supportActionBar = activity.getSupportActionBar();
if (supportActionBar != null && useAsFrontPage) {
supportActionBar.setDisplayHomeAsUpEnabled(false);
}
@@ -142,18 +143,14 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
//////////////////////////////////////////////////////////////////////////*/
@Override
public Single<KioskInfo> loadResult(boolean forceReload) {
public Single<KioskInfo> loadResult(final boolean forceReload) {
contentCountry = Localization.getPreferredContentCountry(requireContext());
return ExtractorHelper.getKioskInfo(serviceId,
url,
forceReload);
return ExtractorHelper.getKioskInfo(serviceId, url, forceReload);
}
@Override
public Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
return ExtractorHelper.getMoreKioskItems(serviceId,
url,
currentNextPageUrl);
return ExtractorHelper.getMoreKioskItems(serviceId, url, currentNextPage);
}
/*//////////////////////////////////////////////////////////////////////////
@@ -181,13 +178,13 @@ public class KioskFragment extends BaseListInfoFragment<KioskInfo> {
}
@Override
public void handleNextItems(ListExtractor.InfoItemsPage result) {
public void handleNextItems(final ListExtractor.InfoItemsPage result) {
super.handleNextItems(result);
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(),
UserAction.REQUESTED_PLAYLIST, NewPipe.getNameOfService(serviceId)
, "Get next page of: " + url, 0);
UserAction.REQUESTED_PLAYLIST, NewPipe.getNameOfService(serviceId),
"Get next page of: " + url, 0);
}
}
}

View File

@@ -3,9 +3,6 @@ package org.schabi.newpipe.fragments.list.playlist;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
@@ -17,6 +14,10 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import org.schabi.newpipe.NewPipeDatabase;
@@ -32,32 +33,33 @@ import org.schabi.newpipe.extractor.stream.StreamType;
import org.schabi.newpipe.fragments.list.BaseListInfoFragment;
import org.schabi.newpipe.info_list.InfoItemDialog;
import org.schabi.newpipe.local.playlist.RemotePlaylistManager;
import org.schabi.newpipe.player.helper.PlayerHolder;
import org.schabi.newpipe.player.playqueue.PlayQueue;
import org.schabi.newpipe.player.playqueue.PlaylistPlayQueue;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.ImageDisplayConstants;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ShareUtils;
import org.schabi.newpipe.util.StreamDialogEntry;
import org.schabi.newpipe.util.ThemeHelper;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;
import io.reactivex.disposables.Disposables;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
import io.reactivex.rxjava3.disposables.Disposable;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
private CompositeDisposable disposables;
private Subscription bookmarkReactor;
private AtomicBoolean isBookmarkButtonReady;
@@ -82,8 +84,9 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
private MenuItem playlistBookmarkButton;
public static PlaylistFragment getInstance(int serviceId, String url, String name) {
PlaylistFragment instance = new PlaylistFragment();
public static PlaylistFragment getInstance(final int serviceId, final String url,
final String name) {
final PlaylistFragment instance = new PlaylistFragment();
instance.setInitialData(serviceId, url, name);
return instance;
}
@@ -93,17 +96,18 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onCreate(Bundle savedInstanceState) {
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
disposables = new CompositeDisposable();
isBookmarkButtonReady = new AtomicBoolean(false);
remotePlaylistManager = new RemotePlaylistManager(NewPipeDatabase.getInstance(
requireContext()));
remotePlaylistManager = new RemotePlaylistManager(NewPipeDatabase
.getInstance(requireContext()));
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
public View onCreateView(@NonNull final LayoutInflater inflater,
@Nullable final ViewGroup container,
@Nullable final Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_playlist, container, false);
}
@@ -112,7 +116,8 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
//////////////////////////////////////////////////////////////////////////*/
protected View getListHeader() {
headerRootLayout = activity.getLayoutInflater().inflate(R.layout.playlist_header, itemsList, false);
headerRootLayout = activity.getLayoutInflater()
.inflate(R.layout.playlist_header, itemsList, false);
headerTitleView = headerRootLayout.findViewById(R.id.playlist_title_view);
headerUploaderLayout = headerRootLayout.findViewById(R.id.uploader_layout);
headerUploaderName = headerRootLayout.findViewById(R.id.uploader_name);
@@ -129,52 +134,59 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
}
@Override
protected void initViews(View rootView, Bundle savedInstanceState) {
protected void initViews(final View rootView, final Bundle savedInstanceState) {
super.initViews(rootView, savedInstanceState);
infoListAdapter.useMiniItemVariants(true);
infoListAdapter.setUseMiniVariant(true);
}
private PlayQueue getPlayQueueStartingAt(StreamInfoItem infoItem) {
private PlayQueue getPlayQueueStartingAt(final StreamInfoItem infoItem) {
return getPlayQueue(Math.max(infoListAdapter.getItemsList().indexOf(infoItem), 0));
}
@Override
protected void showStreamDialog(StreamInfoItem item) {
protected void showStreamDialog(final StreamInfoItem item) {
final Context context = getContext();
final Activity activity = getActivity();
if (context == null || context.getResources() == null || activity == null) return;
if (context == null || context.getResources() == null || activity == null) {
return;
}
final ArrayList<StreamDialogEntry> entries = new ArrayList<>();
if (PlayerHolder.getType() != null) {
entries.add(StreamDialogEntry.enqueue);
}
if (item.getStreamType() == StreamType.AUDIO_STREAM) {
StreamDialogEntry.setEnabledEntries(
StreamDialogEntry.enqueue_on_background,
entries.addAll(Arrays.asList(
StreamDialogEntry.start_here_on_background,
StreamDialogEntry.append_playlist,
StreamDialogEntry.share);
} else {
StreamDialogEntry.setEnabledEntries(
StreamDialogEntry.enqueue_on_background,
StreamDialogEntry.enqueue_on_popup,
StreamDialogEntry.share
));
} else {
entries.addAll(Arrays.asList(
StreamDialogEntry.start_here_on_background,
StreamDialogEntry.start_here_on_popup,
StreamDialogEntry.append_playlist,
StreamDialogEntry.share);
StreamDialogEntry.start_here_on_popup.setCustomAction(
(fragment, infoItem) -> NavigationHelper.playOnPopupPlayer(context, getPlayQueueStartingAt(infoItem), true));
StreamDialogEntry.share
));
}
StreamDialogEntry.setEnabledEntries(entries);
StreamDialogEntry.start_here_on_background.setCustomAction(
(fragment, infoItem) -> NavigationHelper.playOnBackgroundPlayer(context, getPlayQueueStartingAt(infoItem), true));
StreamDialogEntry.start_here_on_background.setCustomAction((fragment, infoItem) ->
NavigationHelper.playOnBackgroundPlayer(context,
getPlayQueueStartingAt(infoItem), true));
new InfoItemDialog(activity, item, StreamDialogEntry.getCommands(context), (dialog, which) ->
StreamDialogEntry.clickOn(which, this, item)).show();
new InfoItemDialog(activity, item, StreamDialogEntry.getCommands(context),
(dialog, which) -> StreamDialogEntry.clickOn(which, this, item)).show();
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
if (DEBUG) Log.d(TAG, "onCreateOptionsMenu() called with: menu = [" + menu +
"], inflater = [" + inflater + "]");
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
if (DEBUG) {
Log.d(TAG, "onCreateOptionsMenu() called with: "
+ "menu = [" + menu + "], inflater = [" + inflater + "]");
}
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.menu_playlist, menu);
@@ -185,10 +197,16 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
@Override
public void onDestroyView() {
super.onDestroyView();
if (isBookmarkButtonReady != null) isBookmarkButtonReady.set(false);
if (isBookmarkButtonReady != null) {
isBookmarkButtonReady.set(false);
}
if (disposables != null) disposables.clear();
if (bookmarkReactor != null) bookmarkReactor.cancel();
if (disposables != null) {
disposables.clear();
}
if (bookmarkReactor != null) {
bookmarkReactor.cancel();
}
bookmarkReactor = null;
}
@@ -197,7 +215,9 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
public void onDestroy() {
super.onDestroy();
if (disposables != null) disposables.dispose();
if (disposables != null) {
disposables.dispose();
}
disposables = null;
remotePlaylistManager = null;
@@ -211,16 +231,16 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
@Override
protected Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
return ExtractorHelper.getMorePlaylistItems(serviceId, url, currentNextPageUrl);
return ExtractorHelper.getMorePlaylistItems(serviceId, url, currentNextPage);
}
@Override
protected Single<PlaylistInfo> loadResult(boolean forceLoad) {
protected Single<PlaylistInfo> loadResult(final boolean forceLoad) {
return ExtractorHelper.getPlaylistInfo(serviceId, url, forceLoad);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case R.id.action_settings:
NavigationHelper.openSettings(requireContext());
@@ -251,7 +271,7 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
animateView(headerRootLayout, false, 200);
animateView(itemsList, false, 100);
imageLoader.cancelDisplayTask(headerUploaderAvatar);
IMAGE_LOADER.cancelDisplayTask(headerUploaderAvatar);
animateView(headerUploaderLayout, false, 200);
}
@@ -262,33 +282,33 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
animateView(headerRootLayout, true, 100);
animateView(headerUploaderLayout, true, 300);
headerUploaderLayout.setOnClickListener(null);
if (!TextUtils.isEmpty(result.getUploaderName())) { // If we have an uploader : Put them into the ui
// If we have an uploader put them into the UI
if (!TextUtils.isEmpty(result.getUploaderName())) {
headerUploaderName.setText(result.getUploaderName());
if (!TextUtils.isEmpty(result.getUploaderUrl())) {
headerUploaderLayout.setOnClickListener(v -> {
try {
NavigationHelper.openChannelFragment(getFragmentManager(),
result.getServiceId(),
result.getUploaderUrl(),
result.getUploaderName());
} catch (Exception e) {
NavigationHelper.openChannelFragment(getFM(), result.getServiceId(),
result.getUploaderUrl(), result.getUploaderName());
} catch (final Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
}
});
}
} else { // Else : say we have no uploader
} else { // Otherwise say we have no uploader
headerUploaderName.setText(R.string.playlist_no_uploader);
}
playlistCtrl.setVisibility(View.VISIBLE);
imageLoader.displayImage(result.getUploaderAvatarUrl(), headerUploaderAvatar,
IMAGE_LOADER.displayImage(result.getUploaderAvatarUrl(), headerUploaderAvatar,
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
headerStreamCount.setText(getResources().getQuantityString(R.plurals.videos,
(int) result.getStreamCount(), (int) result.getStreamCount()));
headerStreamCount.setText(Localization
.localizeStreamCount(getContext(), result.getStreamCount()));
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(), UserAction.REQUESTED_PLAYLIST, NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);
showSnackBarError(result.getErrors(), UserAction.REQUESTED_PLAYLIST,
NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);
}
remotePlaylistManager.getPlaylist(result)
@@ -298,7 +318,7 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
.subscribe(getPlaylistBookmarkSubscriber());
headerPlayAllButton.setOnClickListener(view ->
NavigationHelper.playOnMainPlayer(activity, getPlayQueue(), false));
NavigationHelper.playOnMainPlayer(activity, getPlayQueue()));
headerPopupButton.setOnClickListener(view ->
NavigationHelper.playOnPopupPlayer(activity, getPlayQueue(), false));
headerBackgroundButton.setOnClickListener(view ->
@@ -321,27 +341,27 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
private PlayQueue getPlayQueue(final int index) {
final List<StreamInfoItem> infoItems = new ArrayList<>();
for(InfoItem i : infoListAdapter.getItemsList()) {
if(i instanceof StreamInfoItem) {
for (final InfoItem i : infoListAdapter.getItemsList()) {
if (i instanceof StreamInfoItem) {
infoItems.add((StreamInfoItem) i);
}
}
return new PlaylistPlayQueue(
currentInfo.getServiceId(),
currentInfo.getUrl(),
currentInfo.getNextPageUrl(),
currentInfo.getNextPage(),
infoItems,
index
);
}
@Override
public void handleNextItems(ListExtractor.InfoItemsPage result) {
public void handleNextItems(final ListExtractor.InfoItemsPage result) {
super.handleNextItems(result);
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(), UserAction.REQUESTED_PLAYLIST, NewPipe.getNameOfService(serviceId)
, "Get next page of: " + url, 0);
showSnackBarError(result.getErrors(), UserAction.REQUESTED_PLAYLIST,
NewPipe.getNameOfService(serviceId), "Get next page of: " + url, 0);
}
}
@@ -350,15 +370,15 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
//////////////////////////////////////////////////////////////////////////*/
@Override
protected boolean onError(Throwable exception) {
if (super.onError(exception)) return true;
protected boolean onError(final Throwable exception) {
if (super.onError(exception)) {
return true;
}
int errorId = exception instanceof ExtractionException ? R.string.parsing_error : R.string.general_error;
onUnrecoverableError(exception,
UserAction.REQUESTED_PLAYLIST,
NewPipe.getNameOfService(serviceId),
url,
errorId);
final int errorId = exception instanceof ExtractionException
? R.string.parsing_error : R.string.general_error;
onUnrecoverableError(exception, UserAction.REQUESTED_PLAYLIST,
NewPipe.getNameOfService(serviceId), url, errorId);
return true;
}
@@ -366,13 +386,18 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
// Utils
//////////////////////////////////////////////////////////////////////////*/
private Flowable<Integer> getUpdateProcessor(@NonNull List<PlaylistRemoteEntity> playlists,
@NonNull PlaylistInfo result) {
private Flowable<Integer> getUpdateProcessor(
@NonNull final List<PlaylistRemoteEntity> playlists,
@NonNull final PlaylistInfo result) {
final Flowable<Integer> noItemToUpdate = Flowable.just(/*noItemToUpdate=*/-1);
if (playlists.isEmpty()) return noItemToUpdate;
if (playlists.isEmpty()) {
return noItemToUpdate;
}
final PlaylistRemoteEntity playlistEntity = playlists.get(0);
if (playlistEntity.isIdenticalTo(result)) return noItemToUpdate;
final PlaylistRemoteEntity playlistRemoteEntity = playlists.get(0);
if (playlistRemoteEntity.isIdenticalTo(result)) {
return noItemToUpdate;
}
return remotePlaylistManager.onUpdate(playlists.get(0).getUid(), result).toFlowable();
}
@@ -380,71 +405,76 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
private Subscriber<List<PlaylistRemoteEntity>> getPlaylistBookmarkSubscriber() {
return new Subscriber<List<PlaylistRemoteEntity>>() {
@Override
public void onSubscribe(Subscription s) {
if (bookmarkReactor != null) bookmarkReactor.cancel();
public void onSubscribe(final Subscription s) {
if (bookmarkReactor != null) {
bookmarkReactor.cancel();
}
bookmarkReactor = s;
bookmarkReactor.request(1);
}
@Override
public void onNext(List<PlaylistRemoteEntity> playlist) {
public void onNext(final List<PlaylistRemoteEntity> playlist) {
playlistEntity = playlist.isEmpty() ? null : playlist.get(0);
updateBookmarkButtons();
isBookmarkButtonReady.set(true);
if (bookmarkReactor != null) bookmarkReactor.request(1);
if (bookmarkReactor != null) {
bookmarkReactor.request(1);
}
}
@Override
public void onError(Throwable t) {
public void onError(final Throwable t) {
PlaylistFragment.this.onError(t);
}
@Override
public void onComplete() {
}
public void onComplete() { }
};
}
@Override
public void setTitle(String title) {
public void setTitle(final String title) {
super.setTitle(title);
headerTitleView.setText(title);
}
private void onBookmarkClicked() {
if (isBookmarkButtonReady == null || !isBookmarkButtonReady.get() ||
remotePlaylistManager == null)
if (isBookmarkButtonReady == null || !isBookmarkButtonReady.get()
|| remotePlaylistManager == null) {
return;
}
final Disposable action;
if (currentInfo != null && playlistEntity == null) {
action = remotePlaylistManager.onBookmark(currentInfo)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(ignored -> {/* Do nothing */}, this::onError);
.subscribe(ignored -> { /* Do nothing */ }, this::onError);
} else if (playlistEntity != null) {
action = remotePlaylistManager.deletePlaylist(playlistEntity.getUid())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> playlistEntity = null)
.subscribe(ignored -> {/* Do nothing */}, this::onError);
.subscribe(ignored -> { /* Do nothing */ }, this::onError);
} else {
action = Disposables.empty();
action = Disposable.empty();
}
disposables.add(action);
}
private void updateBookmarkButtons() {
if (playlistBookmarkButton == null || activity == null) return;
if (playlistBookmarkButton == null || activity == null) {
return;
}
final int iconAttr = playlistEntity == null ?
R.attr.ic_playlist_add : R.attr.ic_playlist_check;
final int iconAttr = playlistEntity == null
? R.attr.ic_playlist_add : R.attr.ic_playlist_check;
final int titleRes = playlistEntity == null ?
R.string.bookmark_playlist : R.string.unbookmark_playlist;
final int titleRes = playlistEntity == null
? R.string.bookmark_playlist : R.string.unbookmark_playlist;
playlistBookmarkButton.setIcon(ThemeHelper.resolveResourceIdFromAttr(activity, iconAttr));
playlistBookmarkButton.setTitle(titleRes);

View File

@@ -1,10 +1,10 @@
package org.schabi.newpipe.fragments.list.search;
public class SuggestionItem {
public final boolean fromHistory;
final boolean fromHistory;
public final String query;
public SuggestionItem(boolean fromHistory, String query) {
public SuggestionItem(final boolean fromHistory, final String query) {
this.fromHistory = fromHistory;
this.query = query;
}

View File

@@ -2,42 +2,38 @@ package org.schabi.newpipe.fragments.list.search;
import android.content.Context;
import android.content.res.TypedArray;
import androidx.annotation.AttrRes;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.AttrRes;
import androidx.recyclerview.widget.RecyclerView;
import org.schabi.newpipe.R;
import java.util.ArrayList;
import java.util.List;
public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAdapter.SuggestionItemHolder> {
public class SuggestionListAdapter
extends RecyclerView.Adapter<SuggestionListAdapter.SuggestionItemHolder> {
private final ArrayList<SuggestionItem> items = new ArrayList<>();
private final Context context;
private OnSuggestionItemSelected listener;
private boolean showSuggestionHistory = true;
public interface OnSuggestionItemSelected {
void onSuggestionItemSelected(SuggestionItem item);
void onSuggestionItemInserted(SuggestionItem item);
void onSuggestionItemLongClick(SuggestionItem item);
}
public SuggestionListAdapter(Context context) {
public SuggestionListAdapter(final Context context) {
this.context = context;
}
public void setItems(List<SuggestionItem> items) {
public void setItems(final List<SuggestionItem> items) {
this.items.clear();
if (showSuggestionHistory) {
this.items.addAll(items);
} else {
// remove history items if history is disabled
for (SuggestionItem item : items) {
for (final SuggestionItem item : items) {
if (!item.fromHistory) {
this.items.add(item);
}
@@ -46,36 +42,43 @@ public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAd
notifyDataSetChanged();
}
public void setListener(OnSuggestionItemSelected listener) {
public void setListener(final OnSuggestionItemSelected listener) {
this.listener = listener;
}
public void setShowSuggestionHistory(boolean v) {
public void setShowSuggestionHistory(final boolean v) {
showSuggestionHistory = v;
}
@Override
public SuggestionItemHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new SuggestionItemHolder(LayoutInflater.from(context).inflate(R.layout.item_search_suggestion, parent, false));
public SuggestionItemHolder onCreateViewHolder(final ViewGroup parent, final int viewType) {
return new SuggestionItemHolder(LayoutInflater.from(context)
.inflate(R.layout.item_search_suggestion, parent, false));
}
@Override
public void onBindViewHolder(SuggestionItemHolder holder, int position) {
public void onBindViewHolder(final SuggestionItemHolder holder, final int position) {
final SuggestionItem currentItem = getItem(position);
holder.updateFrom(currentItem);
holder.queryView.setOnClickListener(v -> {
if (listener != null) listener.onSuggestionItemSelected(currentItem);
if (listener != null) {
listener.onSuggestionItemSelected(currentItem);
}
});
holder.queryView.setOnLongClickListener(v -> {
if (listener != null) listener.onSuggestionItemLongClick(currentItem);
return true;
if (listener != null) {
listener.onSuggestionItemLongClick(currentItem);
}
return true;
});
holder.insertView.setOnClickListener(v -> {
if (listener != null) listener.onSuggestionItemInserted(currentItem);
if (listener != null) {
listener.onSuggestionItemInserted(currentItem);
}
});
}
SuggestionItem getItem(int position) {
SuggestionItem getItem(final int position) {
return items.get(position);
}
@@ -88,7 +91,15 @@ public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAd
return getItemCount() == 0;
}
public static class SuggestionItemHolder extends RecyclerView.ViewHolder {
public interface OnSuggestionItemSelected {
void onSuggestionItemSelected(SuggestionItem item);
void onSuggestionItemInserted(SuggestionItem item);
void onSuggestionItemLongClick(SuggestionItem item);
}
public static final class SuggestionItemHolder extends RecyclerView.ViewHolder {
private final TextView itemSuggestionQuery;
private final ImageView suggestionIcon;
private final View queryView;
@@ -98,7 +109,7 @@ public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAd
private final int historyResId;
private final int searchResId;
private SuggestionItemHolder(View rootView) {
private SuggestionItemHolder(final View rootView) {
super(rootView);
suggestionIcon = rootView.findViewById(R.id.item_suggestion_icon);
itemSuggestionQuery = rootView.findViewById(R.id.item_suggestion_query);
@@ -106,20 +117,21 @@ public class SuggestionListAdapter extends RecyclerView.Adapter<SuggestionListAd
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);
historyResId = resolveResourceIdFromAttr(rootView.getContext(), R.attr.ic_history);
searchResId = resolveResourceIdFromAttr(rootView.getContext(), R.attr.ic_search);
}
private void updateFrom(SuggestionItem item) {
suggestionIcon.setImageResource(item.fromHistory ? historyResId : searchResId);
itemSuggestionQuery.setText(item.query);
}
private static int resolveResourceIdFromAttr(Context context, @AttrRes int attr) {
TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
int attributeResourceId = a.getResourceId(0, 0);
private static int resolveResourceIdFromAttr(final Context context,
@AttrRes final int attr) {
final TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
final int attributeResourceId = a.getResourceId(0, 0);
a.recycle();
return attributeResourceId;
}
private void updateFrom(final SuggestionItem item) {
suggestionIcon.setImageResource(item.fromHistory ? historyResId : searchResId);
itemSuggestionQuery.setText(item.query);
}
}
}

View File

@@ -3,17 +3,17 @@ package org.schabi.newpipe.fragments.list.videos;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.Switch;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.preference.PreferenceManager;
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.ListExtractor;
import org.schabi.newpipe.extractor.NewPipe;
@@ -25,23 +25,24 @@ import org.schabi.newpipe.util.RelatedStreamInfo;
import java.io.Serializable;
import io.reactivex.Single;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
public class RelatedVideosFragment extends BaseListInfoFragment<RelatedStreamInfo> implements SharedPreferences.OnSharedPreferenceChangeListener{
private CompositeDisposable disposables = new CompositeDisposable();
public class RelatedVideosFragment extends BaseListInfoFragment<RelatedStreamInfo>
implements SharedPreferences.OnSharedPreferenceChangeListener {
private static final String INFO_KEY = "related_info_key";
private final CompositeDisposable disposables = new CompositeDisposable();
private RelatedStreamInfo relatedStreamInfo;
/*//////////////////////////////////////////////////////////////////////////
// Views
//////////////////////////////////////////////////////////////////////////*/
private View headerRootLayout;
private Switch aSwitch;
private Switch autoplaySwitch;
private boolean mIsVisibleToUser = false;
public static RelatedVideosFragment getInstance(StreamInfo info) {
RelatedVideosFragment instance = new RelatedVideosFragment();
public static RelatedVideosFragment getInstance(final StreamInfo info) {
final RelatedVideosFragment instance = new RelatedVideosFragment();
instance.setInitialData(info);
return instance;
}
@@ -51,86 +52,87 @@ public class RelatedVideosFragment extends BaseListInfoFragment<RelatedStreamInf
//////////////////////////////////////////////////////////////////////////*/
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
mIsVisibleToUser = isVisibleToUser;
}
@Override
public void onAttach(Context context) {
public void onAttach(final Context context) {
super.onAttach(context);
}
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
public View onCreateView(@NonNull final LayoutInflater inflater,
@Nullable final ViewGroup container,
@Nullable final Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_related_streams, container, false);
}
@Override
public void onDestroy() {
super.onDestroy();
if (disposables != null) disposables.clear();
if (disposables != null) {
disposables.clear();
}
}
protected View getListHeader(){
if(relatedStreamInfo != null && relatedStreamInfo.getNextStream() != null){
headerRootLayout = activity.getLayoutInflater().inflate(R.layout.related_streams_header, itemsList, false);
aSwitch = headerRootLayout.findViewById(R.id.autoplay_switch);
protected View getListHeader() {
if (relatedStreamInfo != null && relatedStreamInfo.getRelatedItems() != null) {
headerRootLayout = activity.getLayoutInflater()
.inflate(R.layout.related_streams_header, itemsList, false);
autoplaySwitch = headerRootLayout.findViewById(R.id.autoplay_switch);
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(getContext());
Boolean autoplay = pref.getBoolean(getString(R.string.auto_queue_key), false);
aSwitch.setChecked(autoplay);
aSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
SharedPreferences.Editor prefEdit = PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
prefEdit.putBoolean(getString(R.string.auto_queue_key), b);
prefEdit.apply();
}
});
final SharedPreferences pref = PreferenceManager
.getDefaultSharedPreferences(requireContext());
final boolean autoplay = pref.getBoolean(getString(R.string.auto_queue_key), false);
autoplaySwitch.setChecked(autoplay);
autoplaySwitch.setOnCheckedChangeListener((compoundButton, b) ->
PreferenceManager.getDefaultSharedPreferences(requireContext()).edit()
.putBoolean(getString(R.string.auto_queue_key), b).apply());
return headerRootLayout;
}else{
} else {
return null;
}
}
@Override
protected Single<ListExtractor.InfoItemsPage> loadMoreItemsLogic() {
return Single.fromCallable(() -> ListExtractor.InfoItemsPage.emptyPage());
}
@Override
protected Single<RelatedStreamInfo> loadResult(boolean forceLoad) {
return Single.fromCallable(() -> relatedStreamInfo);
return Single.fromCallable(ListExtractor.InfoItemsPage::emptyPage);
}
/*//////////////////////////////////////////////////////////////////////////
// Contract
//////////////////////////////////////////////////////////////////////////*/
@Override
protected Single<RelatedStreamInfo> loadResult(final boolean forceLoad) {
return Single.fromCallable(() -> relatedStreamInfo);
}
@Override
public void showLoading() {
super.showLoading();
if(null != headerRootLayout) headerRootLayout.setVisibility(View.INVISIBLE);
if (headerRootLayout != null) {
headerRootLayout.setVisibility(View.INVISIBLE);
}
}
@Override
public void handleResult(@NonNull RelatedStreamInfo result) {
public void handleResult(@NonNull final RelatedStreamInfo result) {
super.handleResult(result);
if(null != headerRootLayout) headerRootLayout.setVisibility(View.VISIBLE);
AnimationUtils.slideUp(getView(),120, 96, 0.06f);
if (headerRootLayout != null) {
headerRootLayout.setVisibility(View.VISIBLE);
}
AnimationUtils.slideUp(getView(), 120, 96, 0.06f);
if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(), UserAction.REQUESTED_STREAM, NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);
showSnackBarError(result.getErrors(), UserAction.REQUESTED_STREAM,
NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);
}
if (disposables != null) disposables.clear();
if (disposables != null) {
disposables.clear();
}
}
@Override
public void handleNextItems(ListExtractor.InfoItemsPage result) {
public void handleNextItems(final ListExtractor.InfoItemsPage result) {
super.handleNextItems(result);
if (!result.getErrors().isEmpty()) {
@@ -147,11 +149,14 @@ public class RelatedVideosFragment extends BaseListInfoFragment<RelatedStreamInf
//////////////////////////////////////////////////////////////////////////*/
@Override
protected boolean onError(Throwable exception) {
if (super.onError(exception)) return true;
protected boolean onError(final Throwable exception) {
if (super.onError(exception)) {
return true;
}
hideLoading();
showSnackBarError(exception, UserAction.REQUESTED_STREAM, NewPipe.getNameOfService(serviceId), url, R.string.general_error);
showSnackBarError(exception, UserAction.REQUESTED_STREAM,
NewPipe.getNameOfService(serviceId), url, R.string.general_error);
return true;
}
@@ -160,45 +165,46 @@ public class RelatedVideosFragment extends BaseListInfoFragment<RelatedStreamInf
//////////////////////////////////////////////////////////////////////////*/
@Override
public void setTitle(String title) {
return;
public void setTitle(final String title) {
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
return;
public void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater) {
}
private void setInitialData(StreamInfo info) {
private void setInitialData(final StreamInfo info) {
super.setInitialData(info.getServiceId(), info.getUrl(), info.getName());
if(this.relatedStreamInfo == null) this.relatedStreamInfo = RelatedStreamInfo.getInfo(info);
if (this.relatedStreamInfo == null) {
this.relatedStreamInfo = RelatedStreamInfo.getInfo(info);
}
}
private static final String INFO_KEY = "related_info_key";
@Override
public void onSaveInstanceState(Bundle outState) {
public void onSaveInstanceState(final Bundle outState) {
super.onSaveInstanceState(outState);
outState.putSerializable(INFO_KEY, relatedStreamInfo);
}
@Override
protected void onRestoreInstanceState(@NonNull Bundle savedState) {
protected void onRestoreInstanceState(@NonNull final Bundle savedState) {
super.onRestoreInstanceState(savedState);
if (savedState != null) {
Serializable serializable = savedState.getSerializable(INFO_KEY);
if(serializable instanceof RelatedStreamInfo){
final Serializable serializable = savedState.getSerializable(INFO_KEY);
if (serializable instanceof RelatedStreamInfo) {
this.relatedStreamInfo = (RelatedStreamInfo) serializable;
}
}
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) {
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(getContext());
Boolean autoplay = pref.getBoolean(getString(R.string.auto_queue_key), false);
if(null != aSwitch) aSwitch.setChecked(autoplay);
public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences,
final String s) {
final SharedPreferences pref =
PreferenceManager.getDefaultSharedPreferences(requireContext());
final boolean autoplay = pref.getBoolean(getString(R.string.auto_queue_key), false);
if (autoplaySwitch != null) {
autoplaySwitch.setChecked(autoplay);
}
}
@Override

View File

@@ -1,10 +1,11 @@
package org.schabi.newpipe.info_list;
import android.content.Context;
import androidx.annotation.NonNull;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import com.nostra13.universalimageloader.core.ImageLoader;
import org.schabi.newpipe.extractor.InfoItem;
@@ -29,24 +30,26 @@ import org.schabi.newpipe.util.OnClickGesture;
* <p>
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
* InfoItemBuilder.java is part of NewPipe.
* </p>
* <p>
* NewPipe is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* </p>
* <p>
* NewPipe is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* </p>
* <p>
* You should have received a copy of the GNU General Public License
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
* </p>
*/
public class InfoItemBuilder {
private static final String TAG = InfoItemBuilder.class.toString();
private final Context context;
private final ImageLoader imageLoader = ImageLoader.getInstance();
@@ -55,31 +58,40 @@ public class InfoItemBuilder {
private OnClickGesture<PlaylistInfoItem> onPlaylistSelectedListener;
private OnClickGesture<CommentsInfoItem> onCommentsSelectedListener;
public InfoItemBuilder(Context context) {
public InfoItemBuilder(final Context context) {
this.context = context;
}
public View buildView(@NonNull ViewGroup parent, @NonNull final InfoItem infoItem, final HistoryRecordManager historyRecordManager) {
public View buildView(@NonNull final ViewGroup parent, @NonNull final InfoItem infoItem,
final HistoryRecordManager historyRecordManager) {
return buildView(parent, infoItem, historyRecordManager, false);
}
public View buildView(@NonNull ViewGroup parent, @NonNull final InfoItem infoItem,
final HistoryRecordManager historyRecordManager, boolean useMiniVariant) {
InfoItemHolder holder = holderFromInfoType(parent, infoItem.getInfoType(), useMiniVariant);
public View buildView(@NonNull final ViewGroup parent, @NonNull final InfoItem infoItem,
final HistoryRecordManager historyRecordManager,
final boolean useMiniVariant) {
final InfoItemHolder holder
= holderFromInfoType(parent, infoItem.getInfoType(), useMiniVariant);
holder.updateFromItem(infoItem, historyRecordManager);
return holder.itemView;
}
private InfoItemHolder holderFromInfoType(@NonNull ViewGroup parent, @NonNull InfoItem.InfoType infoType, boolean useMiniVariant) {
private InfoItemHolder holderFromInfoType(@NonNull final ViewGroup parent,
@NonNull final InfoItem.InfoType infoType,
final boolean useMiniVariant) {
switch (infoType) {
case STREAM:
return useMiniVariant ? new StreamMiniInfoItemHolder(this, parent) : new StreamInfoItemHolder(this, parent);
return useMiniVariant ? new StreamMiniInfoItemHolder(this, parent)
: new StreamInfoItemHolder(this, parent);
case CHANNEL:
return useMiniVariant ? new ChannelMiniInfoItemHolder(this, parent) : new ChannelInfoItemHolder(this, parent);
return useMiniVariant ? new ChannelMiniInfoItemHolder(this, parent)
: new ChannelInfoItemHolder(this, parent);
case PLAYLIST:
return useMiniVariant ? new PlaylistMiniInfoItemHolder(this, parent) : new PlaylistInfoItemHolder(this, parent);
return useMiniVariant ? new PlaylistMiniInfoItemHolder(this, parent)
: new PlaylistInfoItemHolder(this, parent);
case COMMENT:
return useMiniVariant ? new CommentsMiniInfoItemHolder(this, parent) : new CommentsInfoItemHolder(this, parent);
return useMiniVariant ? new CommentsMiniInfoItemHolder(this, parent)
: new CommentsInfoItemHolder(this, parent);
default:
throw new RuntimeException("InfoType not expected = " + infoType.name());
}
@@ -97,7 +109,7 @@ public class InfoItemBuilder {
return onStreamSelectedListener;
}
public void setOnStreamSelectedListener(OnClickGesture<StreamInfoItem> listener) {
public void setOnStreamSelectedListener(final OnClickGesture<StreamInfoItem> listener) {
this.onStreamSelectedListener = listener;
}
@@ -105,7 +117,7 @@ public class InfoItemBuilder {
return onChannelSelectedListener;
}
public void setOnChannelSelectedListener(OnClickGesture<ChannelInfoItem> listener) {
public void setOnChannelSelectedListener(final OnClickGesture<ChannelInfoItem> listener) {
this.onChannelSelectedListener = listener;
}
@@ -113,7 +125,7 @@ public class InfoItemBuilder {
return onPlaylistSelectedListener;
}
public void setOnPlaylistSelectedListener(OnClickGesture<PlaylistInfoItem> listener) {
public void setOnPlaylistSelectedListener(final OnClickGesture<PlaylistInfoItem> listener) {
this.onPlaylistSelectedListener = listener;
}
@@ -121,8 +133,8 @@ public class InfoItemBuilder {
return onCommentsSelectedListener;
}
public void setOnCommentsSelectedListener(OnClickGesture<CommentsInfoItem> onCommentsSelectedListener) {
public void setOnCommentsSelectedListener(
final OnClickGesture<CommentsInfoItem> onCommentsSelectedListener) {
this.onCommentsSelectedListener = onCommentsSelectedListener;
}
}

View File

@@ -3,11 +3,12 @@ package org.schabi.newpipe.info_list;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
@@ -30,10 +31,10 @@ public class InfoItemDialog {
final View bannerView = View.inflate(activity, R.layout.dialog_title, null);
bannerView.setSelected(true);
TextView titleView = bannerView.findViewById(R.id.itemTitleView);
final TextView titleView = bannerView.findViewById(R.id.itemTitleView);
titleView.setText(title);
TextView detailsView = bannerView.findViewById(R.id.itemAdditionalDetails);
final TextView detailsView = bannerView.findViewById(R.id.itemAdditionalDetails);
if (additionalDetail != null) {
detailsView.setText(additionalDetail);
detailsView.setVisibility(View.VISIBLE);

View File

@@ -1,13 +1,14 @@
package org.schabi.newpipe.info_list;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import org.schabi.newpipe.database.stream.model.StreamStateEntity;
import org.schabi.newpipe.extractor.InfoItem;
@@ -83,42 +84,33 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
private View header = null;
private View footer = null;
public class HFHolder extends RecyclerView.ViewHolder {
public View view;
public HFHolder(View v) {
super(v);
view = v;
}
}
public InfoListAdapter(Context context) {
public InfoListAdapter(final Context context) {
this.recordManager = new HistoryRecordManager(context);
infoItemBuilder = new InfoItemBuilder(context);
infoItemList = new ArrayList<>();
}
public void setOnStreamSelectedListener(OnClickGesture<StreamInfoItem> listener) {
public void setOnStreamSelectedListener(final OnClickGesture<StreamInfoItem> listener) {
infoItemBuilder.setOnStreamSelectedListener(listener);
}
public void setOnChannelSelectedListener(OnClickGesture<ChannelInfoItem> listener) {
public void setOnChannelSelectedListener(final OnClickGesture<ChannelInfoItem> listener) {
infoItemBuilder.setOnChannelSelectedListener(listener);
}
public void setOnPlaylistSelectedListener(OnClickGesture<PlaylistInfoItem> listener) {
public void setOnPlaylistSelectedListener(final OnClickGesture<PlaylistInfoItem> listener) {
infoItemBuilder.setOnPlaylistSelectedListener(listener);
}
public void setOnCommentsSelectedListener(OnClickGesture<CommentsInfoItem> listener) {
public void setOnCommentsSelectedListener(final OnClickGesture<CommentsInfoItem> listener) {
infoItemBuilder.setOnCommentsSelectedListener(listener);
}
public void useMiniItemVariants(boolean useMiniVariant) {
public void setUseMiniVariant(final boolean useMiniVariant) {
this.useMiniVariant = useMiniVariant;
}
public void setGridItemVariants(boolean useGridVariant) {
public void setUseGridVariant(final boolean useGridVariant) {
this.useGridVariant = useGridVariant;
}
@@ -126,55 +118,67 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
if (data == null) {
return;
}
if (DEBUG) Log.d(TAG, "addInfoItemList() before > infoItemList.size() = " +
infoItemList.size() + ", data.size() = " + data.size());
if (DEBUG) {
Log.d(TAG, "addInfoItemList() before > infoItemList.size() = "
+ infoItemList.size() + ", data.size() = " + data.size());
}
int offsetStart = sizeConsideringHeaderOffset();
final int offsetStart = sizeConsideringHeaderOffset();
infoItemList.addAll(data);
if (DEBUG) Log.d(TAG, "addInfoItemList() after > offsetStart = " + offsetStart +
", infoItemList.size() = " + infoItemList.size() +
", header = " + header + ", footer = " + footer +
", showFooter = " + showFooter);
if (DEBUG) {
Log.d(TAG, "addInfoItemList() after > offsetStart = " + offsetStart + ", "
+ "infoItemList.size() = " + infoItemList.size() + ", "
+ "header = " + header + ", footer = " + footer + ", "
+ "showFooter = " + showFooter);
}
notifyItemRangeInserted(offsetStart, data.size());
if (footer != null && showFooter) {
int footerNow = sizeConsideringHeaderOffset();
final int footerNow = sizeConsideringHeaderOffset();
notifyItemMoved(offsetStart, footerNow);
if (DEBUG) Log.d(TAG, "addInfoItemList() footer from " + offsetStart +
" to " + footerNow);
if (DEBUG) {
Log.d(TAG, "addInfoItemList() footer from " + offsetStart
+ " to " + footerNow);
}
}
}
public void setInfoItemList(List<? extends InfoItem> data) {
public void setInfoItemList(final List<? extends InfoItem> data) {
infoItemList.clear();
infoItemList.addAll(data);
notifyDataSetChanged();
}
public void addInfoItem(@Nullable InfoItem data) {
public void addInfoItem(@Nullable final InfoItem data) {
if (data == null) {
return;
}
if (DEBUG) Log.d(TAG, "addInfoItem() before > infoItemList.size() = " +
infoItemList.size() + ", thread = " + Thread.currentThread());
if (DEBUG) {
Log.d(TAG, "addInfoItem() before > infoItemList.size() = "
+ infoItemList.size() + ", thread = " + Thread.currentThread());
}
int positionInserted = sizeConsideringHeaderOffset();
final int positionInserted = sizeConsideringHeaderOffset();
infoItemList.add(data);
if (DEBUG) Log.d(TAG, "addInfoItem() after > position = " + positionInserted +
", infoItemList.size() = " + infoItemList.size() +
", header = " + header + ", footer = " + footer +
", showFooter = " + showFooter);
if (DEBUG) {
Log.d(TAG, "addInfoItem() after > position = " + positionInserted + ", "
+ "infoItemList.size() = " + infoItemList.size() + ", "
+ "header = " + header + ", footer = " + footer + ", "
+ "showFooter = " + showFooter);
}
notifyItemInserted(positionInserted);
if (footer != null && showFooter) {
int footerNow = sizeConsideringHeaderOffset();
final int footerNow = sizeConsideringHeaderOffset();
notifyItemMoved(positionInserted, footerNow);
if (DEBUG) Log.d(TAG, "addInfoItem() footer from " + positionInserted +
" to " + footerNow);
if (DEBUG) {
Log.d(TAG, "addInfoItem() footer from " + positionInserted
+ " to " + footerNow);
}
}
}
@@ -186,29 +190,39 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
notifyDataSetChanged();
}
public void setHeader(View header) {
boolean changed = header != this.header;
public void setHeader(final View header) {
final boolean changed = header != this.header;
this.header = header;
if (changed) notifyDataSetChanged();
if (changed) {
notifyDataSetChanged();
}
}
public void setFooter(View view) {
public void setFooter(final View view) {
this.footer = view;
}
public void showFooter(boolean show) {
if (DEBUG) Log.d(TAG, "showFooter() called with: show = [" + show + "]");
if (show == showFooter) return;
public void showFooter(final boolean show) {
if (DEBUG) {
Log.d(TAG, "showFooter() called with: show = [" + show + "]");
}
if (show == showFooter) {
return;
}
showFooter = show;
if (show) notifyItemInserted(sizeConsideringHeaderOffset());
else notifyItemRemoved(sizeConsideringHeaderOffset());
if (show) {
notifyItemInserted(sizeConsideringHeaderOffset());
} else {
notifyItemRemoved(sizeConsideringHeaderOffset());
}
}
private int sizeConsideringHeaderOffset() {
int i = infoItemList.size() + (header != null ? 1 : 0);
if (DEBUG) Log.d(TAG, "sizeConsideringHeaderOffset() called → " + i);
final int i = infoItemList.size() + (header != null ? 1 : 0);
if (DEBUG) {
Log.d(TAG, "sizeConsideringHeaderOffset() called → " + i);
}
return i;
}
@@ -219,18 +233,27 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
@Override
public int getItemCount() {
int count = infoItemList.size();
if (header != null) count++;
if (footer != null && showFooter) count++;
if (header != null) {
count++;
}
if (footer != null && showFooter) {
count++;
}
if (DEBUG) {
Log.d(TAG, "getItemCount() called, count = " + count + ", infoItemList.size() = " + infoItemList.size() + ", header = " + header + ", footer = " + footer + ", showFooter = " + showFooter);
Log.d(TAG, "getItemCount() called with: "
+ "count = " + count + ", infoItemList.size() = " + infoItemList.size() + ", "
+ "header = " + header + ", footer = " + footer + ", "
+ "showFooter = " + showFooter);
}
return count;
}
@Override
public int getItemViewType(int position) {
if (DEBUG) Log.d(TAG, "getItemViewType() called with: position = [" + position + "]");
if (DEBUG) {
Log.d(TAG, "getItemViewType() called with: position = [" + position + "]");
}
if (header != null && position == 0) {
return HEADER_TYPE;
@@ -243,11 +266,14 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
final InfoItem item = infoItemList.get(position);
switch (item.getInfoType()) {
case STREAM:
return useGridVariant ? GRID_STREAM_HOLDER_TYPE : useMiniVariant ? MINI_STREAM_HOLDER_TYPE : STREAM_HOLDER_TYPE;
return useGridVariant ? GRID_STREAM_HOLDER_TYPE : useMiniVariant
? MINI_STREAM_HOLDER_TYPE : STREAM_HOLDER_TYPE;
case CHANNEL:
return useGridVariant ? GRID_CHANNEL_HOLDER_TYPE : useMiniVariant ? MINI_CHANNEL_HOLDER_TYPE : CHANNEL_HOLDER_TYPE;
return useGridVariant ? GRID_CHANNEL_HOLDER_TYPE : useMiniVariant
? MINI_CHANNEL_HOLDER_TYPE : CHANNEL_HOLDER_TYPE;
case PLAYLIST:
return useGridVariant ? GRID_PLAYLIST_HOLDER_TYPE : useMiniVariant ? MINI_PLAYLIST_HOLDER_TYPE : PLAYLIST_HOLDER_TYPE;
return useGridVariant ? GRID_PLAYLIST_HOLDER_TYPE : useMiniVariant
? MINI_PLAYLIST_HOLDER_TYPE : PLAYLIST_HOLDER_TYPE;
case COMMENT:
return useMiniVariant ? MINI_COMMENT_HOLDER_TYPE : COMMENT_HOLDER_TYPE;
default:
@@ -257,9 +283,12 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int type) {
if (DEBUG)
Log.d(TAG, "onCreateViewHolder() called with: parent = [" + parent + "], type = [" + type + "]");
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull final ViewGroup parent,
final int type) {
if (DEBUG) {
Log.d(TAG, "onCreateViewHolder() called with: "
+ "parent = [" + parent + "], type = [" + type + "]");
}
switch (type) {
case HEADER_TYPE:
return new HFHolder(header);
@@ -293,28 +322,38 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
if (DEBUG) Log.d(TAG, "onBindViewHolder() called with: holder = [" + holder.getClass().getSimpleName() + "], position = [" + position + "]");
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int position) {
if (DEBUG) {
Log.d(TAG, "onBindViewHolder() called with: "
+ "holder = [" + holder.getClass().getSimpleName() + "], "
+ "position = [" + position + "]");
}
if (holder instanceof InfoItemHolder) {
// If header isn't null, offset the items by -1
if (header != null) position--;
if (header != null) {
position--;
}
((InfoItemHolder) holder).updateFromItem(infoItemList.get(position), recordManager);
} else if (holder instanceof HFHolder && position == 0 && header != null) {
((HFHolder) holder).view = header;
} else if (holder instanceof HFHolder && position == sizeConsideringHeaderOffset() && footer != null && showFooter) {
} else if (holder instanceof HFHolder && position == sizeConsideringHeaderOffset()
&& footer != null && showFooter) {
((HFHolder) holder).view = footer;
}
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position, @NonNull List<Object> payloads) {
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, final int position,
@NonNull final List<Object> payloads) {
if (!payloads.isEmpty() && holder instanceof InfoItemHolder) {
for (Object payload : payloads) {
for (final Object payload : payloads) {
if (payload instanceof StreamStateEntity) {
((InfoItemHolder) holder).updateState(infoItemList.get(header == null ? position : position - 1), recordManager);
((InfoItemHolder) holder).updateState(infoItemList
.get(header == null ? position : position - 1), recordManager);
} else if (payload instanceof Boolean) {
((InfoItemHolder) holder).updateState(infoItemList.get(header == null ? position : position - 1), recordManager);
((InfoItemHolder) holder).updateState(infoItemList
.get(header == null ? position : position - 1), recordManager);
}
}
} else {
@@ -325,10 +364,19 @@ public class InfoListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
public GridLayoutManager.SpanSizeLookup getSpanSizeLookup(final int spanCount) {
return new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
public int getSpanSize(final int position) {
final int type = getItemViewType(position);
return type == HEADER_TYPE || type == FOOTER_TYPE ? spanCount : 1;
}
};
}
public static class HFHolder extends RecyclerView.ViewHolder {
public View view;
HFHolder(final View v) {
super(v);
view = v;
}
}
}

View File

@@ -6,8 +6,8 @@ import org.schabi.newpipe.R;
import org.schabi.newpipe.info_list.InfoItemBuilder;
public class ChannelGridInfoItemHolder extends ChannelMiniInfoItemHolder {
public ChannelGridInfoItemHolder(InfoItemBuilder infoItemBuilder, ViewGroup parent) {
super(infoItemBuilder, R.layout.list_channel_grid_item, parent);
}
public ChannelGridInfoItemHolder(final InfoItemBuilder infoItemBuilder,
final ViewGroup parent) {
super(infoItemBuilder, R.layout.list_channel_grid_item, parent);
}
}

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