1
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-09-20 11:20:52 +02:00

Compare commits

...

227 Commits

Author SHA1 Message Date
E T
f893edeb82 Translated using Weblate (Turkish)
Currently translated at 100.0% (205 of 205 strings)
2017-09-18 01:11:35 +02:00
Weblate
64e4adef29 Merge remote-tracking branch 'origin/master' 2017-09-16 10:36:43 +02:00
E T
c1fe03aab6 Translated using Weblate (Turkish)
Currently translated at 100.0% (205 of 205 strings)
2017-09-16 10:36:32 +02:00
Christian Schabesberger
4b0a071a35 Merge pull request #691 from TeamNewPipe/minify
enable minify
2017-09-13 21:07:55 +02:00
Christian Schabesberger
4ef69969a7 enable minify 2017-09-12 13:32:53 +02:00
Weblate
c5885d9ce4 Merge remote-tracking branch 'origin/master' 2017-09-11 23:15:20 +02:00
Allan Nordhøy
4c2d705311 Translated using Weblate (Norwegian Bokmål)
Currently translated at 100.0% (205 of 205 strings)
2017-09-11 23:15:16 +02:00
Mauricio Colli
939017ada9 Update extractor version 2017-09-11 11:21:01 -03:00
Matej U
322c5c05cf Translated using Weblate (Slovenian)
Currently translated at 100.0% (205 of 205 strings)
2017-09-11 11:29:26 +02:00
Jonas
cd174b8ce9 Translated using Weblate (French)
Currently translated at 100.0% (205 of 205 strings)
2017-09-11 10:12:00 +02:00
Oscar Hemelaar
f5999f28e9 Translated using Weblate (French)
Currently translated at 97.0% (199 of 205 strings)
2017-09-11 10:06:02 +02:00
Jonas
428a754bfc Translated using Weblate (French)
Currently translated at 96.5% (198 of 205 strings)
2017-09-11 10:05:38 +02:00
Weblate
9ba2a9d907 Merge remote-tracking branch 'origin/master' 2017-09-09 22:34:46 +02:00
Eduardo Caron
71a22348c9 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (205 of 205 strings)
2017-09-09 22:34:45 +02:00
Tobias Groza
4ac0db1869 Translated using Weblate (French)
Currently translated at 80.9% (166 of 205 strings)
2017-09-09 22:34:36 +02:00
Nathan Follens
bca9035302 Translated using Weblate (Dutch)
Currently translated at 100.0% (205 of 205 strings)
2017-09-09 22:34:25 +02:00
Christian Schabesberger
33b316d72f update extractor to not throw channelextractor exception 2017-09-09 22:22:27 +02:00
Christian Schabesberger
6068043fd4 Fix pullrequest teamplate markdown issue 2017-09-09 19:04:30 +02:00
Weblate
2bf4032a6f Merge remote-tracking branch 'origin/master' 2017-09-09 00:46:59 +02:00
Enrico Monese
5e659e3f46 Translated using Weblate (Italian)
Currently translated at 97.0% (199 of 205 strings)
2017-09-09 00:46:56 +02:00
Mauricio Colli
23f70d6b8b Update extractor 2017-09-08 11:34:02 -03:00
Osoitz
ddcf2c5206 Translated using Weblate (Basque)
Currently translated at 100.0% (205 of 205 strings)
2017-09-08 15:44:27 +02:00
Tobias Groza
6b88349c77 Translated using Weblate (German)
Currently translated at 98.0% (201 of 205 strings)
2017-09-07 18:46:03 +02:00
Marian Hanzel
4eb2d3805d Translated using Weblate (Slovak)
Currently translated at 84.8% (174 of 205 strings)
2017-09-06 00:48:04 +02:00
Gaman Gabriel
6cdddc4e9f Translated using Weblate (Romanian)
Currently translated at 77.5% (159 of 205 strings)
2017-09-05 18:48:21 +02:00
Freddy Morán Jr
406d844722 Translated using Weblate (Spanish)
Currently translated at 100.0% (205 of 205 strings)
2017-09-05 14:47:09 +02:00
Mladen Pejaković
09ee0357c7 Translated using Weblate (Serbian)
Currently translated at 100.0% (205 of 205 strings)
2017-09-04 16:23:20 +02:00
Mauricio Colli
f603f63361 Another fix for Weblate 2017-09-04 09:31:53 -03:00
Mauricio Colli
720bb5d615 Fix strings for Weblate 2017-09-04 09:26:00 -03:00
Mauricio Colli
eebd76661d Translated using Weblate (Portuguese (Brazil))
Currently translated at 98.5% (203 of 206 strings)
2017-09-04 14:10:52 +02:00
Mauricio Colli
7885ae5d3f Merge pull request #669 from mauriciocolli/refactor-newpipe
Update extractor and refactored NewPipe
2017-09-04 08:50:21 -03:00
Christian Schabesberger
08257cc5dd Merge pull request #671 from TobiGr/readme-typos
Fix typos in README
2017-09-04 01:39:23 +02:00
TobiGr
27f8144bb8 fix typos in README 2017-09-04 00:39:33 +02:00
Mauricio Colli
146d4a8365 Update extractor and refactored NewPipe 2017-09-03 13:57:12 -03:00
Walter White
bddd9b3409 Translated using Weblate (French)
Currently translated at 83.6% (164 of 196 strings)
2017-09-03 06:04:15 +02:00
Mauricio Colli
0d4d83f3a6 Translated using Weblate (English)
Currently translated at 100.0% (196 of 196 strings)
2017-09-03 06:04:14 +02:00
Anton Shestakov
4bb0bb4ff0 Translated using Weblate (Russian)
Currently translated at 97.9% (192 of 196 strings)
2017-09-02 18:48:04 +02:00
Mauricio Colli
2d75968532 Translated using Weblate (English)
Currently translated at 100.0% (196 of 196 strings)
2017-09-02 00:45:25 +02:00
Nathan Follens
aa0e759168 Translated using Weblate (Dutch)
Currently translated at 100.0% (196 of 196 strings)
2017-09-01 23:47:19 +02:00
Eduardo Caron
cdae745c00 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (196 of 196 strings)
2017-09-01 22:54:42 +02:00
Freddy Morán Jr
a8b6af1f03 Translated using Weblate (Spanish)
Currently translated at 100.0% (196 of 196 strings)
2017-09-01 06:58:52 +02:00
Mauricio Colli
c7106073b4 Translated using Weblate (German)
Currently translated at 90.8% (178 of 196 strings)
2017-09-01 00:17:13 +02:00
Mauricio Colli
d96139798f Translated using Weblate (English)
Currently translated at 100.0% (196 of 196 strings)
2017-09-01 00:17:13 +02:00
nautilusx
bd560644fe Translated using Weblate (German)
Currently translated at 97.9% (192 of 196 strings)
2017-08-31 22:09:52 +02:00
Tobias Groza
f6772c4138 Translated using Weblate (German)
Currently translated at 88.7% (174 of 196 strings)
2017-08-31 12:51:23 +02:00
Mauricio Colli
dd733640e5 Translated using Weblate (Portuguese (Brazil))
Currently translated at 86.7% (170 of 196 strings)
2017-08-31 05:20:12 +02:00
Allan Nordhøy
75a0c0a527 Translated using Weblate (Norwegian Bokmål)
Currently translated at 78.0% (153 of 196 strings)
2017-08-31 05:20:12 +02:00
Mauricio Colli
a5925875a7 Translated using Weblate (English)
Currently translated at 100.0% (196 of 196 strings)
2017-08-31 05:20:02 +02:00
Allan Nordhøy
84157f9247 Translated using Weblate (English)
Currently translated at 100.0% (196 of 196 strings)

Note that "Billion" is often "Milliard" in other languages.
2017-08-31 05:17:26 +02:00
Allan Nordhøy
fcf3ed7881 Translated using Weblate (English)
Currently translated at 100.0% (196 of 196 strings)
2017-08-31 03:45:01 +02:00
theVikac
dac3be69d6 Translated using Weblate (Croatian)
Currently translated at 100.0% (196 of 196 strings)
2017-08-30 09:15:40 +02:00
haseoxth
5118e5cceb Translated using Weblate (Chinese (Simplified))
Currently translated at 100.0% (196 of 196 strings)
2017-08-30 08:15:06 +02:00
Janusz May
7ca0d20dda Translated using Weblate (Polish)
Currently translated at 98.9% (194 of 196 strings)
2017-08-29 15:47:28 +02:00
Marian Hanzel
378222e484 Translated using Weblate (Slovak)
Currently translated at 100.0% (196 of 196 strings)
2017-08-29 08:41:45 +02:00
mueller-ma
812bec205c Translated using Weblate (German)
Currently translated at 98.4% (193 of 196 strings)
2017-08-28 12:46:04 +02:00
Matej U
2ee8803e33 Translated using Weblate (Slovenian)
Currently translated at 100.0% (196 of 196 strings)
2017-08-27 12:48:39 +02:00
wb9688
007616ca42 Translated using Weblate (Dutch)
Currently translated at 100.0% (196 of 196 strings)
2017-08-27 09:45:09 +02:00
Osoitz
f3b235e4a7 Translated using Weblate (Basque)
Currently translated at 95.9% (188 of 196 strings)
2017-08-26 15:44:19 +02:00
anonymous
074d4be4ba Translated using Weblate (Dutch)
Currently translated at 100.0% (196 of 196 strings)
2017-08-26 09:34:35 +02:00
wb9688
03cd48257b Translated using Weblate (Dutch)
Currently translated at 100.0% (196 of 196 strings)
2017-08-26 09:33:21 +02:00
zmni
546db83de3 Translated using Weblate (Indonesian)
Currently translated at 95.4% (187 of 196 strings)
2017-08-25 18:46:09 +02:00
Matej U
cc11a39f7e Translated using Weblate (Slovenian)
Currently translated at 99.4% (195 of 196 strings)
2017-08-24 00:48:01 +02:00
Eduardo Caron
a83b365afd Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (196 of 196 strings)
2017-08-23 15:22:27 +02:00
Freddy Morán Jr
6a6cfac603 Translated using Weblate (Spanish)
Currently translated at 100.0% (196 of 196 strings)
2017-08-22 01:27:56 +02:00
Weblate
5270cedc56 Merge remote-tracking branch 'origin/master' 2017-08-20 21:45:05 +02:00
Michalis Nikolaidis
2ac833d2a6 Translated using Weblate (Greek)
Currently translated at 22.6% (44 of 194 strings)
2017-08-20 21:45:04 +02:00
Blader
f7be210b12 Translated using Weblate (Dutch)
Currently translated at 93.2% (181 of 194 strings)
2017-08-20 21:44:58 +02:00
Christian Schabesberger
24774d7921 Merge pull request #656 from karyogamy/exoplayer_update
Updated ExoPlayer to r2.5.1
2017-08-18 22:05:31 +02:00
John Zhen M
2b2e954b84 -Updated ExoPlayer to r2.5.1.
-Fixes some more deprecations due to Exoplayer and Android O notification updates.
2017-08-18 11:07:57 -07:00
Tonelico
85108be686 Android O Notification Building Fix (#655)
-Added simple notification channel for Android O.
-Fixes notification building failure for background and popup player on Android O.
-Reduce notification channel importance to low to avoid making noise on every notification update.
2017-08-18 09:05:31 -03:00
Oscar Hemelaar
9fbac943bb Translated using Weblate (French)
Currently translated at 98.4% (191 of 194 strings)
2017-08-18 00:45:31 +02:00
theVikac
d901eaa8d2 Translated using Weblate (Croatian)
Currently translated at 100.0% (194 of 194 strings)
2017-08-17 12:44:50 +02:00
mueller-ma
5fb0e8d007 Translated using Weblate (German)
Currently translated at 98.4% (191 of 194 strings)

In german there is no 's
2017-08-16 21:45:40 +02:00
theVikac
cd5c76cb76 Translated using Weblate (Croatian)
Currently translated at 100.0% (194 of 194 strings)
2017-08-16 10:56:32 +02:00
theVikac
b2a64f8bf3 Added translation using Weblate (Croatian) 2017-08-16 10:50:18 +02:00
mueller-ma
b91acc9de5 Translated using Weblate (German)
Currently translated at 96.9% (188 of 194 strings)
2017-08-15 19:40:37 +02:00
Weblate
07836c7ffa Merge remote-tracking branch 'origin/master' 2017-08-15 19:40:01 +02:00
Tobias Groza
8b30a0d7cc Translated using Weblate (German)
Currently translated at 96.9% (188 of 194 strings)
2017-08-15 19:39:58 +02:00
Mauricio Colli
13a3e2feb2 Merge pull request #654 from coffeemakr/feature-add-components
Add licenses for RxJava
2017-08-15 13:10:11 -03:00
Coffeemakr
f4dca71497 Add licenses for RxJava (and bindings) 2017-08-15 17:21:11 +02:00
Gian Maria Viglianti
e4c6e87338 Translated using Weblate (Italian)
Currently translated at 100.0% (194 of 194 strings)
2017-08-14 18:46:46 +02:00
Eduardo Caron
b2862520fd Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (194 of 194 strings)
2017-08-14 18:34:54 +02:00
Lucas Friederich
bb29f1ea95 Translated using Weblate (Portuguese (Brazil))
Currently translated at 96.3% (187 of 194 strings)
2017-08-14 18:32:58 +02:00
Freddy Morán Jr
69b92757f4 Translated using Weblate (Spanish)
Currently translated at 100.0% (194 of 194 strings)
2017-08-14 03:46:52 +02:00
Mladen Pejaković
62ae2652c7 Translated using Weblate (Serbian)
Currently translated at 95.3% (185 of 194 strings)
2017-08-14 00:46:35 +02:00
anonymous
6f6633050b Translated using Weblate (Italian)
Currently translated at 100.0% (194 of 194 strings)
2017-08-13 17:22:20 +02:00
Gian Maria Viglianti
d37bfd6651 Translated using Weblate (Italian)
Currently translated at 100.0% (194 of 194 strings)
2017-08-13 17:21:56 +02:00
anonymous
55a17a8a83 Translated using Weblate (Italian)
Currently translated at 100.0% (194 of 194 strings)
2017-08-13 17:21:04 +02:00
Gian Maria Viglianti
422b06b72d Translated using Weblate (Italian)
Currently translated at 100.0% (194 of 194 strings)
2017-08-13 17:17:58 +02:00
Freddy Morán Jr
873a1d1c3b Translated using Weblate (Spanish)
Currently translated at 100.0% (194 of 194 strings)
2017-08-13 03:06:27 +02:00
Weblate
44d06767b5 Merge remote-tracking branch 'origin/master' 2017-08-12 18:45:10 +02:00
Thomas Lavend'Homme
3f4379afbf Translated using Weblate (French)
Currently translated at 98.9% (181 of 183 strings)
2017-08-12 18:45:06 +02:00
Cyril Müller
c0515de6b7 Add search and watch history (#626)
Add search and watch history

* Make MainActicity a single task
* Remove some casting
* SearchFragment: start searching when created with query
* Handle settings change in onResume
* History: Log pop up and background playback
* History: Add swipe to remove functionallity
* Enable history by default
* Use stream item
* Store more information about the stream
* Integrate history database into AppDatabase
* Remove redundant casts
* Re-enable date converters
* History: Use Rx Java and run DB in background
 * Also make HistoryDAO extend BasicDAO
* History: RX-ify swipe to remove
* Sort history entries by creation date
* History: Set toolbar title
* Don't repeat history entries
  * Introduced setters so we can update entries in the database
  * If the latest entry has the same (main) values, just update it
2017-08-12 01:50:25 -03:00
anonymous
09159ec245 Translated using Weblate (French)
Currently translated at 93.9% (172 of 183 strings)
2017-08-11 17:05:11 +02:00
Thomas Lavend'Homme
ab0bf80888 Translated using Weblate (French)
Currently translated at 93.4% (171 of 183 strings)
2017-08-11 17:04:40 +02:00
anonymous
74b8eaed04 Translated using Weblate (French)
Currently translated at 86.3% (158 of 183 strings)
2017-08-11 16:05:34 +02:00
anonymous
d64b5ccae2 Translated using Weblate (French)
Currently translated at 85.7% (157 of 183 strings)
2017-08-11 15:58:59 +02:00
anonymous
3883212ca7 Translated using Weblate (French)
Currently translated at 85.2% (156 of 183 strings)
2017-08-11 15:56:20 +02:00
anonymous
1cec41dba0 Translated using Weblate (French)
Currently translated at 84.6% (155 of 183 strings)
2017-08-11 15:56:01 +02:00
anonymous
d00c0ff60c Translated using Weblate (French)
Currently translated at 84.1% (154 of 183 strings)
2017-08-11 15:55:42 +02:00
anonymous
1d597c5f5b Translated using Weblate (French)
Currently translated at 83.6% (153 of 183 strings)
2017-08-11 15:54:41 +02:00
anonymous
c004ef7d0b Translated using Weblate (French)
Currently translated at 83.0% (152 of 183 strings)
2017-08-11 15:54:22 +02:00
Freddy Morán Jr
1bfb977b28 Translated using Weblate (Spanish)
Currently translated at 100.0% (183 of 183 strings)
2017-08-10 19:18:55 +02:00
Osoitz
04138047f6 Translated using Weblate (Basque)
Currently translated at 100.0% (183 of 183 strings)
2017-08-10 14:03:01 +02:00
zmni
147e99a915 Translated using Weblate (Indonesian)
Currently translated at 97.2% (178 of 183 strings)
2017-08-09 15:45:45 +02:00
Matej U
6f7d162edc Translated using Weblate (Slovenian)
Currently translated at 97.8% (179 of 183 strings)
2017-08-09 12:46:52 +02:00
Weblate
910aee4b73 Merge remote-tracking branch 'origin/master' 2017-08-07 20:03:29 +02:00
mueller-ma
77e376751a Translated using Weblate (German)
Currently translated at 96.7% (177 of 183 strings)
2017-08-07 20:03:28 +02:00
Eduardo Caron
7e1264ac44 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (183 of 183 strings)
2017-08-07 20:03:26 +02:00
Christian Schabesberger
8f3a4a5a04 moved on to version v0.10.0 2017-08-07 18:16:19 +02:00
anonymous
2d2689362d Translated using Weblate (German)
Currently translated at 93.9% (172 of 183 strings)
2017-08-07 17:52:56 +02:00
Coffeemaker
913500a6de Translated using Weblate (German)
Currently translated at 93.9% (172 of 183 strings)
2017-08-07 17:51:43 +02:00
Weblate
81d7c54a55 Merge remote-tracking branch 'origin/master' 2017-08-07 17:50:22 +02:00
mueller-ma
4501d5a8fc Translated using Weblate (German)
Currently translated at 99.4% (172 of 173 strings)
2017-08-07 17:50:16 +02:00
Tonelico
becc90409f Added option to resume on audio focus regain. (#624) 2017-08-07 10:04:36 -03:00
Tonelico
10c4f7b465 Added basic channel subscription and feed pages (#620)
Added basic channel subscription and feed pages

- Room Persistence for sqlite support.
- RxJava2 for reactive async support.
- Stetho for database inspection support.
- Enabled Multidex for debug build.
2017-08-07 10:02:30 -03:00
Janusz May
cb5b0ff764 Translated using Weblate (Polish)
Currently translated at 98.8% (171 of 173 strings)
2017-08-04 18:46:15 +02:00
Wout B
277a817eaf Translated using Weblate (Dutch)
Currently translated at 100.0% (173 of 173 strings)
2017-08-04 17:07:20 +02:00
zmni
fbac6f6a57 Translated using Weblate (Indonesian)
Currently translated at 100.0% (173 of 173 strings)
2017-08-04 15:58:58 +02:00
monolifed
b1b0d6ceb6 Translated using Weblate (Turkish)
Currently translated at 100.0% (173 of 173 strings)
2017-08-03 21:38:20 +02:00
Eduardo Caron
07421542df Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (173 of 173 strings)
2017-08-03 14:19:56 +02:00
Weblate
74a8139ac9 Merge remote-tracking branch 'origin/master' 2017-08-03 14:16:37 +02:00
Osoitz
77eb76fefb Translated using Weblate (Basque)
Currently translated at 100.0% (167 of 167 strings)
2017-08-03 14:16:35 +02:00
Eduardo Caron
42a450c61f Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (167 of 167 strings)
2017-08-03 14:16:26 +02:00
TheAssassin
9e2ed10144 Fix bugs in CONTRIBUTING.md
Spelling and grammar bugs, a few additions here and there, make it sound like a team project instead of a one-man show.
2017-08-02 23:34:46 +02:00
Christian Schabesberger
27e5ce7f9b update sentry linkg 2017-08-02 23:19:34 +02:00
Mauricio Colli
f7b322da49 Fix audio focus bug 2017-08-02 14:14:45 -03:00
Mauricio Colli
16ad13c962 Update travis' android and build-tools version 2017-08-01 23:18:47 -03:00
Mauricio Colli
a8880bbc0a Merge pull request #642 from karyogamy/sdk_26_updrade
Upgrade target sdk and support library version to 26
2017-08-01 22:58:54 -03:00
Mauricio Colli
f020b88db3 Move maven repository declaration
- Remove redundant jcenter (already included in the "global application" build.gradle)
2017-08-01 22:56:04 -03:00
Mauricio Colli
a4f5c9e2a3 Merge pull request #636 from coffeemakr/feature-renaming-patterns
Add renaming filename preferences
2017-08-01 22:03:19 -03:00
Mauricio Colli
96d3841dba Fix issues #636 2017-08-01 21:56:51 -03:00
John Zhen M
39277d569f - Updated target, build tools and support libraries version to 26.
- Added dependency repositories jcenter and maven.google.com.
- Changed deprecated ActionBarActivity to AppCompatActivity.
2017-08-01 14:54:32 -07:00
Bruno Guerreiro
75b5bc03f7 Translated using Weblate (Portuguese)
Currently translated at 100.0% (167 of 167 strings)
2017-08-01 18:37:57 +02:00
Osoitz
01e17d9c2e Translated using Weblate (Basque)
Currently translated at 100.0% (167 of 167 strings)
2017-08-01 11:20:14 +02:00
Emilio Loi
8047ff96a8 Translated using Weblate (Italian)
Currently translated at 100.0% (167 of 167 strings)
2017-07-29 15:45:43 +02:00
Gian Maria Viglianti
0e737a2f3b Translated using Weblate (Italian)
Currently translated at 100.0% (167 of 167 strings)
2017-07-28 13:10:51 +02:00
Emilio Loi
854579d814 Translated using Weblate (Italian)
Currently translated at 100.0% (167 of 167 strings)
2017-07-28 13:10:42 +02:00
Emilio Loi
f3cbd99e45 Translated using Weblate (Italian)
Currently translated at 100.0% (167 of 167 strings)

"Cancellare" is "to clear" in writing context
2017-07-28 13:07:02 +02:00
Emilio Loi
c13ed3f347 Translated using Weblate (Italian)
Currently translated at 100.0% (167 of 167 strings)

There is enough space to more descriptive with this text
2017-07-28 13:05:33 +02:00
Emilio Loi
7409b58546 Translated using Weblate (Italian)
Currently translated at 99.4% (167 of 167 strings)
2017-07-28 13:00:17 +02:00
Emilio Loi
404ebb8810 Translated using Weblate (Italian)
Currently translated at 99.4% (166 of 167 strings)

I've inverted position of sentence "help is always welcome" from end to start, merging "The more is done the better it gets!" with the first part of the paragraph
2017-07-28 13:00:13 +02:00
Emilio Loi
b4a9a300c5 Translated using Weblate (Italian)
Currently translated at 97.6% (163 of 167 strings)
2017-07-28 12:58:37 +02:00
Fekrod
aa637e6a2b Translated using Weblate (Vietnamese)
Currently translated at 100.0% (167 of 167 strings)
2017-07-27 04:27:32 +02:00
Fekrod
85132e1e6e Added translation using Weblate (Vietnamese) 2017-07-27 02:59:08 +02:00
Eduardo Caron
f0aa5a4646 Translated using Weblate (Portuguese (Brazil))
Currently translated at 98.8% (165 of 167 strings)
2017-07-26 15:46:21 +02:00
Coffeemakr
b0479d0bd9 Add renaming filename patterns 2017-07-24 13:01:24 +02:00
riotism
e475b888aa Translated using Weblate (Chinese (Hong Kong))
Currently translated at 100.0% (167 of 167 strings)
2017-07-23 21:44:23 +02:00
Nigel
a8a3bbd9f5 Translated using Weblate (Chinese (Hong Kong))
Currently translated at 100.0% (167 of 167 strings)
2017-07-22 20:38:39 +02:00
riotism
f3cbd17598 Translated using Weblate (Chinese (Hong Kong))
Currently translated at 100.0% (167 of 167 strings)
2017-07-22 20:38:09 +02:00
riotism
3d7e4dc286 Translated using Weblate (Chinese (Hong Kong))
Currently translated at 100.0% (167 of 167 strings)
2017-07-22 20:35:53 +02:00
anonymous
2e98729527 Translated using Weblate (German)
Currently translated at 100.0% (167 of 167 strings)
2017-07-20 12:45:26 +02:00
Coffeemaker
3ac838a7ec Translated using Weblate (German)
Currently translated at 99.4% (167 of 167 strings)
2017-07-19 11:42:47 +02:00
Weblate
a1bd5bfc00 Merge remote-tracking branch 'origin/master' 2017-07-19 11:42:41 +02:00
Matej U
b99571a797 Translated using Weblate (Slovenian)
Currently translated at 98.8% (165 of 167 strings)
2017-07-19 11:42:41 +02:00
anonymous
43dec8914c Translated using Weblate (German)
Currently translated at 99.4% (166 of 167 strings)
2017-07-19 11:42:39 +02:00
Christian Schabesberger
5b5cb78595 Merge pull request #633 from coffeemakr/fix-time-links
Prevent "time links" from beeing clicked
2017-07-19 11:38:07 +02:00
Coffeemakr
cb8c919609 Prevent time links from beeing clicked 2017-07-19 10:26:26 +02:00
Anton Shestakov
be3810dfed Translated using Weblate (Russian)
Currently translated at 100.0% (167 of 167 strings)
2017-07-19 07:58:41 +02:00
Weblate
b961b59ad4 Merge remote-tracking branch 'origin/master' 2017-07-17 23:14:27 +02:00
Matej U
d2fbb86d8a Translated using Weblate (Slovenian)
Currently translated at 98.2% (164 of 167 strings)
2017-07-17 23:14:27 +02:00
Mauricio Colli
782c6211d0 Added translation using Weblate (Lithuanian) 2017-07-17 23:14:24 +02:00
Christian Schabesberger
c0dd11b61a move on to v0.9.10 2017-07-15 23:01:34 +02:00
Weblate
885830849e Merge remote-tracking branch 'origin/master' 2017-07-15 15:45:49 +02:00
Coffeemaker
079958f66b Translated using Weblate (German)
Currently translated at 97.6% (164 of 168 strings)
2017-07-15 15:45:48 +02:00
naofum
77c5d7d160 Translated using Weblate (Japanese)
Currently translated at 94.0% (158 of 168 strings)
2017-07-15 15:45:38 +02:00
Mauricio Colli
327195dcca Merge pull request #628 from coffeemakr/fix-make-github-url-untranslatable
Make github_url not translatable
2017-07-13 22:06:21 -03:00
Coffeemakr
cfbc88d375 Make github_url not translatable 2017-07-13 22:05:47 +02:00
Tobias Groza
d75a11b397 Translated using Weblate (German)
Currently translated at 94.6% (159 of 168 strings)
2017-07-13 22:02:54 +02:00
Freddy Morán Jr
8706da2890 Translated using Weblate (Spanish)
Currently translated at 100.0% (168 of 168 strings)
2017-07-13 20:25:43 +02:00
monolifed
824a06c39b Translated using Weblate (Turkish)
Currently translated at 100.0% (168 of 168 strings)
2017-07-12 19:52:00 +02:00
Nathan Follens
9c80c37ee9 Translated using Weblate (Dutch)
Currently translated at 100.0% (168 of 168 strings)
2017-07-12 18:51:06 +02:00
Weblate
ad6d383ee2 Merge remote-tracking branch 'origin/master' 2017-07-12 18:44:34 +02:00
Tobias Groza
5251f970b7 Translated using Weblate (German)
Currently translated at 100.0% (151 of 151 strings)
2017-07-12 18:44:33 +02:00
Coin
2225927bb1 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (151 of 151 strings)
2017-07-12 18:44:28 +02:00
Mauricio Colli
d210b600d7 Merge pull request #625 from coffeemakr/fix-nullpointer-in-background-handler
Check if view still exists in UICallback
2017-07-12 08:46:20 -03:00
Coffeemakr
70da5769d4 Check if view still exists in UICallback 2017-07-12 09:51:23 +02:00
Mauricio Colli
69e3814c77 Merge pull request #612 from coffeemakr/feature-about-activity
Add about activity
2017-07-11 12:49:14 -03:00
Coffeemakr
d950e11332 Small fixes for AboutActivity
* Remove parent activity
 * Finish activity on "up action"
 * Remove unused dimensions
2017-07-11 12:52:20 +02:00
Weblate
1a2b18f722 Merge remote-tracking branch 'origin/master' 2017-07-10 18:13:22 +02:00
George Netu
af78369f87 Translated using Weblate (Romanian)
Currently translated at 99.3% (150 of 151 strings)
2017-07-10 18:13:21 +02:00
Coin
8e4aca0582 Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (151 of 151 strings)
2017-07-10 18:13:18 +02:00
Mauricio Colli
b603c178d1 Fix focus search fragment 2017-07-10 00:25:10 -03:00
Mauricio Colli
31e5a7afb0 Improve navigation/backstack 2017-07-10 00:14:24 -03:00
Mauricio Colli
6fb1847327 Update gradle wrapper version 2017-07-09 23:22:46 -03:00
Mauricio Colli
0c1d773134 Merge pull request #596 from marcobiscaro2112/master
Adds support for adjustable playback speed
2017-07-09 22:49:05 -03:00
Mauricio Colli
894ea27df2 Fix issues #596 2017-07-09 22:38:47 -03:00
Coffeemakr
f13731f91e Add about activity 2017-07-05 19:35:15 +02:00
Weblate
6742cbfd59 Merge remote-tracking branch 'origin/master' 2017-07-05 18:44:18 +02:00
Osoitz
6c0dea6138 Translated using Weblate (Basque)
Currently translated at 100.0% (151 of 151 strings)
2017-07-05 18:44:14 +02:00
Mauricio Colli
388e8d0c2f Merge pull request #607 from coffeemakr/fix-remove-bottom-margin-2
Fix margin at the bottom (v2)
2017-07-04 13:33:19 -03:00
Weblate
27b455592a Merge remote-tracking branch 'origin/master' 2017-07-03 16:36:40 +02:00
Osoitz
dad1c04528 Translated using Weblate (Basque)
Currently translated at 100.0% (151 of 151 strings)
2017-07-03 16:36:35 +02:00
Coffeemakr
4ad9fcdc6f Revert error/retry/loading changes 2017-07-02 22:22:37 +02:00
Christian Schabesberger
81b7fe0e9c Merge pull request #606 from edcaron/patch-1
fix f-droid repository link
2017-07-02 22:16:42 +02:00
Eduardo Caron
735cc8d6cc fix f-droid repository link 2017-07-02 16:14:22 -03:00
Christian Schabesberger
43a1c4ce11 move on to v0.9.9 2017-06-30 21:34:28 +02:00
Mauricio Colli
9ca048a881 Merge pull request #600 from coffeemakr/feature-code-improvements
Remove unused code
2017-06-29 17:51:33 -03:00
Coffeemakr
bab3dd417e Remove unused code
* Remove Giga crash handler
 * Some refactoring
 * Remove unused download dialog
 * Remove duplicated intent creation
2017-06-29 12:54:07 +02:00
Weblate
11541310d6 Merge remote-tracking branch 'origin/master' 2017-06-29 07:50:35 +02:00
Anton Shestakov
76740303c5 Translated using Weblate (Russian)
Currently translated at 100.0% (151 of 151 strings)
2017-06-29 07:50:32 +02:00
Mauricio Colli
0a7ecb89ce Adjust fragments' enter/exit animations
- Make a little bit faster
2017-06-28 16:38:13 -03:00
Mauricio Colli
c16a7d5da2 Merge pull request #599 from coffeemakr/feature-code-improvements
Code Improvements
2017-06-28 16:28:16 -03:00
Coffeemakr
b03723c3fb Code improvements
* Replace unchecked casts with checked casts
 * remove Utility.finViewById
 * Fix return activity checking
 * Create UserAction enum
 * Fix typos
 * Add instrumented test for error info
 * ErrorInfo make fields final
 * Log exception using logger
 * Add inherited annotations
 * Resolve deprecation warnings
 * Remove unused methods from utility
 * Reformat code
 * Remove unused methods from Utility and improve getFileExt
 * Create OnScrollBelowItemsListener
2017-06-28 18:56:05 +02:00
Mauricio Colli
40213b2d6a Fix autoplay
- Closes #595
2017-06-27 22:39:33 -03:00
Mauricio Colli
e8b71e867c Merge pull request #588 from coffeemakr/feature-speedup
Speed up detail page loading ⏱
2017-06-27 18:12:30 -03:00
Coffeemakr
8ab1b7fd8f Fix loading and retry positioning 2017-06-27 22:36:31 +02:00
Coffeemakr
8009aa975e Revert unused changes 2017-06-27 14:11:15 +02:00
Coffeemakr
cea706d14a Synchronize initRealtedVideoStreams* 2017-06-27 12:44:20 +02:00
Marco Biscaro
7b60648424 Adds support for adjustable playback speed
ExoPlayer was updated to 2.4.2, which supports playback speed change.

A speed selector was also added in the MainPlayer and PlayerPopup.

Fixes #153.
2017-06-26 19:22:16 -03:00
Eduardo Caron
3cb4952281 Translated using Weblate (Portuguese)
Currently translated at 93.3% (141 of 151 strings)
2017-06-26 21:46:21 +02:00
Coffeemakr
ec1ae647b0 Revert toolbar_search_clear 2017-06-26 14:19:42 +02:00
Coffeemakr
a3be9f36b3 Fix landscape stream item height 2017-06-26 12:42:35 +02:00
Weblate
451910763d Merge remote-tracking branch 'origin/master' 2017-06-19 12:46:26 +02:00
Coffeemaker
884dc38701 Translated using Weblate (German)
Currently translated at 100.0% (151 of 151 strings)
2017-06-19 12:46:26 +02:00
Anton Shestakov
3cca7aead9 Translated using Weblate (Russian)
Currently translated at 96.0% (145 of 151 strings)
2017-06-19 12:46:24 +02:00
Coffeemakr
4c4852129e Layout fixes
* Add selectableItemBackground to the player button
* Make uploader margin to padding
* Convert layout gravity center_horizontal to width=match_parent
2017-06-18 17:25:13 +02:00
Coffeemakr
ae2b0cc76b Format code and remove unused methods 2017-06-18 15:43:11 +02:00
Coffeemakr
71e963c853 Correct icons and title alignment 2017-06-17 14:19:55 +02:00
Coffeemakr
89b680f6d9 Revert RecyclerView to LinearLayout 2017-06-17 13:43:09 +02:00
Christian Schabesberger
f3eacac4ce Merge pull request #586 from coffeemakr/fix-spaces-in-folder
Fix download path handling (#580)
2017-06-16 18:05:05 +02:00
Anton Shestakov
26ec32cbe1 Translated using Weblate (Russian)
Currently translated at 95.3% (144 of 151 strings)
2017-06-16 15:46:23 +02:00
Coffeemakr
6d74038866 Improve speed
* Replace relative layouts and use Recycler view
 * Handle HTML in background
2017-06-16 14:02:45 +02:00
Kristoffer Grundström
7e45e88914 Translated using Weblate (Swedish)
Currently translated at 66.8% (101 of 151 strings)
2017-06-15 03:46:30 +02:00
Coffeemakr
62a4869eb7 Fix download path handling (#580) 2017-06-13 10:47:40 +02:00
Weblate
4f8b51701b Merge remote-tracking branch 'origin/master' 2017-06-13 00:53:12 +02:00
Kristoffer Grundström
169bcc2550 Added translation using Weblate (Swedish) 2017-06-13 00:53:09 +02:00
296 changed files with 16755 additions and 8499 deletions

View File

@@ -1,40 +1,42 @@
NewPipe contribution guidelines
===============================
READ THIS GUIDELINES CAREFULLY BEFORE CONTRIBUTING.
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 if a crash occures.
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.
## Issue reporting/feature request
## Issue reporting/feature requests
* Search the [existing issues](https://github.com/theScrabi/NewPipe/issues) first to make sure your issue/feature hasn't been reported/requested before
* Check if this issue/feature is already fixed/implemented in the repository
* If you are an android/java developer you are always welcome to fix/implement an issue/a feature yourself
* Use english
* 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
* 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.
## Bugfixing
* If you want to help NewPipe getting bug free, you can send me a mail to tnp@newpipe.schabi.org to let me know that you intent to help, and than register at our [sentry](https://support.schabi.org) setup.
## 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 on [weblate](https://hosted.weblate.org/projects/newpipe/strings/)
* NewPipe can be translated via [Weblate](https://hosted.weblate.org/projects/newpipe/strings/). You can log in there with your GitHub account.
## Code contribution
* Stick to NewPipe style guidelines (just look the other code and than do it the same way :) )
* Do not bring nonfree software/binary blobs into the project (keep it google free)
* 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 (Feature-branching)
* When submitting changes, you agree that your code will be licensed under GPLv3
* Please test (compile and run) your code before you submit changes!!!
* Try to figure out you selves why CI fails, or why a merge request collides
* Please maintain your code after you contributed it.
* Respond yourselves if someone request changes or notifies issues
* 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 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
* 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!
* Try to figure out yourself why builds on our CI fail.
* Make sure your PR is up-to-date with the rest of the code. Often, a simple click on "Update branch" will do the job, but if not, you are asked to merge the master branch manually and resolve the problems on your own. That will make the maintainers' jobs way easier.
* Please show intention to maintain your features and code after you contributed it. Unmaintained code is a hassle for the core developers, and just adds work. If you do not intend to maintain features you contributed, please think again about sumission, or clearly state that in the description of your PR.
* Respond yourselves if someone requests changes or otherwise raises issues about your PRs.
## Communication
* WE DO NOW HAVE A MAILING LIST: [newpipe@list.schabi.org](https://list.schabi.org/cgi-bin/mailman/listinfo/newpipe).
* If you want to get in contact with me or one of our other contributors you can send me an email at tnp(at)schabi.org
* Feel free to post suggestions, changes, ideas etc!
* 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!

View File

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

View File

@@ -5,10 +5,10 @@ android:
components:
# The BuildTools version used by NewPipe
- tools
- build-tools-25.0.2
- build-tools-26.0.1
# The SDK version used to compile NewPipe
- android-25
- android-26
# Additional components
- extra-android-m2repository
@@ -17,4 +17,3 @@ script: ./gradlew -Dorg.gradle.jvmargs=-Xmx1536m assembleDebug lintDebug testDeb
licenses:
- '.+'

View File

@@ -1,10 +1,10 @@
WARNING: PUTTING NEWPIPE OR ANY FORK OF IT INTO GOOGLE PLAYSTORE VIOLATES THEIR TERMS OF CONDITIONS.
# NewPipe
NewPipe: A free lightweight Youtube frontend for Android.
NewPipe: A free lightweight YouTube frontend for Android.
[![NewPipe](app/src/main/res/mipmap-xhdpi/ic_launcher.png)](https://newpipe.schabi.org)
[![F-Droid](https://f-droid.org/wiki/images/0/06/F-Droid-button_get-it-on.png)](https://f-droid.org/repository/browse/?fdfilter=newpipe&fdid=org.schabi.newpipe)
[![F-Droid](https://f-droid.org/wiki/images/0/06/F-Droid-button_get-it-on.png)](https://f-droid.org/packages/org.schabi.newpipe/)
Project status:
@@ -70,7 +70,7 @@ NewPipe does not use any Google framework libraries, or the YouTube API. It only
Although NewPipe only supports YouTube at the moment, it's designed to support many more streaming services. The plan is, that NewPipe will get such support by the version 2.0.
## Contribution
Whether you have ideas, translation, design changes, code cleaning, or real heavy code changes, help is always welcome.
Whether you have ideas, translations, design changes, code cleaning, or real heavy code changes, help is always welcome.
The more is done the better it gets!
If you'd like to get involved, check our [contribution notes](.github/CONTRIBUTING.md).

View File

@@ -1,21 +1,31 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
applicationId "org.schabi.newpipe"
minSdkVersion 15
targetSdkVersion 25
versionCode 35
versionName "0.9.8"
targetSdkVersion 26
versionCode 38
versionName "0.10.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
multiDexEnabled true
debuggable true
applicationIdSuffix ".debug"
}
}
lintOptions {
@@ -31,24 +41,42 @@ android {
}
dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
exclude module: 'support-annotations'
}
compile 'com.github.TeamNewPipe:NewPipeExtractor:7ae274b'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.json:json:20160810'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.android.support:preference-v14:26.0.1'
compile 'com.google.code.gson:gson:2.7'
compile 'org.jsoup:jsoup:1.8.3'
compile 'org.mozilla:rhino:1.7.7'
compile 'ch.acra:acra:4.9.0'
compile 'info.guardianproject.netcipher:netcipher:1.2'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.github.nirhart:parallaxscroll:1.0'
compile 'com.nononsenseapps:filepicker:3.0.0'
compile 'com.google.android.exoplayer:exoplayer:r2.3.1'
compile 'com.google.android.exoplayer:exoplayer:r2.5.1'
debugCompile 'com.facebook.stetho:stetho:1.5.0'
debugCompile 'com.facebook.stetho:stetho-urlconnection:1.5.0'
debugCompile 'com.android.support:multidex:1.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.2'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
compile 'android.arch.persistence.room:runtime:1.0.0-alpha8'
compile 'android.arch.persistence.room:rxjava2:1.0.0-alpha8'
annotationProcessor 'android.arch.persistence.room:compiler:1.0.0-alpha8'
compile 'frankiesardo:icepick:3.2.0'
provided 'frankiesardo:icepick-processor:3.2.0'
}

View File

@@ -15,3 +15,13 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-dontobfuscate
-keep class org.mozilla.javascript.** { *; }
-keep class org.mozilla.classfile.ClassFileWriter
-keep class com.google.android.exoplayer2.** { *; }
-dontwarn org.mozilla.javascript.tools.**
-dontwarn android.arch.util.paging.CountedDataSource
-dontwarn android.arch.persistence.room.paging.LimitOffsetDataSource

View File

@@ -0,0 +1,37 @@
package org.schabi.newpipe.report;
import android.os.Parcel;
import android.support.test.filters.LargeTest;
import android.support.test.runner.AndroidJUnit4;
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}
*/
@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);
// Obtain a Parcel object and write the parcelable object to it:
Parcel parcel = Parcel.obtain();
info.writeToParcel(parcel, 0);
parcel.setDataPosition(0);
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);
parcel.recycle();
}
}

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.schabi.newpipe">
<application
android:name=".DebugApp"
android:label="NewPipe Debug"
tools:replace="android:name, android:label">
<activity
android:name=".MainActivity"
android:label="NewPipe Debug"
tools:replace="android:label"/>
</application>
</manifest>

View File

@@ -0,0 +1,45 @@
package org.schabi.newpipe;
import android.content.Context;
import android.support.multidex.MultiDex;
import com.facebook.stetho.Stetho;
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();
}
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);
}
}

View File

@@ -16,11 +16,12 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:logo="@mipmap/ic_launcher"
android:theme="@style/AppTheme"
android:theme="@style/DarkTheme"
tools:ignore="AllowBackup">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
android:label="@string/app_name"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
@@ -28,7 +29,7 @@
</activity>
<activity
android:name=".player.PlayVideoActivity"
android:name=".player.old.PlayVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/VideoPlayerTheme"
tools:ignore="UnusedAttribute"/>
@@ -51,6 +52,15 @@
<activity
android:name=".settings.SettingsActivity"
android:label="@string/settings"/>
<activity
android:name=".about.AboutActivity"
android:label="@string/title_activity_about"/>
<activity
android:name=".history.HistoryActivity"
android:label="@string/title_activity_history"/>
<activity
android:name=".PanicResponderActivity"
android:launchMode="singleInstance"
@@ -62,6 +72,7 @@
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity
android:name=".ExitActivity"
android:label="@string/general_error"
@@ -72,8 +83,7 @@
<activity
android:name=".download.DownloadActivity"
android:label="@string/app_name"
android:launchMode="singleTask"
android:theme="@style/AppTheme"/>
android:launchMode="singleTask"/>
<service android:name="us.shandian.giga.service.DownloadManagerService"/>
@@ -82,6 +92,7 @@
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/FilePickerTheme"/>
<activity
android:name=".ReCaptchaActivity"
android:label="@string/reCaptchaActivity"/>
@@ -121,6 +132,8 @@
<!-- channel prefix -->
<data android:pathPrefix="/channel/"/>
<data android:pathPrefix="/user/"/>
<!-- playlist prefix -->
<data android:pathPrefix="/playlist"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
@@ -154,12 +167,11 @@
<data android:mimeType="text/plain"/>
</intent-filter>
</activity>
<activity
android:name=".RouterPopupActivity"
android:label="@string/popup_mode_share_menu_title"
android:taskAffinity=""
android:theme="@android:style/Theme.NoDisplay"
android:label="@string/popup_mode_share_menu_title">
android:theme="@android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
@@ -209,7 +221,5 @@
<data android:mimeType="text/plain"/>
</intent-filter>
</activity>
</application>
</manifest>
</manifest>

View File

@@ -0,0 +1,162 @@
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Apache License - Version 2.0, January 2004</title>
</head>
<body>
<p>Apache License<br>Version 2.0, January 2004<br>
<a href="http://www.apache.org/licenses/">http://www.apache.org/licenses/</a> </p>
<p>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</p>
<p><strong><a name="definitions">1. Definitions</a></strong>.</p>
<p>"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.</p>
<p>"Licensor" shall mean the copyright owner or entity authorized by the
copyright owner that is granting the License.</p>
<p>"Legal Entity" shall mean the union of the acting entity and all other
entities that control, are controlled by, or are under common control with
that entity. For the purposes of this definition, "control" means (i) the
power, direct or indirect, to cause the direction or management of such
entity, whether by contract or otherwise, or (ii) ownership of fifty
percent (50%) or more of the outstanding shares, or (iii) beneficial
ownership of such entity.</p>
<p>"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.</p>
<p>"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation source,
and configuration files.</p>
<p>"Object" form shall mean any form resulting from mechanical transformation
or translation of a Source form, including but not limited to compiled
object code, generated documentation, and conversions to other media types.</p>
<p>"Work" shall mean the work of authorship, whether in Source or Object form,
made available under the License, as indicated by a copyright notice that
is included in or attached to the work (an example is provided in the
Appendix below).</p>
<p>"Derivative Works" shall mean any work, whether in Source or Object form,
that is based on (or derived from) the Work and for which the editorial
revisions, annotations, elaborations, or other modifications represent, as
a whole, an original work of authorship. For the purposes of this License,
Derivative Works shall not include works that remain separable from, or
merely link (or bind by name) to the interfaces of, the Work and Derivative
Works thereof.</p>
<p>"Contribution" shall mean any work of authorship, including the original
version of the Work and any modifications or additions to that Work or
Derivative Works thereof, that is intentionally submitted to Licensor for
inclusion in the Work by the copyright owner or by an individual or Legal
Entity authorized to submit on behalf of the copyright owner. For the
purposes of this definition, "submitted" means any form of electronic,
verbal, or written communication sent to the Licensor or its
representatives, including but not limited to communication on electronic
mailing lists, source code control systems, and issue tracking systems that
are managed by, or on behalf of, the Licensor for the purpose of discussing
and improving the Work, but excluding communication that is conspicuously
marked or otherwise designated in writing by the copyright owner as "Not a
Contribution."</p>
<p>"Contributor" shall mean Licensor and any individual or Legal Entity on
behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.</p>
<p><strong><a name="copyright">2. Grant of Copyright License</a></strong>. Subject to the
terms and conditions of this License, each Contributor hereby grants to You
a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of, publicly
display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.</p>
<p><strong><a name="patent">3. Grant of Patent License</a></strong>. Subject to the terms
and conditions of this License, each Contributor hereby grants to You a
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made, use,
offer to sell, sell, import, and otherwise transfer the Work, where such
license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by
combination of their Contribution(s) with the Work to which such
Contribution(s) was submitted. If You institute patent litigation against
any entity (including a cross-claim or counterclaim in a lawsuit) alleging
that the Work or a Contribution incorporated within the Work constitutes
direct or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate as of the
date such litigation is filed.</p>
<p><strong><a name="redistribution">4. Redistribution</a></strong>. You may reproduce and
distribute copies of the Work or Derivative Works thereof in any medium,
with or without modifications, and in Source or Object form, provided that
You meet the following conditions:</p>
<ol style="list-style: lower-latin;">
<li>You must give any other recipients of the Work or Derivative Works a
copy of this License; and</li>
<li>You must cause any modified files to carry prominent notices stating
that You changed the files; and</li>
<li>You must retain, in the Source form of any Derivative Works that You
distribute, all copyright, patent, trademark, and attribution notices from
the Source form of the Work, excluding those notices that do not pertain to
any part of the Derivative Works; and</li>
<li>If the Work includes a "NOTICE" text file as part of its distribution,
then any Derivative Works that You distribute must include a readable copy
of the attribution notices contained within such NOTICE file, excluding
those notices that do not pertain to any part of the Derivative Works, in
at least one of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or documentation,
if provided along with the Derivative Works; or, within a display generated
by the Derivative Works, if and wherever such third-party notices normally
appear. The contents of the NOTICE file are for informational purposes only
and do not modify the License. You may add Your own attribution notices
within Derivative Works that You distribute, alongside or as an addendum to
the NOTICE text from the Work, provided that such additional attribution
notices cannot be construed as modifying the License.
<br/>
<br/>
You may add Your own copyright statement to Your modifications and may
provide additional or different license terms and conditions for use,
reproduction, or distribution of Your modifications, or for any such
Derivative Works as a whole, provided Your use, reproduction, and
distribution of the Work otherwise complies with the conditions stated in
this License.
</li>
</ol>
<p><strong><a name="contributions">5. Submission of Contributions</a></strong>. Unless You
explicitly state otherwise, any Contribution intentionally submitted for
inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the
terms of any separate license agreement you may have executed with Licensor
regarding such Contributions.</p>
<p><strong><a name="trademarks">6. Trademarks</a></strong>. This License does not grant
permission to use the trade names, trademarks, service marks, or product
names of the Licensor, except as required for reasonable and customary use
in describing the origin of the Work and reproducing the content of the
NOTICE file.</p>
<p><strong><a name="no-warranty">7. Disclaimer of Warranty</a></strong>. Unless required by
applicable law or agreed to in writing, Licensor provides the Work (and
each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,
without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You
are solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise
of permissions under this License.</p>
<p><strong><a name="no-liability">8. Limitation of Liability</a></strong>. In no event and
under no legal theory, whether in tort (including negligence), contract, or
otherwise, unless required by applicable law (such as deliberate and
grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a result
of this License or out of the use or inability to use the Work (including
but not limited to damages for loss of goodwill, work stoppage, computer
failure or malfunction, or any and all other commercial damages or losses),
even if such Contributor has been advised of the possibility of such
damages.</p>
<p><strong><a name="additional">9. Accepting Warranty or Additional Liability</a></strong>.
While redistributing the Work or Derivative Works thereof, You may choose
to offer, and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this License.
However, in accepting such obligations, You may act only on Your own behalf
and on Your sole responsibility, not on behalf of any other Contributor,
and only if You agree to indemnify, defend, and hold each Contributor
harmless for any liability incurred by, or claims asserted against, such
Contributor by reason of your accepting any such warranty or additional
liability.</p>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
<html>
<head></head>
<body>
<p>Copyright (c) &lt;year&gt; &lt;copyright holders&gt;</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:</p>
<p>
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.</p>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.<br />
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
package org.schabi.newpipe;
/**
/*
* Created by Christian Schabesberger on 24.12.15.
*
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>

View File

@@ -1,7 +1,11 @@
package org.schabi.newpipe;
import android.app.Application;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.os.Build;
import android.util.Log;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
@@ -14,13 +18,22 @@ import org.acra.sender.ReportSenderFactory;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.report.AcraReportSenderFactory;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.settings.SettingsActivity;
import org.schabi.newpipe.util.ThemeHelper;
import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.StateSaver;
import info.guardianproject.netcipher.NetCipher;
import info.guardianproject.netcipher.proxy.OrbotHelper;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.SocketException;
/**
import io.reactivex.annotations.NonNull;
import io.reactivex.exceptions.CompositeException;
import io.reactivex.exceptions.UndeliverableException;
import io.reactivex.functions.Consumer;
import io.reactivex.plugins.RxJavaPlugins;
/*
* Copyright (C) Hans-Christoph Steiner 2016 <hans@eds.org>
* App.java is part of NewPipe.
*
@@ -39,73 +52,101 @@ import info.guardianproject.netcipher.proxy.OrbotHelper;
*/
public class App extends Application {
private static final String TAG = App.class.toString();
protected static final String TAG = App.class.toString();
private static boolean useTor;
@SuppressWarnings("unchecked")
private static final Class<? extends ReportSenderFactory>[] reportSenderFactoryClasses = new Class[]{AcraReportSenderFactory.class};
final Class<? extends ReportSenderFactory>[] reportSenderFactoryClasses
= new Class[]{AcraReportSenderFactory.class};
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
initACRA();
}
@Override
public void onCreate() {
super.onCreate();
// init crashreport
try {
final ACRAConfiguration acraConfig = new ConfigurationBuilder(this)
.setReportSenderFactoryClasses(reportSenderFactoryClasses)
.build();
ACRA.init(this, acraConfig);
} catch(ACRAConfigurationException ace) {
ace.printStackTrace();
ErrorActivity.reportError(this, ace, null, null,
ErrorActivity.ErrorInfo.make(ErrorActivity.SEARCHED,"none",
"Could not initialize ACRA crash report", R.string.app_ui_crash));
}
// Initialize settings first because others inits can use its values
SettingsActivity.initSettings(this);
//init NewPipe
NewPipe.init(Downloader.getInstance());
NewPipeDatabase.init(this);
StateSaver.init(this);
initNotificationChannel();
// Initialize image loader
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this).build();
ImageLoader.getInstance().init(config);
/*
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if(prefs.getBoolean(getString(R.string.use_tor_key), false)) {
OrbotHelper.requestStartTor(this);
configureTor(true);
} else {
configureTor(false);
}*/
configureTor(false);
// DO NOT REMOVE THIS FUNCTION!!!
// Otherwise downloadPathPreference has invalid value.
SettingsActivity.initSettings(this);
ThemeHelper.setTheme(getApplicationContext());
configureRxJavaErrorHandler();
}
/**
* Set the proxy settings based on whether Tor should be enabled or not.
*/
public static void configureTor(boolean enabled) {
useTor = enabled;
if (useTor) {
NetCipher.useTor();
} else {
NetCipher.setProxy(null);
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) throws Exception {
Log.e(TAG, "RxJavaPlugins.ErrorHandler called with -> : throwable = [" + throwable.getClass().getName() + "]");
if (throwable instanceof UndeliverableException) {
// As UndeliverableException is a wrapper, get the cause of it to get the "real" exception
throwable = throwable.getCause();
}
if (throwable instanceof CompositeException) {
for (Throwable element : ((CompositeException) throwable).getExceptions()) {
if (checkThrowable(element)) return;
}
}
if (checkThrowable(throwable)) return;
// Throw uncaught exception that will trigger the report system
Thread.currentThread().getUncaughtExceptionHandler()
.uncaughtException(Thread.currentThread(), throwable);
}
private boolean checkThrowable(@NonNull Throwable throwable) {
// Don't crash the application over a simple network problem
return ExtractorHelper.hasAssignableCauseThrowable(throwable,
IOException.class, SocketException.class, InterruptedException.class, InterruptedIOException.class);
}
});
}
private void initACRA() {
try {
final ACRAConfiguration acraConfig = new ConfigurationBuilder(this)
.setReportSenderFactoryClasses(reportSenderFactoryClasses)
.setBuildConfigClass(BuildConfig.class)
.build();
ACRA.init(this, acraConfig);
} catch (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));
}
}
public static void checkStartTor(Context context) {
if (useTor) {
OrbotHelper.requestStartTor(context);
public void initNotificationChannel() {
if (Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.O) {
return;
}
}
public static boolean isUsingTor() {
return useTor;
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);
// 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);
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.createNotificationChannel(mChannel);
}
}

View File

@@ -0,0 +1,121 @@
package org.schabi.newpipe;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.annotation.AttrRes;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer;
import icepick.Icepick;
public abstract class BaseFragment extends Fragment {
protected final String TAG = getClass().getSimpleName() + "@" + Integer.toHexString(hashCode());
protected boolean DEBUG = MainActivity.DEBUG;
protected AppCompatActivity activity;
public static final ImageLoader imageLoader = ImageLoader.getInstance();
/*//////////////////////////////////////////////////////////////////////////
// Fragment's Lifecycle
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onAttach(Context context) {
super.onAttach(context);
activity = (AppCompatActivity) context;
}
@Override
public void onDetach() {
super.onDetach();
activity = null;
}
@Override
public void onCreate(Bundle savedInstanceState) {
if (DEBUG) Log.d(TAG, "onCreate() called with: savedInstanceState = [" + savedInstanceState + "]");
super.onCreate(savedInstanceState);
Icepick.restoreInstanceState(this, savedInstanceState);
if (savedInstanceState != null) onRestoreInstanceState(savedInstanceState);
}
@Override
public void onViewCreated(View rootView, Bundle savedInstanceState) {
super.onViewCreated(rootView, savedInstanceState);
if (DEBUG) {
Log.d(TAG, "onViewCreated() called with: rootView = [" + rootView + "], savedInstanceState = [" + savedInstanceState + "]");
}
initViews(rootView, savedInstanceState);
initListeners();
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
Icepick.saveInstanceState(this, outState);
}
protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
}
/*//////////////////////////////////////////////////////////////////////////
// Init
//////////////////////////////////////////////////////////////////////////*/
protected void initViews(View rootView, Bundle savedInstanceState) {
}
protected void initListeners() {
}
/*//////////////////////////////////////////////////////////////////////////
// Utils
//////////////////////////////////////////////////////////////////////////*/
protected final int resolveResourceIdFromAttr(@AttrRes int attr) {
TypedArray a = activity.getTheme().obtainStyledAttributes(new int[]{attr});
int attributeResourceId = a.getResourceId(0, 0);
a.recycle();
return attributeResourceId;
}
/*//////////////////////////////////////////////////////////////////////////
// DisplayImageOptions default configurations
//////////////////////////////////////////////////////////////////////////*/
public static final DisplayImageOptions BASE_OPTIONS =
new DisplayImageOptions.Builder().cacheInMemory(true).build();
public static final DisplayImageOptions DISPLAY_AVATAR_OPTIONS =
new DisplayImageOptions.Builder()
.cloneFrom(BASE_OPTIONS)
.showImageOnLoading(R.drawable.buddy)
.showImageForEmptyUri(R.drawable.buddy)
.showImageOnFail(R.drawable.buddy)
.build();
public static final DisplayImageOptions DISPLAY_THUMBNAIL_OPTIONS =
new DisplayImageOptions.Builder()
.cloneFrom(BASE_OPTIONS)
.displayer(new FadeInBitmapDisplayer(250))
.showImageForEmptyUri(R.drawable.dummy_thumbnail)
.showImageOnFail(R.drawable.dummy_thumbnail)
.build();
public static final DisplayImageOptions DISPLAY_BANNER_OPTIONS =
new DisplayImageOptions.Builder()
.cloneFrom(BASE_OPTIONS)
.showImageOnLoading(R.drawable.channel_banner)
.showImageForEmptyUri(R.drawable.channel_banner)
.showImageOnFail(R.drawable.channel_banner)
.build();
}

View File

@@ -1,20 +1,24 @@
package org.schabi.newpipe;
import android.util.Log;
import org.schabi.newpipe.extractor.exceptions.ReCaptchaException;
import org.schabi.newpipe.util.ExtractorHelper;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.InterruptedIOException;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
/**
/*
* Created by Christian Schabesberger on 28.01.16.
*
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
@@ -35,16 +39,17 @@ import javax.net.ssl.HttpsURLConnection;
*/
public class Downloader implements org.schabi.newpipe.extractor.Downloader {
private static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0";
public static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0";
private static String mCookies = "";
private static Downloader instance = null;
private Downloader() {}
private Downloader() {
}
public static Downloader getInstance() {
if(instance == null) {
if (instance == null) {
synchronized (Downloader.class) {
if (instance == null) {
instance = new Downloader();
@@ -62,41 +67,66 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader {
return Downloader.mCookies;
}
/**Download the text file at the supplied URL as in download(String),
/**
* Download the text file at the supplied URL as in download(String),
* but set the HTTP header field "Accept-Language" to the supplied string.
* @param siteUrl the URL of the text file to return the contents of
*
* @param siteUrl the URL of the text file to return the contents of
* @param language the language (usually a 2-character code) to set as the preferred language
* @return the contents of the specified text file*/
* @return the contents of the specified text file
*/
@Override
public String download(String siteUrl, String language) throws IOException, ReCaptchaException {
Map<String, String> requestProperties = new HashMap<>();
requestProperties.put("Accept-Language", language);
return download(siteUrl, requestProperties);
}
/**Download the text file at the supplied URL as in download(String),
* but set the HTTP header field "Accept-Language" to the supplied string.
* @param siteUrl the URL of the text file to return the contents of
/**
* Download the text file at the supplied URL as in download(String),
* but set the HTTP headers included in the customProperties map.
*
* @param siteUrl the URL of the text file to return the contents of
* @param customProperties set request header properties
* @return the contents of the specified text file
* @throws IOException*/
* @throws IOException
*/
@Override
public String download(String siteUrl, Map<String, String> customProperties) throws IOException, ReCaptchaException {
URL url = new URL(siteUrl);
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
Iterator it = customProperties.entrySet().iterator();
while(it.hasNext()) {
Map.Entry pair = (Map.Entry)it.next();
con.setRequestProperty((String)pair.getKey(), (String)pair.getValue());
while (it.hasNext()) {
Map.Entry pair = (Map.Entry) it.next();
con.setRequestProperty((String) pair.getKey(), (String) pair.getValue());
}
return dl(con);
}
/**Common functionality between download(String url) and download(String url, String language)*/
/**
* Download (via HTTP) the text file located at the supplied URL, and return its contents.
* Primarily intended for downloading web pages.
*
* @param siteUrl the URL of the text file to download
* @return the contents of the specified text file
*/
@Override
public String download(String siteUrl) throws IOException, ReCaptchaException {
URL url = new URL(siteUrl);
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
//HttpsURLConnection con = NetCipher.getHttpsURLConnection(url);
return dl(con);
}
/**
* Common functionality between download(String url) and download(String url, String language)
*/
private static String dl(HttpsURLConnection con) throws IOException, ReCaptchaException {
StringBuilder response = new StringBuilder();
BufferedReader in = null;
try {
con.setReadTimeout(30 * 1000);// 30s
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", USER_AGENT);
@@ -104,17 +134,22 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader {
con.setRequestProperty("Cookie", getCookies());
}
in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
in = new BufferedReader(new InputStreamReader(con.getInputStream()));
for (Map.Entry<String, List<String>> entry : con.getHeaderFields().entrySet()) {
System.err.println(entry.getKey() + ": " + entry.getValue());
}
String inputLine;
while((inputLine = in.readLine()) != null) {
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
} catch(UnknownHostException uhe) {//thrown when there's no internet connection
throw new IOException("unknown host or no network", uhe);
//Toast.makeText(getActivity(), uhe.getMessage(), Toast.LENGTH_LONG).show();
} catch(Exception e) {
} catch (Exception e) {
Log.e("Downloader", "dl() ----- Exception thrown → " + e.getClass().getName());
if (ExtractorHelper.isInterruptedCaused(e)) {
throw new InterruptedIOException(e.getMessage());
}
/*
* HTTP 429 == Too Many Request
* Receive from Youtube.com = ReCaptcha challenge request
@@ -123,24 +158,14 @@ public class Downloader implements org.schabi.newpipe.extractor.Downloader {
if (con.getResponseCode() == 429) {
throw new ReCaptchaException("reCaptcha Challenge requested");
}
throw new IOException(e);
throw new IOException(con.getResponseCode() + " " + con.getResponseMessage(), e);
} finally {
if(in != null) {
if (in != null) {
in.close();
}
}
return response.toString();
}
/**Download (via HTTP) the text file located at the supplied URL, and return its contents.
* Primarily intended for downloading web pages.
* @param siteUrl the URL of the text file to download
* @return the contents of the specified text file*/
public String download(String siteUrl) throws IOException, ReCaptchaException {
URL url = new URL(siteUrl);
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
//HttpsURLConnection con = NetCipher.getHttpsURLConnection(url);
return dl(con);
}
}

View File

@@ -7,7 +7,7 @@ import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
/**
/*
* Copyright (C) Hans-Christoph Steiner 2016 <hans@eds.org>
* ExitActivity.java is part of NewPipe.
*

View File

@@ -1,64 +0,0 @@
package org.schabi.newpipe;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.View;
import com.nostra13.universalimageloader.core.assist.FailReason;
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.report.ErrorActivity;
/**
* Created by Christian Schabesberger on 01.08.16.
*
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
* StreamInfoItemViewCreator.java is part of NewPipe.
*
* 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.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/
public class ImageErrorLoadingListener implements ImageLoadingListener {
private int serviceId = -1;
private Context context = null;
private View rootView = null;
public ImageErrorLoadingListener(Context context, View rootView, int serviceId) {
this.context = context;
this.serviceId= serviceId;
this.rootView = rootView;
}
@Override
public void onLoadingStarted(String imageUri, View view) {}
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
ErrorActivity.reportError(context,
failReason.getCause(), null, rootView,
ErrorActivity.ErrorInfo.make(ErrorActivity.LOAD_IMAGE,
NewPipe.getNameOfService(serviceId), imageUri,
R.string.could_not_load_image));
}
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
}
@Override
public void onLoadingCancelled(String imageUri, View view) {}
}

View File

@@ -23,9 +23,11 @@ package org.schabi.newpipe;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
@@ -35,20 +37,37 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import org.schabi.newpipe.download.DownloadActivity;
import org.schabi.newpipe.database.AppDatabase;
import org.schabi.newpipe.database.history.dao.HistoryDAO;
import org.schabi.newpipe.database.history.dao.SearchHistoryDAO;
import org.schabi.newpipe.database.history.dao.WatchHistoryDAO;
import org.schabi.newpipe.database.history.model.HistoryEntry;
import org.schabi.newpipe.database.history.model.SearchHistoryEntry;
import org.schabi.newpipe.database.history.model.WatchHistoryEntry;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.fragments.MainFragment;
import org.schabi.newpipe.extractor.stream.AudioStream;
import org.schabi.newpipe.extractor.stream.StreamInfo;
import org.schabi.newpipe.extractor.stream.VideoStream;
import org.schabi.newpipe.fragments.BackPressable;
import org.schabi.newpipe.fragments.detail.VideoDetailFragment;
import org.schabi.newpipe.fragments.search.SearchFragment;
import org.schabi.newpipe.settings.SettingsActivity;
import org.schabi.newpipe.fragments.list.search.SearchFragment;
import org.schabi.newpipe.history.HistoryListener;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PermissionHelper;
import org.schabi.newpipe.util.StateSaver;
import org.schabi.newpipe.util.ThemeHelper;
public class MainActivity extends AppCompatActivity {
import java.util.Date;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.subjects.PublishSubject;
public class MainActivity extends AppCompatActivity implements HistoryListener {
private static final String TAG = "MainActivity";
public static final boolean DEBUG = false;
private SharedPreferences sharedPreferences;
/*//////////////////////////////////////////////////////////////////////////
// Activity's LifeCycle
@@ -65,8 +84,21 @@ public class MainActivity extends AppCompatActivity {
initFragments();
}
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
initHistory();
}
@Override
protected void onDestroy() {
super.onDestroy();
if (!isChangingConfigurations()) {
StateSaver.clearStateFiles();
}
disposeHistory();
}
@Override
@@ -77,7 +109,14 @@ public class MainActivity extends AppCompatActivity {
if (sharedPreferences.getBoolean(Constants.KEY_THEME_CHANGE, false)) {
if (DEBUG) Log.d(TAG, "Theme has changed, recreating activity...");
sharedPreferences.edit().putBoolean(Constants.KEY_THEME_CHANGE, false).apply();
this.recreate();
// https://stackoverflow.com/questions/10844112/runtimeexception-performing-pause-of-activity-that-is-not-resumed
// Briefly, let the activity resume properly posting the recreate call to end of the message queue
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public void run() {
MainActivity.this.recreate();
}
});
}
}
@@ -102,14 +141,15 @@ public class MainActivity extends AppCompatActivity {
if (DEBUG) Log.d(TAG, "onBackPressed() called");
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_holder);
if (fragment instanceof VideoDetailFragment) if (((VideoDetailFragment) fragment).onActivityBackPressed()) return;
super.onBackPressed();
fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_holder);
if (getSupportFragmentManager().getBackStackEntryCount() == 0 && !(fragment instanceof MainFragment)) {
super.onBackPressed();
// 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;
}
if (getSupportFragmentManager().getBackStackEntryCount() == 1) {
finish();
} else super.onBackPressed();
}
/*//////////////////////////////////////////////////////////////////////////
@@ -147,27 +187,20 @@ public class MainActivity extends AppCompatActivity {
int id = item.getItemId();
switch (id) {
case android.R.id.home: {
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_holder);
if (fragment instanceof VideoDetailFragment) ((VideoDetailFragment) fragment).clearHistory();
getSupportFragmentManager().popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
NavigationHelper.openMainFragment(getSupportFragmentManager());
case android.R.id.home:
NavigationHelper.gotoMainFragment(getSupportFragmentManager());
return true;
}
case R.id.action_settings: {
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
case R.id.action_settings:
NavigationHelper.openSettings(this);
return true;
}
case R.id.action_show_downloads: {
if (!PermissionHelper.checkStoragePermissions(this)) {
return false;
}
Intent intent = new Intent(this, DownloadActivity.class);
startActivity(intent);
case R.id.action_show_downloads:
return NavigationHelper.openDownloads(this);
case R.id.action_about:
NavigationHelper.openAbout(this);
return true;
case R.id.action_history:
NavigationHelper.openHistory(this);
return true;
}
default:
return super.onOptionsItemSelected(item);
}
@@ -178,9 +211,11 @@ public class MainActivity extends AppCompatActivity {
//////////////////////////////////////////////////////////////////////////*/
private void initFragments() {
if (getIntent() != null && getIntent().hasExtra(Constants.KEY_URL)) {
if (DEBUG) Log.d(TAG, "initFragments() called");
StateSaver.clearStateFiles();
if (getIntent() != null && getIntent().hasExtra(Constants.KEY_LINK_TYPE)) {
handleIntent(getIntent());
} else NavigationHelper.openMainFragment(getSupportFragmentManager());
} else NavigationHelper.gotoMainFragment(getSupportFragmentManager());
}
/*//////////////////////////////////////////////////////////////////////////
@@ -202,6 +237,9 @@ public class MainActivity extends AppCompatActivity {
case CHANNEL:
NavigationHelper.openChannelFragment(getSupportFragmentManager(), serviceId, url, title);
break;
case PLAYLIST:
NavigationHelper.openPlaylistFragment(getSupportFragmentManager(), serviceId, url, title);
break;
}
} else if (intent.hasExtra(Constants.KEY_OPEN_SEARCH)) {
String searchQuery = intent.getStringExtra(Constants.KEY_QUERY);
@@ -209,8 +247,78 @@ public class MainActivity extends AppCompatActivity {
int serviceId = intent.getIntExtra(Constants.KEY_SERVICE_ID, 0);
NavigationHelper.openSearchFragment(getSupportFragmentManager(), serviceId, searchQuery);
} else {
getSupportFragmentManager().popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
NavigationHelper.openMainFragment(getSupportFragmentManager());
NavigationHelper.gotoMainFragment(getSupportFragmentManager());
}
}
/*//////////////////////////////////////////////////////////////////////////
// History
//////////////////////////////////////////////////////////////////////////*/
private WatchHistoryDAO watchHistoryDAO;
private SearchHistoryDAO searchHistoryDAO;
private PublishSubject<HistoryEntry> historyEntrySubject;
private Disposable disposable;
private void initHistory() {
final AppDatabase database = NewPipeDatabase.getInstance();
watchHistoryDAO = database.watchHistoryDAO();
searchHistoryDAO = database.searchHistoryDAO();
historyEntrySubject = PublishSubject.create();
disposable = historyEntrySubject
.observeOn(Schedulers.io())
.subscribe(getHistoryEntryConsumer());
}
private void disposeHistory() {
if (disposable != null) disposable.dispose();
watchHistoryDAO = null;
searchHistoryDAO = null;
}
@NonNull
private Consumer<HistoryEntry> getHistoryEntryConsumer() {
return new Consumer<HistoryEntry>() {
@Override
public void accept(HistoryEntry historyEntry) throws Exception {
//noinspection unchecked
HistoryDAO<HistoryEntry> historyDAO = (HistoryDAO<HistoryEntry>)
(historyEntry instanceof SearchHistoryEntry ? searchHistoryDAO : watchHistoryDAO);
HistoryEntry latestEntry = historyDAO.getLatestEntry();
if (historyEntry.hasEqualValues(latestEntry)) {
latestEntry.setCreationDate(historyEntry.getCreationDate());
historyDAO.update(latestEntry);
} else {
historyDAO.insert(historyEntry);
}
}
};
}
private void addWatchHistoryEntry(StreamInfo streamInfo) {
if (sharedPreferences.getBoolean(getString(R.string.enable_watch_history_key), true)) {
WatchHistoryEntry entry = new WatchHistoryEntry(streamInfo);
historyEntrySubject.onNext(entry);
}
}
@Override
public void onVideoPlayed(StreamInfo streamInfo, VideoStream videoStream) {
addWatchHistoryEntry(streamInfo);
}
@Override
public void onAudioPlayed(StreamInfo streamInfo, AudioStream audioStream) {
addWatchHistoryEntry(streamInfo);
}
@Override
public void onSearch(int serviceId, String query) {
// Add search history entry
if (sharedPreferences.getBoolean(getString(R.string.enable_search_history_key), true)) {
SearchHistoryEntry searchHistoryEntry = new SearchHistoryEntry(new Date(), serviceId, query);
historyEntrySubject.onNext(searchHistoryEntry);
}
}
}

View File

@@ -0,0 +1,31 @@
package org.schabi.newpipe;
import android.arch.persistence.room.Room;
import android.content.Context;
import android.support.annotation.NonNull;
import org.schabi.newpipe.database.AppDatabase;
import static org.schabi.newpipe.database.AppDatabase.DATABASE_NAME;
public final class NewPipeDatabase {
private static AppDatabase databaseInstance;
private NewPipeDatabase() {
//no instance
}
public static void init(Context context) {
databaseInstance = Room.databaseBuilder(context.getApplicationContext(),
AppDatabase.class, DATABASE_NAME
).build();
}
@NonNull
public static AppDatabase getInstance() {
if (databaseInstance == null) throw new RuntimeException("Database not initialized");
return databaseInstance;
}
}

View File

@@ -6,9 +6,8 @@ import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.media.AudioManager;
/**
/*
* Copyright (C) Hans-Christoph Steiner 2016 <hans@eds.org>
* PanicResponderActivity.java is part of NewPipe.
*

View File

@@ -16,7 +16,7 @@ import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
/**
/*
* Created by beneth <bmauduit@beneth.fr> on 06.12.16.
*
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
@@ -49,7 +49,7 @@ public class ReCaptchaActivity extends AppCompatActivity {
// Set return to Cancel by default
setResult(RESULT_CANCELED);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
@@ -59,7 +59,7 @@ public class ReCaptchaActivity extends AppCompatActivity {
actionBar.setDisplayShowTitleEnabled(true);
}
WebView myWebView = (WebView) findViewById(R.id.reCaptchaWebView);
WebView myWebView = findViewById(R.id.reCaptchaWebView);
// Enable Javascript
WebSettings webSettings = myWebView.getSettings();

View File

@@ -1,8 +1,8 @@
package org.schabi.newpipe;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;
import org.schabi.newpipe.util.NavigationHelper;
@@ -32,7 +32,7 @@ import java.util.HashSet;
* This Acitivty is designed to route share/open intents to the specified service, and
* to the part of the service which can handle the url.
*/
public class RouterActivity extends Activity {
public class RouterActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -40,8 +40,6 @@ public class RouterActivity extends Activity {
String videoUrl = getUrl(getIntent());
handleUrl(videoUrl);
finish();
}
protected void handleUrl(String url) {
@@ -50,6 +48,8 @@ public class RouterActivity extends Activity {
} catch (Exception e) {
Toast.makeText(this, R.string.url_not_supported_toast, Toast.LENGTH_LONG).show();
}
finish();
}
/*//////////////////////////////////////////////////////////////////////////

View File

@@ -6,6 +6,7 @@ import android.widget.Toast;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.player.PopupVideoPlayer;
import org.schabi.newpipe.util.Constants;
import org.schabi.newpipe.util.PermissionHelper;
@@ -22,8 +23,10 @@ public class RouterPopupActivity extends RouterActivity {
Toast.makeText(this, R.string.msg_popup_permission, Toast.LENGTH_LONG).show();
return;
}
StreamingService service = NewPipe.getServiceByUrl(url);
if (service == null) {
StreamingService service;
try {
service = NewPipe.getServiceByUrl(url);
} catch (ExtractionException e) {
Toast.makeText(this, R.string.url_not_supported_toast, Toast.LENGTH_LONG).show();
return;
}
@@ -40,5 +43,7 @@ public class RouterPopupActivity extends RouterActivity {
callIntent.putExtra(Constants.KEY_URL, url);
callIntent.putExtra(Constants.KEY_SERVICE_ID, service.getServiceId());
startService(callIntent);
finish();
}
}

View File

@@ -0,0 +1,199 @@
package org.schabi.newpipe.about;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.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 org.schabi.newpipe.BuildConfig;
import org.schabi.newpipe.R;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ThemeHelper;
public class AboutActivity extends AppCompatActivity {
/**
* List of all software components
*/
private static final SoftwareComponent[] SOFTWARE_COMPONENTS = new SoftwareComponent[]{
new SoftwareComponent("Giga Get", "2014", "Peter Cai", "https://github.com/PaperAirplane-Dev-Team/GigaGet", StandardLicenses.GPL2),
new SoftwareComponent("NewPipe Extractor", "2017", "Christian Schabesberger", "https://github.com/TeamNewPipe/NewPipeExtractor", StandardLicenses.GPL3),
new SoftwareComponent("Jsoup", "2017", "Jonathan Hedley", "https://github.com/jhy/jsoup", StandardLicenses.MIT),
new SoftwareComponent("Google Gson", "2008", "Google Inc", "https://github.com/google/gson", StandardLicenses.APACHE2),
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 - 2017", "Henning Dodenhof", "https://github.com/hdodenhof/CircleImageView", StandardLicenses.APACHE2),
new SoftwareComponent("ParalaxScrollView", "2014", "Nir Hartmann", "https://github.com/nirhart/ParallaxScroll", StandardLicenses.MIT),
new SoftwareComponent("NoNonsense-FilePicker", "2016", "Jonas Kalderstam", "https://github.com/spacecowboy/NoNonsense-FilePicker", StandardLicenses.MPL2),
new SoftwareComponent("ExoPlayer", "2014-2017", "Google Inc", "https://github.com/google/ExoPlayer", StandardLicenses.APACHE2),
new SoftwareComponent("RxAndroid", "2015", "The RxAndroid authors", "https://github.com/ReactiveX/RxAndroid", StandardLicenses.APACHE2),
new SoftwareComponent("RxJava", "2016-present", "RxJava Contributors", "https://github.com/ReactiveX/RxJava", StandardLicenses.APACHE2),
new SoftwareComponent("RxBinding", "2015", "Jake Wharton", "https://github.com/JakeWharton/RxBinding", StandardLicenses.APACHE2)
};
/**
* The {@link android.support.v4.view.PagerAdapter} 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 android.support.v4.app.FragmentStatePagerAdapter}.
*/
private SectionsPagerAdapter mSectionsPagerAdapter;
/**
* The {@link ViewPager} that will host the section contents.
*/
private ViewPager mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ThemeHelper.setTheme(this);
setContentView(R.layout.activity_about);
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());
// 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);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_about, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch (id) {
case android.R.id.home:
finish();
return true;
case R.id.action_settings:
NavigationHelper.openSettings(this);
return true;
case R.id.action_show_downloads:
return NavigationHelper.openDownloads(this);
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
public static class AboutFragment extends Fragment {
public AboutFragment() {
}
/**
* Returns a new instance of this fragment for the given section
* number.
*/
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);
TextView version = rootView.findViewById(R.id.app_version);
version.setText(BuildConfig.VERSION_NAME);
View githubLink = rootView.findViewById(R.id.github_link);
githubLink.setOnClickListener(new OnGithubLinkClickListener());
View licenseLink = rootView.findViewById(R.id.app_read_license);
licenseLink.setOnClickListener(new OnReadFullLicenseClickListener());
return rootView;
}
private static class OnGithubLinkClickListener implements View.OnClickListener {
@Override
public void onClick(final View view) {
final Context context = view.getContext();
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(context.getString(R.string.github_url)));
context.startActivity(intent);
}
}
private static class OnReadFullLicenseClickListener implements View.OnClickListener {
@Override
public void onClick(View v) {
LicenseFragment.showLicense(v.getContext(), StandardLicenses.GPL3);
}
}
}
/**
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
* one of the sections/tabs/pages.
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return AboutFragment.newInstance();
case 1:
return LicenseFragment.newInstance(SOFTWARE_COMPONENTS);
}
return null;
}
@Override
public int getCount() {
// 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;
}
}
}

View File

@@ -0,0 +1,69 @@
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;
}
@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,150 @@
package org.schabi.newpipe.about;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
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.webkit.WebView;
import android.widget.TextView;
import org.schabi.newpipe.R;
import java.util.Arrays;
import java.util.Comparator;
/**
* Fragment containing the software licenses
*/
public class LicenseFragment extends Fragment {
private static final String ARG_COMPONENTS = "components";
private SoftwareComponent[] softwareComponents;
private SoftwareComponent mComponentForContextMenu;
public static LicenseFragment newInstance(SoftwareComponent[] softwareComponents) {
if(softwareComponents == null) {
throw new NullPointerException("softwareComponents is null");
}
LicenseFragment fragment = new LicenseFragment();
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) {
if(context == null) {
throw new NullPointerException("context is null");
}
if(license == null) {
throw new NullPointerException("license is null");
}
AlertDialog.Builder alert = new AlertDialog.Builder(context);
alert.setTitle(license.getName());
WebView wv = new WebView(context);
wv.loadUrl(license.getContentUri().toString());
alert.setView(wv);
alert.setNegativeButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alert.show();
}
@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());
}
});
}
@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);
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);
softwareName.setText(component.getName());
copyright.setText(getContext().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());
}
}
});
softwareComponentsView.addView(componentView);
registerForContextMenu(componentView);
}
return rootView;
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
MenuInflater inflater = getActivity().getMenuInflater();
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();
}
@Override
public boolean onContextItemSelected(MenuItem item) {
// item.getMenuInfo() is null so we use the tag of the view
final SoftwareComponent component = mComponentForContextMenu;
if (component == null) {
return false;
}
switch (item.getItemId()) {
case R.id.action_website:
openWebsite(component.getLink());
return true;
case R.id.action_show_license:
showLicense(getContext(), component.getLicense());
}
return false;
}
private void openWebsite(String componentLink) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(componentLink));
startActivity(browserIntent);
}
}

View File

@@ -0,0 +1,83 @@
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,12 @@
package org.schabi.newpipe.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");
}

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