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

Compare commits

...

245 Commits

Author SHA1 Message Date
Christian Schabesberger
f9ad0f12d0 Fixed serveral things:
* ugly workaround for the details_view_layout problem on older devices
* removed "display button on the left side" option since it's not nececeay anymore.
2015-12-15 22:53:29 +01:00
M2ck
63b16d925d Translated using Weblate (French)
Currently translated at 100.0% (47 of 47 strings)
2015-12-15 14:28:58 +01:00
Greg
53b9ffcbc8 Translated using Weblate (Russian)
Currently translated at 100.0% (47 of 47 strings)
2015-12-15 14:25:10 +01:00
Weblate
842079c928 Merge remote-tracking branch 'origin/master' 2015-12-15 11:57:58 +01:00
M2ck
b0bab07a15 Translated using Weblate (French)
Currently translated at 97.8% (46 of 47 strings)
2015-12-15 11:57:58 +01:00
chschtsch
4dbb12c65d update screenshots 2015-12-15 13:55:56 +03:00
chschtsch
db500e9791 fix layout issues & update screenshots 2015-12-15 13:45:59 +03:00
chschtsch
fd8f600fec update .travis.yml & move screenshots to separate folder 2015-12-15 13:04:51 +03:00
Luca Argentieri
2e2d7d02fb Translated using Weblate (Italian)
Currently translated at 100.0% (47 of 47 strings)
2015-12-14 23:03:17 +01:00
Luca Argentieri
d068cd7f75 Translated using Weblate (Italian)
Currently translated at 100% (0 of 0 strings)

Created new translation.
2015-12-14 22:38:11 +01:00
Christian Schabesberger
5a05ffcbdd Merge pull request #114 from chschtsch/cardview
Design update & refactoring
2015-12-14 20:24:22 +01:00
chschtsch
d8c7f50b39 minor layout fixes 2015-12-14 14:52:14 +03:00
chschtsch
988e6e1c82 update like buttons 2015-12-14 14:42:13 +03:00
chschtsch
f6af19444c update like buttons 2015-12-14 14:34:28 +03:00
chschtsch
0581e50e0c update viewlike buttons 2015-12-14 14:33:00 +03:00
chschtsch
a95da9a42d update views & dimens 2015-12-14 14:10:12 +03:00
chschtsch
be10b9750f mering with master 2015-12-14 13:44:15 +03:00
chschtsch
29a3cbc688 mering with master 2015-12-14 13:07:54 +03:00
chschtsch
4f57d3a201 merging with master 2015-12-14 13:01:34 +03:00
Christian Schabesberger
c9be1398b0 fixed green arrow layout error 2015-12-13 21:13:48 +01:00
halcyonest
30eef4db12 Translated using Weblate (Korean)
Currently translated at 100.0% (47 of 47 strings)
2015-12-13 13:51:55 +01:00
halcyonest
b932dbf514 Translated using Weblate (Korean)
Currently translated at 100% (0 of 0 strings)

Created new translation.
2015-12-13 13:40:17 +01:00
chschtsch
320ac82dea merging with master 2015-12-11 14:01:04 +03:00
Christian Schabesberger
af1b21db23 code_lint and moved on to v0.6.1 2015-12-09 23:17:29 +01:00
Christian Schabesberger
0e892ff60e code_lint 2015-12-09 22:31:24 +01:00
Christian Schabesberger
074963aee0 put progressbar on top of thumbnail and made it red 2015-12-09 22:14:22 +01:00
Christian Schabesberger
37d9be9095 put fab button on top of video thumbnail 2015-12-08 21:29:29 +01:00
Christian Schabesberger
78b95f67eb made content scroll over thumbnail 2015-12-02 21:20:52 +01:00
chschtsch
6c63841d0c update video detail layout 2015-12-02 21:55:57 +03:00
chschtsch
6ec2d91d91 fix card margin as well 2015-12-02 17:36:20 +03:00
chschtsch
3299b90c20 better padding for landscape card 2015-12-02 17:33:58 +03:00
chschtsch
7b6d6da9a6 improve card margin & edit its dimensions for landscape 2015-12-02 17:26:20 +03:00
chschtsch
7c7c61fc35 use singleLine instead of manually setting height 2015-12-02 17:18:40 +03:00
chschtsch
c5408fb6b8 finally make card layout look good 2015-12-02 17:13:01 +03:00
chschtsch
1c49102f67 update card layout 2015-12-02 17:00:37 +03:00
chschtsch
f9dd88c1cb remove divider from listview 2015-12-02 16:29:58 +03:00
chschtsch
9ed4a65fd2 move all dimensions do dimens.xml 2015-12-02 16:23:31 +03:00
chschtsch
10bebf8a89 update cards & update dimens structure 2015-12-02 15:27:19 +03:00
chschtsch
36260dac18 tryna add cardview 2015-12-02 13:08:43 +03:00
Christian Schabesberger
2e4e993967 removed unececeary commends 2015-12-02 00:19:47 +01:00
Christian Schabesberger
ef1bfe98f7 try to fix timeout error 2015-12-02 00:11:39 +01:00
Christian Schabesberger
2e123aa617 try to get emulator running part 2 2015-12-01 23:55:07 +01:00
Christian Schabesberger
cf2ef0f2a8 try to get emulator running 2015-12-01 23:48:41 +01:00
Christian Schabesberger
520f40d862 fiexed travis build error 2015-12-01 23:16:58 +01:00
Christian Schabesberger
856bdac84b Merge branch 'master' of github.com:theScrabi/NewPipe 2015-12-01 22:32:55 +01:00
Christian Schabesberger
deb7e38fcf fixed travis.yml error 2015-12-01 22:32:44 +01:00
Weblate
e5f47a4563 Merge remote-tracking branch 'origin/master' 2015-12-01 21:56:17 +01:00
Roland Sawicki
d1b465d8be Translated using Weblate (Polish)
Currently translated at 100.0% (47 of 47 strings)
2015-12-01 21:56:17 +01:00
Christian Schabesberger
5c73b2f324 trigger first CI pull 2015-12-01 21:35:18 +01:00
Christian Schabesberger
7d3e992b3f init CI 2015-12-01 21:31:10 +01:00
Christian Schabesberger
296640930e fixed some spelling errors 2015-12-01 18:50:57 +01:00
Christian Schabesberger
1c42735e3a fixed screenshot error -.- 2015-12-01 18:37:50 +01:00
Christian Schabesberger
0800bc1790 post edit README.md 2015-12-01 18:36:39 +01:00
Christian Schabesberger
bd76a12b90 update README.md and readded (still) nececeary assets 2015-12-01 18:23:06 +01:00
Christian Schabesberger
d3daea6383 Merge pull request #107 from chschtsch/refactor
Slightly update readme file + add screenshots
2015-12-01 17:52:57 +01:00
naofum
df1acd5413 Translated using Weblate (Japanese)
Currently translated at 100.0% (47 of 47 strings)
2015-12-01 14:38:28 +01:00
Greg
0d65cc09f6 Merge pull request #9 from chschtsch/master
.
2015-12-01 12:59:16 +03:00
Greg
892b082b9e Update README.md 2015-12-01 12:58:47 +03:00
Mladen Pejaković
9069ef1325 Translated using Weblate (Serbian)
Currently translated at 100.0% (47 of 47 strings)
2015-11-30 22:24:17 +01:00
Roland Sawicki
47cc493ab5 Translated using Weblate (Polish)
Currently translated at 100.0% (47 of 47 strings)
2015-11-30 22:08:09 +01:00
Greg
f43d7837f8 Merge pull request #8 from chschtsch/refactor
Refactor
2015-11-30 23:56:14 +03:00
Greg
91921ae672 Update README.md 2015-11-30 23:55:24 +03:00
Greg
eba6afc12b Merge pull request #7 from chschtsch/master
.
2015-11-30 23:52:52 +03:00
Greg
ff826a9eeb Update README.md 2015-11-30 23:49:13 +03:00
Greg
6c01a30af5 Merge pull request #5 from chschtsch/refactor
edit screenshots
2015-11-30 23:43:09 +03:00
Greg
53f8d09d31 Merge pull request #6 from chschtsch/master
.
2015-11-30 23:42:54 +03:00
chschtsch
ae191aaafe edit screenshots 2015-11-30 23:40:44 +03:00
Greg
d1694d563b Update README.md 2015-11-30 23:40:29 +03:00
Greg
75fadf79da Delete gruese_die_gema_original.png 2015-11-30 23:38:30 +03:00
Greg
23ce5a6b1e Merge pull request #4 from chschtsch/refactor
add screenshots and new icon
2015-11-30 23:36:29 +03:00
chschtsch
bb65e2b84d add screenshots and new icon 2015-11-30 23:32:10 +03:00
Greg
aa42b1d95a Update README.md 2015-11-30 23:08:28 +03:00
Greg
32d5a18198 Update README.md 2015-11-30 23:07:07 +03:00
Greg
63faefe9c3 Update README.md 2015-11-30 23:01:55 +03:00
syl0s
a90c49d030 Translated using Weblate (German)
Currently translated at 100.0% (47 of 47 strings)
2015-11-30 20:57:19 +01:00
Christian Schabesberger
b1ef3fa4df Translated using Weblate (German)
Currently translated at 100.0% (47 of 47 strings)
2015-11-30 20:55:15 +01:00
Greg
b8cf67cba9 Merge pull request #3 from theScrabi/master
.
2015-11-30 22:53:01 +03:00
Weblate
4780e10ade Merge remote-tracking branch 'origin/master' 2015-11-30 20:51:43 +01:00
Roland Sawicki
401e606fbc Translated using Weblate (Polish)
Currently translated at 95.9% (47 of 49 strings)
2015-11-30 20:51:43 +01:00
syl0s
6b4ef8f397 Translated using Weblate (German)
Currently translated at 100.0% (49 of 49 strings)
2015-11-30 20:51:41 +01:00
Greg
7c66d07779 Merge pull request #2 from theScrabi/master
pull from theScrabi/NewPipe
2015-11-30 22:51:20 +03:00
Christian Schabesberger
92aed0cc3a add link to slack group 2015-11-30 20:48:59 +01:00
Christian Schabesberger
457b08d3cc merge strings.xml collision 2015-11-30 20:00:28 +01:00
Christian Schabesberger
1e5f6fd2b8 merge code_lint 2015-11-30 19:47:21 +01:00
Christian Schabesberger
f6974e8315 code lint 2015-11-29 13:11:56 +01:00
Xenotium
2ce6313ac1 Forgot about quotes... 2015-11-29 11:49:47 +01:00
RACER
e98a113a59 Translated using Weblate (Japanese)
Currently translated at 100.0% (49 of 49 strings)
2015-11-28 15:16:15 +01:00
Mladen Pejaković
ba7bed9c2c Translated using Weblate (Serbian)
Currently translated at 100.0% (49 of 49 strings)
2015-11-27 23:47:01 +01:00
Xenotium
c9ea451c53 Make some strings non-translatable
Apart from app name, which at the moment is the same no matter what language, there are URLs here. They shouldn't reside here but make them (and the app name) at least "translatable=false".
2015-11-27 20:51:56 +01:00
Roland Sawicki
4261ff32c7 Translated using Weblate (Polish)
Currently translated at 100% (0 of 0 strings)

Created new translation.
2015-11-27 20:10:57 +01:00
Christian Schabesberger
cb4b20af45 use format strings now 2015-11-26 20:43:16 +01:00
Christian Schabesberger
b8a27adb93 removed unused resources 2015-11-26 20:22:45 +01:00
Christian Schabesberger
15b58128f4 fiexed lint layout suggestions 2015-11-26 20:16:23 +01:00
Christian Schabesberger
237282db28 refactored VideoPlayer theme 2015-11-26 19:54:13 +01:00
Christian Schabesberger
71bb59dbb8 update gradle/libs and use Perference.Editor.apply() instead of commit() 2015-11-26 19:36:14 +01:00
Christian Schabesberger
e41c46c075 made lint ignore that parentActivityName is not compatible to sdk 15 2015-11-26 19:28:50 +01:00
Christian Schabesberger
6ca9e52f2f made lint ignore some code and layout warnings 2015-11-26 19:11:31 +01:00
Christian Schabesberger
2afee89de3 added contentDescription for better accesebility 2015-11-26 18:47:36 +01:00
Christian Schabesberger
189bee3e44 named drawable folder drawable-nodpi and moved orig. gema image to assets 2015-11-26 18:37:40 +01:00
Christian Schabesberger
6b9a4d5e0a add ellipsis character to spanish translation 2015-11-26 18:32:06 +01:00
Christian Schabesberger
451e2b2182 removed hardcoded strings 2015-11-26 18:29:00 +01:00
Christian Schabesberger
f6ff41cfb4 removed obsolete translations 2015-11-26 18:26:28 +01:00
Christian Schabesberger
d6d144c927 renamed Extractor into VideoExtractor 2015-11-26 17:29:26 +01:00
Christian Schabesberger
7f86872139 Categorized settings & moved AbstractVideoInfo into service folder 2015-11-25 21:08:19 +01:00
Greg
5d28b2400f Merge pull request #1 from theScrabi/master
merge from theScrabi/NewPipe
2015-11-23 23:02:30 +03:00
Weblate
67324bfc80 Merge remote-tracking branch 'origin/master' 2015-11-22 13:24:52 +01:00
syl0s
3c340e7144 Translated using Weblate (German)
Currently translated at 97.8% (45 of 46 strings)
2015-11-22 13:24:51 +01:00
dostoi
c834405a92 Translated using Weblate (French)
Currently translated at 97.8% (45 of 46 strings)
2015-11-22 13:24:51 +01:00
Greg
4ee9e26847 Translated using Weblate (Dutch)
Currently translated at 100.0% (46 of 46 strings)
2015-11-22 13:24:50 +01:00
Adam Howard
94293ca9d9 Merge pull request #100 from theScrabi/refactor
+ Implemented timestamps
* renamed `VideoInfoItem` to `VideoPreviewInfo`
* Moved streaming service-related classes into their own, new package: "services"
+ Added javadoc to some classes and methods (where functionality is known well enough to explain)
- De-duplicated common fields between `VideoInfo` and `VideoPreviewInfo` by moving them into a common superclass: `AbstractVideoInfo`
- Removed 2 methods in `PlayVideoActivity` which only call `super()`, and therefore are unnecessary: `onResume()` and `onPostCreate(Bundle)`
+ Added `VideoInfo(AbstractVideoInfo)` constructor
    - to support converting `VideoPreviewInfo`s into `VideoInfo`s, to reuse scraped info (yet to be implemented)
* Made the Extractor class behave as a per-video object;
    - most method return values are video-specific, so it makes sense (to me) to have Extractor be stateful. 
    - The only stateless methods are getVideoUrl(), getVideoId() and loadDecryptionCode(String)
* Implemented a constructor for YoutubeExtractor, which performs all initialisation work, such as fetching `Jsoup.Document`, and `playerArgs:JSONObject`
2015-11-21 11:11:17 +00:00
Mladen Pejaković
b9cd9f8d35 Translated using Weblate (Serbian)
Currently translated at 100.0% (46 of 46 strings)
2015-11-20 18:45:03 +01:00
Adam Howard
812dd9282d Merge pull request #102 from chschtsch/refactor
fix bug with upload date + better way to parse it
2015-11-20 01:44:32 +00:00
chschtsch
fa1d386fcc cleanup 2015-11-20 00:52:43 +03:00
chschtsch
0392bf6a02 fix bug with upload date + better way to parse it 2015-11-20 00:49:52 +03:00
naofum
97f771ff50 Translated using Weblate (Japanese)
Currently translated at 100.0% (46 of 46 strings)
2015-11-19 16:20:26 +01:00
naofum
6adcc72a8a Translated using Weblate (Japanese)
Currently translated at 100% (0 of 0 strings)

Created new translation.
2015-11-19 16:17:28 +01:00
Adam Howard
2c11bd1889 fixed Bundle casting bug incurred during related videosdisplay 2015-11-19 14:40:35 +00:00
Adam Howard
23e0196fcc * fixed counterintuitive back button behaviour in PlayVideoActivity; see https://github.com/theScrabi/NewPipe/issues/99
* fixed a rarely-caused NullPointerException caused by a related video's view-count field being missing
2015-11-19 00:08:51 +00:00
Adam Howard
91f98c125e finished implementing timestamp, along with refactoring services
* added VideoInfo(AbstractVideoInfo) constructor, to support later implementation for reusing info scraped into VideoPreviewInfo, into VideoInfo
* Made the Extractor class behave as a per-video object;
    - most method return values are video-specific, so it makes sense (to me) to have Extractor be stateful.
    - The only stateless methods are getVideoUrl(), getVideoId() and loadDecryptionCode(String)
* Implemented a constructor for YoutubeExtractor, which performs all initialisation work
2015-11-17 22:51:27 +00:00
Adam Howard
7f01e9a4d9 Merge branch 'master' of github.com:theScrabi/NewPipe
translations
2015-11-16 23:45:42 +00:00
Adam Howard
320a4e2351 Refactoring:
* renamed VideoInfoItem to VideoPreviewInfo
* moved streaming service-related classes into their own, new package services
* added javadoc to some classes and methods (where functionality is known well enough to explain)
* De-duplicated common fields between VideoInfo and VideoPreviewInfo by moving them into a common superclass: AbstractVideoInfo
* Removed 2 methods which only call super(), and therefore are unnecessary: PlayVideoActivity.onResume() and PlayVideoActivity.onPostCreate(Bundle)
2015-11-16 23:32:00 +00:00
Weblate
0829ce51fc Merge remote-tracking branch 'origin/master' 2015-11-16 17:36:14 +01:00
Mladen Pejaković
97ec50c202 Translated using Weblate (Serbian)
Currently translated at 100.0% (46 of 46 strings)
2015-11-16 17:36:12 +01:00
Adam Howard
975a3e8103 Merge branch 'master' of github.com:theScrabi/NewPipe 2015-11-16 14:18:12 +00:00
Christian Schabesberger
658ef2ef26 Merge pull request #97 from chschtsch/master
Update design
2015-11-15 11:49:49 +01:00
chschtsch
bd1e531d7b update design 2015-11-14 21:04:14 +03:00
chschtsch
e440d1d1bd update design 2015-11-14 20:55:28 +03:00
chschtsch
2110020165 update design 2015-11-14 20:48:42 +03:00
chschtsch
dac74dc30d Merge github.com:chschtsch/NewPipe 2015-11-14 20:12:11 +03:00
chschtsch
fa4b971254 update .gitignore 2015-11-14 20:11:41 +03:00
Greg
2d31ae0baa Delete NewPipe.iml 2015-11-14 19:20:31 +03:00
chschtsch
5eebfa132f update .gitignore 2015-11-14 19:19:45 +03:00
chschtsch
522febef93 update .gitignore 2015-11-14 19:17:54 +03:00
chschtsch
a421645ea5 update fragment_videoitem_detail layout 2015-11-14 19:14:51 +03:00
chschtsch
0aac4b1347 update fragment_videoitem_detail layout 2015-11-14 19:11:08 +03:00
chschtsch
36697825cf update fragment_videoitem_detail layout 2015-11-14 19:08:13 +03:00
Adam Howard
b0182ed604 halfway through implementing timestamps:
* still need to use the start position value stored in the PlayVideoActivity's Intent bundle, to set the VideoView using seekTo()
* need to test timestamp extraction regex, and possibly move it somewhere else
*need to find a better way to get the startPosition value to ActionBarHandler, which I thought used VideoInfo objects, but apparently doesn't
    * currently there is a small setStartPosition() method
2015-11-14 11:47:21 +00:00
Adam Howard
c4ea73ca7a Merge pull request #93 from chschtsch/patch-6
remove quotation marks added by weblate
2015-11-13 12:19:21 +00:00
Adam Howard
2aa28d6453 Merge pull request #92 from chschtsch/patch-5
remove quotation marks added by weblate
2015-11-13 12:19:11 +00:00
Adam Howard
2d51085ccf Merge pull request #91 from chschtsch/patch-4
remove quotation marks added by weblate
2015-11-13 12:19:03 +00:00
Adam Howard
4eae02e47e Merge pull request #90 from chschtsch/patch-2
remove quotation marks added by weblate
2015-11-13 12:18:48 +00:00
Adam Howard
f3bf9f9e5d Merge pull request #89 from chschtsch/patch-3
remove quotation marks added by weblate
2015-11-13 12:18:38 +00:00
Greg
75d0b84bdb remove quotation marks added by weblate 2015-11-13 15:00:24 +03:00
Greg
3643ddcf5c remove quotation marks added by weblate 2015-11-13 14:58:16 +03:00
Greg
35500e8ef7 remove quotation marks added by weblate 2015-11-13 14:57:52 +03:00
Greg
6badcf5391 remove quotation marks added by weblate 2015-11-13 14:57:09 +03:00
Greg
d4898043f6 remove quotation marks added by weblate 2015-11-13 14:56:38 +03:00
Weblate
2322ba833a Merge remote-tracking branch 'origin/master' 2015-11-13 12:27:21 +01:00
Greg
5aabb2917f Translated using Weblate (Spanish)
Currently translated at 95.6% (44 of 46 strings)
2015-11-13 12:27:21 +01:00
Greg
eacbf6ce50 Translated using Weblate (German)
Currently translated at 97.8% (45 of 46 strings)
2015-11-13 12:27:20 +01:00
Greg
031300a132 Translated using Weblate (French)
Currently translated at 76.0% (35 of 46 strings)
2015-11-13 12:27:20 +01:00
Greg
f905611e69 Translated using Weblate (English)
Currently translated at 100.0% (46 of 46 strings)

changing 'published' to 'updloaded'
2015-11-13 12:27:20 +01:00
Greg
e475f9f876 Translated using Weblate (Dutch)
Currently translated at 97.8% (45 of 46 strings)
2015-11-13 12:27:20 +01:00
Adam Howard
b65263349e Merged upstream translation commits 2015-11-13 11:07:22 +00:00
Adam Howard
5cb8026f6d Merge pull request #87 from chschtsch/patch-1
remove quotation marks added by weblate
2015-11-13 11:05:48 +00:00
Adam Howard
cc7ce5cf93 fixed inefficient double-conversion of parceled VideoInfoItems, from being cast from VideoInfoItem[] to Vector<>, to using ArrayList as an implementation of List 2015-11-13 10:47:05 +00:00
Greg
af506639a9 remove quotation marks added by weblate 2015-11-13 12:46:55 +03:00
Greg
d377d67174 Translated using Weblate (Russian)
Currently translated at 100.0% (46 of 46 strings)
2015-11-13 10:06:06 +01:00
Greg
cf926353d1 Translated using Weblate (Russian)
Currently translated at 100.0% (46 of 46 strings)
2015-11-13 09:54:54 +01:00
Weblate
d686c744d0 Merge remote-tracking branch 'origin/master' 2015-11-13 03:22:52 +01:00
Greg
501c60b180 Translated using Weblate (Russian)
Currently translated at 97.8% (45 of 46 strings)
2015-11-13 03:22:52 +01:00
jasperweiss
da36687e25 Translated using Weblate (Dutch)
Currently translated at 100.0% (46 of 46 strings)
2015-11-13 03:22:52 +01:00
Adam Howard
f13f9a066a updated README to include language-specific search feature 2015-11-12 15:51:22 +00:00
Christian Schabesberger
8eaa4f7654 Merge pull request #82 from chschtsch/master
fix bug with parsing like/dislike count
2015-11-12 10:26:50 +01:00
Greg
145a7f8e0d fix bug with parsing like/dislike count 2015-11-12 12:18:41 +03:00
Adam Howard
67ba126602 implemented locale-specific formatting of view, like and dislike counts, and video published date 2015-11-11 16:23:22 +00:00
Adam Howard
c5084901b5 removed commented-out code, added another TODO note 2015-11-11 13:08:53 +00:00
Adam Howard
3bfc82f7c0 Refactoring YoutubeExtractor:
-replaced single use of terrible_unescape_workaround_fuck(String) with call to URLDecoder.decode(String, String)
* tested new regex implementation of YoutubeExtractor.getVideoId(String)
- deleted old HashMap-based implementation of YoutubeExtractor.getVideoId(String)
* Miscellaneous typo corrections
* replaced direct page-scraping extraction of video publication date in YoutubeExtractor.getVideoInfo(String) with jsoup-based scrape of <meta> tag field in YYYY-MM-DD format
*similarly,  replaced direct page-scraping extraction of view count with <meta> tag field.

Both <meta> tag fields still need to be formatted locale-specifically
2015-11-11 13:07:09 +00:00
Adam Howard
3411b53450 implemented optimised version of YoutubeExtractor.getVideoId().
new version uses a regular expression instead of creating a HashMap and looping over them.
Needs testing before pushing to origin
2015-11-11 01:48:44 +00:00
Christian Schabesberger
873564f2aa removed .idea folder 2015-11-10 21:17:07 +01:00
Christian Schabesberger
353ed90d12 New version number 0.6.0 and some fixes:
* moved on to version 0.6.0
* fixed youtube url sicnature encryption (vevo videos can be watched again)
* removed play action from the ActionBar
* rolled back changes for hiding the InfoBar inside PlayVideoActivity
* some small layout changes
* removed some files to be ignored (mostly inside .idea directory)
* etc
2015-11-10 20:51:39 +01:00
Christian Schabesberger
799faecc5b Merge pull request #80 from chschtsch/master
Update layout (initially suggested by @darkon5) + miscellaneous fixes
2015-11-10 19:28:53 +01:00
chschtsch
731321b1f9 tryna merge dem files 2015-11-10 20:50:15 +03:00
chschtsch
7ff43caf96 tryna merge dem files 2015-11-10 20:36:35 +03:00
chschtsch
d0877c3132 tryna merge dem files 2015-11-10 20:34:08 +03:00
chschtsch
c589b03dcb rollback setting English as a default language for content 2015-11-10 20:28:05 +03:00
chschtsch
862b5aaef6 update layout (implementing redesign suggested by @darkon5) & set english as a default language for content 2015-11-10 20:26:20 +03:00
Adam Howard
596443bf5e added licensing notice to MediaFormat 2015-11-10 17:23:07 +00:00
Adam Howard
27b450f1e3 minor commit:
-removed now-redundant language code check
2015-11-10 17:09:26 +00:00
chschtsch
61a09e97ca update colors (implementing redesign suggested by @darkon5) 2015-11-10 19:55:58 +03:00
chschtsch
224e7a8969 update date extracting regex pattern + fix some strings in English 2015-11-10 19:50:04 +03:00
Adam Howard
9e7d9ee973 merged commits from origin 2015-11-10 12:43:40 +00:00
Weblate
586bad345c Merge remote-tracking branch 'origin/master' 2015-11-09 08:16:47 +01:00
Szöllősi Attila
abdd7dc7d3 Translated using Weblate (Hungarian)
Currently translated at 97.8% (45 of 46 strings)
2015-11-09 08:16:47 +01:00
jasperweiss
aee32f7a3e Translated using Weblate (Dutch)
Currently translated at 100.0% (46 of 46 strings)
2015-11-09 08:16:45 +01:00
Christian Schabesberger
696760e65a removed printing the player url 2015-11-08 21:22:24 +01:00
Christian Schabesberger
200db15d4b Merge branch 'master' of github.com:theScrabi/NewPipe 2015-11-08 21:19:09 +01:00
Christian Schabesberger
33e332f105 impofed performance and made similar video button hidable 2015-11-08 21:17:51 +01:00
Timofonic
bb2955e442 Translated using Weblate (Spanish)
Currently translated at 100.0% (46 of 46 strings)
2015-11-08 19:54:28 +01:00
Adam Howard
2fc2fa56c3 refactoring VideoInfo & MediaFormat, part 2:
* fixed errors caused by moving media format code to MediaFormat enum
2015-11-08 02:22:40 +00:00
Adam Howard
c87458590c refactoring VideoInfo & VideoInfoItem, part 1:
+ created enum VideoFormat
2015-11-08 02:04:03 +00:00
Adam Howard
8aff134c56 replaced content tountry selection with search language selection.Should now allows users to search for videos in their preferred language. Needs testing before pushing to origin. 2015-11-08 01:09:03 +00:00
Christian Schabesberger
4a938b81df Merge pull request #73 from joshsoftware/feature_search_suggestion
Feature search suggestion (enhancement)
2015-11-05 12:36:43 +01:00
chandrashekhar
4def715b25 + Added TODO & remove unused lines. 2015-11-05 13:19:28 +05:30
chandrashekhar
821acf12d8 +Merge Adam Howard's (medavox) commit with my changes & remove conflict.
+update searchEngine.java & YoutubeSearchEngine.java file.

Conflicts:
	app/src/main/java/org/schabi/newpipe/SearchEngine.java
	app/src/main/java/org/schabi/newpipe/youtube/YoutubeSearchEngine.java
2015-11-05 13:03:47 +05:30
Adam Howard
fc707b6c7e Added Content Country selection setting. This changes the SearchEngine interface slightly. Still need a reliable test to prove whether YouTube is serving different search results based on the country code passed in the search query. 2015-11-04 12:42:17 +00:00
chandrashekhar
85ac000479 + Change return type of interface method suggestionList, So that it will return arraylist of string type data(suggestion). 2015-11-04 11:44:34 +05:30
chandrashekhar
68a0eefa20 + Added interface method in SearchEngine class for fetch search suggestion list.
+ Implemented SearchEngine Interface method in YoutubeSearchEngine class.
2015-11-04 09:06:21 +05:30
Adam Howard
fc32377ce7 added check and exception reporting to YoutubeExtractor:matchGroup1, so that a failed match doesn't go unnoticed 2015-11-04 00:29:30 +00:00
Christian Schabesberger
59e512a64d fixed notification hiding issue 2015-11-03 22:19:28 +01:00
Christian Schabesberger
c51a5a51f1 Merge pull request #72 from medavox/master
Code cleanup & minor additions
2015-11-03 17:54:09 +01:00
Adam Howard
9546a276dc modified gitignore so jdk versions changes are hopefully not propagated to remote 2015-11-03 13:20:15 +00:00
Adam Howard
a18353df5f still fighting with jdk version strings in app/app.iml, .idea/gradle.xml, .idea/misc.xml 2015-11-03 13:19:23 +00:00
Adam Howard
3c72113f4c replaced 4-line regex blocks with call to equivalent method; removed unecessary try-catch blocks surrounding them: regex methods don't throw runtime exceptions 2015-11-03 12:56:11 +00:00
Adam Howard
7e193751c4 fixed app/app.iml, .idea/grade.xml and .idea/misc.xml siwtching jdk versions between 1.7 and 1.8. Added them to my local .gitignore 2015-11-03 12:08:30 +00:00
Adam Howard
56c96eb712 Merge remote-tracking branch 'upstream/master':
Synced new russian translation from theScrabi/NewPipe
2015-11-03 11:51:40 +00:00
Adam Howard
4106a984ca minor corrections pre-sync 2015-11-03 11:51:18 +00:00
Christian Schabesberger
10f1ab0598 Merge pull request #71 from chschtsch/patch-1
Add russian translation of strings.xml
2015-11-03 11:28:27 +01:00
chschtsch
bca9603440 Add russian translation of strings.xml 2015-11-03 12:34:51 +03:00
Adam Howard
c32c267889 Merge remote-tracking branch 'upstream/master'
Conflicts:
	app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java -- still used class-based passing
	app/src/main/java/org/schabi/newpipe/VideoItemListActivity.java -- just some whitespace
2015-11-02 21:29:43 +00:00
Adam Howard
627e987bda made the PlayVideoActivity return to its VideoItemDetailActivity when the back button is pressed, by setting its parent activity in the manifest. Also grammar fixes for existing comments 2015-11-02 21:19:18 +00:00
Christian Schabesberger
7c18e147f3 added "show next/related videos" to features 2015-11-02 20:32:13 +01:00
Christian Schabesberger
6a8fb5910d changed icon in the README file 2015-11-02 20:18:23 +01:00
Christian Schabesberger
b865326d51 added ability to show similar videos 2015-11-02 19:57:47 +01:00
Adam Howard
a2d5b0893d Merge remote-tracking branch 'upstream/master' 2015-11-02 15:12:34 +00:00
Adam Howard
db0508b9ab refactored StreamingService interface so it acts as a Factory (returning new instances of called classes, eg Extractor), rather than passing Class objects (which loses type safety) which are then instantiated. Also noticed there is a conflict between existing gradle setup and mine: misc.xml and app.iml have had their jvm version values switched from 1.8 to 1.7 2015-11-02 15:03:11 +00:00
Christian Schabesberger
1850dee93a Merge pull request #67 from joshsoftware/remove_deprecation
Remove Deprecated methods
2015-11-02 15:37:17 +01:00
Weblate
7b1eb8a6dc Merge remote-tracking branch 'origin/master' 2015-11-02 14:26:43 +01:00
chandrashekhar
95a9f2f5e3 + Remove deprecated method from app/src/main/java/org/schabi/newpipe/VideoItemListFragment.java
onAttach(Activity activity) is replaced by onAttach(Context context)

+ Remove deprecated method from pp/src/main/java/org/schabi/newpipe/VideoListAdapter.java
context.getResource().getColor(resId) is replaced by ContextCompat.getColor(context,resId)
2015-11-02 18:02:32 +05:30
darkon5
ae7ed2d226 Merge pull request #65 from medavox/master
Minor README edits
2015-11-02 10:18:24 +01:00
Szöllősi Attila
20cf82bab1 Translated using Weblate (Hungarian)
Currently translated at 100.0% (44 of 44 strings)
2015-11-01 21:42:52 +01:00
Mladen Pejaković
5dcb1e26b5 Translated using Weblate (Serbian)
Currently translated at 100.0% (44 of 44 strings)
2015-10-31 19:56:57 +01:00
Christian Schabesberger
8076589180 Translated using Weblate (German)
Currently translated at 100.0% (44 of 44 strings)
2015-10-31 16:11:54 +01:00
Christian Schabesberger
edbd4003be Merge pull request #64 from mamins1376/master
add Persian translation
2015-10-31 13:53:26 +01:00
medavox
122b089bf0 minor grammar 2015-10-31 12:07:07 +00:00
medavox
a28d917990 fixed typo 2015-10-31 12:05:42 +00:00
Mohammad Amin Sameti
5b605a1100 add Persian translation 2015-10-31 02:30:08 +03:30
Christian Schabesberger
f67158a2a7 Fixed:
- made "could not find a streamingplayer" thing inside ActionBarHandler yield stacktraces
- remove watermark
- fixed fab layout
- changed version number to 0.5.0
2015-10-29 18:37:32 +01:00
Christian Schabesberger
c22c2009d4 - changed icon again
- made ActionBarHandler not be a singelton anymore
 - fixed go back bug for the "Next Video" thing
 - fixed opening youtube mobile links
2015-10-29 17:56:35 +01:00
Christian Schabesberger
ab4d626ea9 fixed opening videos via firefox/fenec 2015-10-28 20:48:03 +01:00
Christian Schabesberger
96709d22e9 Merge pull request #61 from Natureshadow/patch-1
Add missing patterns as described in isue #50
2015-10-28 19:39:06 +01:00
Christian Schabesberger
f0bd171eee small layout changed in README.md 2015-10-28 19:08:58 +01:00
Dominik George
c4191077f3 Add missing patterns as described in isue #50 2015-10-28 15:24:46 +01:00
Christian Schabesberger
321d090052 - added dracon5's website to README.md
- added halcyonest icon (with smal modifications)
2015-10-27 21:35:08 +01:00
Christian Schabesberger
32dcb4d281 improved README file 2015-10-27 20:01:56 +01:00
Christian Schabesberger
080159849e - added preference for "next video" item
- display if a url is supported or nod
2015-10-27 18:13:04 +01:00
Christian Schabesberger
d9e690f62c added NextVideo support 2015-10-25 19:14:29 +01:00
Christian Schabesberger
8c0156dea3 fixed broken commit 2015-10-24 16:05:23 +02:00
Christian Schabesberger
038c59ce66 fiexed some smaller displaying errors 2015-10-24 16:04:27 +02:00
Christian Schabesberger
72e08c0447 fixed some layout bugs 2015-10-23 23:08:01 +02:00
Christian Schabesberger
173eaa8cf8 Merge pull request #51 from Soofe/master
Fixed some typos and removed unused imports.
2015-10-17 17:22:21 +02:00
Christian Schabesberger
a04cd24e5e Merge pull request #53 from pejakm/srupd
Update Serbian translation
2015-10-17 17:15:53 +02:00
Mladen Pejaković
0e11404b3b Update Serbian translation 2015-10-17 17:13:21 +02:00
Soofe
342807e26a Update VideoItemListFragment.java 2015-10-15 23:58:14 +02:00
Soofe
c068f08ff8 Fixed some typos and removed unused imports. 2015-10-15 23:25:53 +02:00
113 changed files with 3824 additions and 2503 deletions

6
.gitignore vendored
View File

@@ -1,7 +1,9 @@
.gitignore
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
/app/app.iml
/.idea
/*.iml

1
.idea/.name generated
View File

@@ -1 +0,0 @@
NewPipe

22
.idea/compiler.xml generated
View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View File

@@ -1,3 +0,0 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View File

@@ -1,3 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="the-scrabi" />
</component>

19
.idea/gradle.xml generated
View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.4" />
<option name="gradleJvm" value="1.8" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

46
.idea/misc.xml generated
View File

@@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

9
.idea/modules.xml generated
View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/NewPipe.iml" filepath="$PROJECT_DIR$/NewPipe.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>

View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

6
.idea/vcs.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

29
.travis.yml Normal file
View File

@@ -0,0 +1,29 @@
language: android
android:
components:
# The BuildTools version used by NewPipe
- build-tools-23.0.2
# The SDK version used to compile NewPipe
- android-23
# Additional components
- extra-android-support
- extra-android-m2repository
# Emulators
- sys-img-armeabi-v7a-android-21
- sys-img-armeabi-v7a-android-19
- sys-img-armeabi-v7a-android-15
env:
global:
- ADB_INSTALL_TIMEOUT=8 # minutes (2 by default)
matrix:
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
before_script:
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="NewPipe" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -1,7 +1,69 @@
NewPipe
-------
# NewPipe
NewPipe: A free lightweight Youtube frontend for Android.
[![NewPipe](app/src/main/res/mipmap-xhdpi/ic_launcher.png)](http://dasochan.nl/newpipe/)
NewPipe is a lightweight youtube frontend for android. It's supposed to be used without the youtube-api and without any google play services. NewPipe only parses the youtube website in order to gain the information it needs.
Project status:
[![Translation Status](https://hosted.weblate.org/widgets/NewPipe/-/svg-badge.svg)](https://hosted.weblate.org/engage/NewPipe/)
[![Build Status](https://travis-ci.org/theScrabi/NewPipe.svg)](https://travis-ci.org/theScrabi/NewPipe)
This a very early version of the app, so not all functionality is implemented, and there may still be a lot of bugs. But all in all it's doing what it is supposed to do. It makes it possible to watch youtube videos. So don't be cruel to this app. It will improve...
## Get NewPipe
[![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)
## Screenshots
[<img src="screenshots/screenshot_1.png" width=150>](screenshots/screenshot_1.png)
[<img src="screenshots/screenshot_2.png" width=150>](screenshots/screenshot_2.png)
[<img src="screenshots/screenshot_3.png" width=150>](screenshots/screenshot_3.png)
[<img src="screenshots/screenshot_4.png" width=150>](screenshots/screenshot_4.png)
[<img src="screenshots/screenshot_5.png" width=150>](screenshots/screenshot_5.png)
[<img src="screenshots/screenshot_6.png" width=250>](screenshots/screenshot_6.png)
## Description
NewPipe does not use any Google framework libraries, or the YouTube API. It only parses the website in order to gain the information it needs. Therefore this app can be used on devices without Google Services installed. Also, you don't need a YouTube account to use NewPipe, and it's FLOSS.
### Features
* Search videos
* Display general information about a video
* Watch YouTube videos
* Listen to YouTube videos (audio only streaming)
* Select the streaming player to watch the video with
* Download videos (working, but it could be better)
* Download audio only (working, but it could be better)
* Open a video in Kodi
* Show Next/Related videos
* Search YouTube in a specific language
### Coming Features
* Improved Downloading
* Bookmarks
* View history
* Search history
* Search channels
* Display general information about channels
* Subscribe to channels
* Watch videos from a channel
* Search/Watch Playlists
* ... and many more
### Multiservice support
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.
The more is done the better it gets!
Join our [Slack group](http://invite.chschtsch.ml/) if you like to get involved.
## License
[![GNU GPLv3 Image](https://www.gnu.org/graphics/gplv3-127x51.png)](http://www.gnu.org/licenses/gpl-3.0.en.html)
NewPipe is Free Software: You can use, study share and improve it at your
will. Specifically you can redistribute and/or modify it under the terms of the
[GNU General Public License](https://www.gnu.org/licenses/gpl.html) as
published by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

2
app/.gitignore vendored
View File

@@ -1 +1,3 @@
.gitignore
/build
app.iml

View File

@@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="NewPipe" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugAndroidTest" />
<option name="COMPILE_JAVA_TEST_TASK_NAME" value="compileDebugAndroidTestSources" />
<afterSyncTasks>
<task>generateDebugAndroidTestSources</task>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="jsoup-1.8.3" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="rhino-1.7.7" level="project" />
<orderEntry type="library" exported="" name="design-23.0.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
</component>
</module>

View File

@@ -2,14 +2,14 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "org.schabi.newpipe"
minSdkVersion 15
targetSdkVersion 23
versionCode 4
versionName "0.4.1"
versionCode 8
versionName "0.6.2"
}
buildTypes {
release {
@@ -17,13 +17,22 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'org.jsoup:jsoup:1.8.3'
compile 'org.mozilla:rhino:1.7.7'
compile 'com.android.support:design:23.0.1'
}

View File

@@ -1,8 +1,9 @@
<?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" >
<uses-permission android:name= "android.permission.INTERNET" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
@@ -10,10 +11,11 @@
android:icon="@mipmap/ic_launcher"
android:logo="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme"
tools:ignore="AllowBackup">
<activity
android:name=".VideoItemListActivity"
android:label="@string/app_name" >
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -22,7 +24,8 @@
</activity>
<activity
android:name=".VideoItemDetailActivity"
android:label="@string/title_videoitem_detail" >
android:label="@string/title_videoitem_detail"
android:theme="@style/AppTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".VideoItemListActivity" />
@@ -34,27 +37,27 @@
<data
android:host="youtube.com"
android:scheme="http"
android:pathPrefix="/watch"/>
android:pathPattern="/?*#*/*watch"/>
<data
android:host="youtube.com"
android:scheme="https"
android:pathPrefix="/watch"/>
android:pathPattern="/?*#*/*watch"/>
<data
android:host="www.youtube.com"
android:scheme="http"
android:pathPrefix="/watch"/>
android:pathPattern="/?*#*/*watch"/>
<data
android:host="www.youtube.com"
android:scheme="https"
android:pathPrefix="/watch"/>
android:pathPattern="/?*#*/*watch"/>
<data
android:host="m.youtube.com"
android:scheme="http"
android:pathPrefix="/watch"/>
android:pathPattern="/?*#*/*watch"/>
<data
android:host="m.youtube.com"
android:scheme="https"
android:pathPrefix="/watch"/>
android:pathPattern="/?*#*/*watch"/>
<data
android:host="youtu.be"
android:scheme="https"
@@ -67,8 +70,9 @@
</activity>
<activity android:name=".PlayVideoActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:theme="@style/FullscreenTheme"
>
android:theme="@style/VideoPlayerTheme"
android:parentActivityName=".VideoItemDetailActivity"
tools:ignore="UnusedAttribute">
</activity>
<activity
android:name=".SettingsActivity"

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,7 @@ import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.util.Log;
@@ -42,8 +43,9 @@ public class DownloadDialog extends DialogFragment {
public static final String FILE_SUFFIX_VIDEO = "file_suffix_video";
public static final String AUDIO_URL = "audio_url";
public static final String VIDEO_URL = "video_url";
Bundle arguments;
private Bundle arguments;
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
arguments = getArguments();

View File

@@ -1,9 +1,11 @@
package org.schabi.newpipe;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.UnknownHostException;
/**
* Created by Christian Schabesberger on 14.08.15.
@@ -28,12 +30,30 @@ import java.net.URL;
public class Downloader {
private static final String USER_AGENT = "Mozilla/5.0";
public static String download(String siteUrl) {
StringBuffer response = new StringBuffer();
/**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 language the language (usually a 2-character code) to set as the preferred language
* @return the contents of the specified text file*/
public static String download(String siteUrl, String language) {
String ret = "";
try {
URL url = new URL(siteUrl);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestProperty("Accept-Language", language);
ret = dl(con);
}
catch(Exception e) {
e.printStackTrace();
}
return ret;
}
/**Common functionality between download(String url) and download(String url, String language)*/
private static String dl(HttpURLConnection con) throws IOException {
StringBuilder response = new StringBuilder();
try {
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", USER_AGENT);
@@ -45,9 +65,32 @@ public class Downloader {
response.append(inputLine);
}
in.close();
} catch (Exception e) {
e.printStackTrace();
}
catch(UnknownHostException uhe) {//thrown when there's no internet connection
uhe.printStackTrace();
//Toast.makeText(getActivity(), uhe.getMessage(), Toast.LENGTH_LONG).show();
}
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 static String download(String siteUrl) {
String ret = "";
try {
URL url = new URL(siteUrl);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
ret = dl(con);
}
catch(Exception e) {
e.printStackTrace();
}
return ret;
}
}

View File

@@ -1,30 +0,0 @@
package org.schabi.newpipe;
import android.graphics.Bitmap;
/**
* Created by Christian Schabesberger on 10.08.15.
*
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
* Extractor.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 interface Extractor {
VideoInfo getVideoInfo(String siteUrl);
String getVideoUrl(String videoId);
String getVideoId(String videoUrl);
}

View File

@@ -0,0 +1,81 @@
package org.schabi.newpipe;
/**
* Created by Adam Howard on 08/11/15.
*
* Copyright (c) Christian Schabesberger <chris.schabesberger@mailbox.org>
* and Adam Howard <achdisposable1@gmail.com> 2015
*
* VideoListAdapter.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/>.
*/
/**Static data about various media formats support by Newpipe, eg mime type, extension*/
public enum MediaFormat {
// id name suffix mime type
MPEG_4 (0x0, "MPEG-4", "mp4", "video/mp4"),
v3GPP (0x1, "3GPP", "3gp", "video/3gpp"),
WEBM (0x2, "WebM", "webm", "video/webm"),
M4A (0x3, "m4a", "m4a", "audio/mp4"),
WEBMA (0x4, "WebM", "webm", "audio/webm");
public final int id;
@SuppressWarnings("WeakerAccess")
public final String name;
@SuppressWarnings("WeakerAccess")
public final String suffix;
public final String mimeType;
MediaFormat(int id, String name, String suffix, String mimeType) {
this.id = id;
this.name = name;
this.suffix = suffix;
this.mimeType = mimeType;
}
/**Return the friendly name of the media format with the supplied id
* @param ident the id of the media format. Currently an arbitrary, NewPipe-specific number.
* @return the friendly name of the MediaFormat associated with this ids,
* or an empty String if none match it.*/
public static String getNameById(int ident) {
for (MediaFormat vf : MediaFormat.values()) {
if(vf.id == ident) return vf.name;
}
return "";
}
/**Return the file extension of the media format with the supplied id
* @param ident the id of the media format. Currently an arbitrary, NewPipe-specific number.
* @return the file extension of the MediaFormat associated with this ids,
* or an empty String if none match it.*/
public static String getSuffixById(int ident) {
for (MediaFormat vf : MediaFormat.values()) {
if(vf.id == ident) return vf.suffix;
}
return "";
}
/**Return the MIME type of the media format with the supplied id
* @param ident the id of the media format. Currently an arbitrary, NewPipe-specific number.
* @return the MIME type of the MediaFormat associated with this ids,
* or an empty String if none match it.*/
public static String getMimeById(int ident) {
for (MediaFormat vf : MediaFormat.values()) {
if(vf.id == ident) return vf.mimeType;
}
return "";
}
}

View File

@@ -5,7 +5,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Build;
@@ -16,18 +15,15 @@ import android.support.v7.app.AppCompatActivity;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.Surface;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.MediaController;
import android.widget.ProgressBar;
import android.widget.SeekBar;
import android.widget.VideoView;
/**
@@ -57,9 +53,9 @@ public class PlayVideoActivity extends AppCompatActivity {
public static final String STREAM_URL = "stream_url";
public static final String VIDEO_TITLE = "video_title";
private static final String POSITION = "position";
public static final String START_POSITION = "start_position";
private static final long HIDING_DELAY = 3000;
private static final long TAB_HIDING_DELAY = 100;
private String videoUrl = "";
@@ -84,15 +80,41 @@ public class PlayVideoActivity extends AppCompatActivity {
setContentView(R.layout.activity_play_video);
isLandscape = checkIfLandscape();
hasSoftKeys = checkIfhasSoftKeys();
hasSoftKeys = checkIfHasSoftKeys();
actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setDisplayHomeAsUpEnabled(true);
Intent intent = getIntent();
if(mediaController == null) {
mediaController = new MediaController(this);
//prevents back button hiding media controller controls (after showing them)
//instead of exiting video
//see http://stackoverflow.com/questions/6051825
//also solves https://github.com/theScrabi/NewPipe/issues/99
mediaController = new MediaController(this) {
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int keyCode = event.getKeyCode();
final boolean uniqueDown = event.getRepeatCount() == 0
&& event.getAction() == KeyEvent.ACTION_DOWN;
if (keyCode == KeyEvent.KEYCODE_BACK) {
if (uniqueDown)
{
if (isShowing()) {
finish();
} else {
hide();
}
}
return true;
}
return super.dispatchKeyEvent(event);
}
};
}
position = intent.getIntExtra(START_POSITION, 0)*1000;//convert from seconds to milliseconds
videoView = (VideoView) findViewById(R.id.video_view);
progressBar = (ProgressBar) findViewById(R.id.play_video_progress_bar);
try {
@@ -138,9 +160,11 @@ public class PlayVideoActivity extends AppCompatActivity {
}
});
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
if (android.os.Build.VERSION.SDK_INT >= 17) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
}
prefs = getPreferences(Context.MODE_PRIVATE);
if(prefs.getBoolean(PREF_IS_LANDSCAPE, false) && !isLandscape) {
@@ -148,11 +172,6 @@ public class PlayVideoActivity extends AppCompatActivity {
}
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
}
@Override
public boolean onCreatePanelMenu(int featured, Menu menu) {
super.onCreatePanelMenu(featured, menu);
@@ -162,11 +181,6 @@ public class PlayVideoActivity extends AppCompatActivity {
return true;
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onPause() {
super.onPause();
@@ -203,10 +217,10 @@ public class PlayVideoActivity extends AppCompatActivity {
if (config.orientation == Configuration.ORIENTATION_LANDSCAPE) {
isLandscape = true;
adjustMediaControllMetrics();
adjustMediaControlMetrics();
} else if (config.orientation == Configuration.ORIENTATION_PORTRAIT){
isLandscape = false;
adjustMediaControllMetrics();
adjustMediaControlMetrics();
}
}
@@ -229,7 +243,7 @@ public class PlayVideoActivity extends AppCompatActivity {
uiIsHidden = false;
mediaController.show(100000);
actionBar.show();
adjustMediaControllMetrics();
adjustMediaControlMetrics();
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@@ -250,16 +264,18 @@ public class PlayVideoActivity extends AppCompatActivity {
uiIsHidden = true;
actionBar.hide();
mediaController.hide();
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
if (android.os.Build.VERSION.SDK_INT >= 17) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
}
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
private void adjustMediaControllMetrics() {
private void adjustMediaControlMetrics() {
MediaController.LayoutParams mediaControllerLayout
= new MediaController.LayoutParams(MediaController.LayoutParams.MATCH_PARENT,
MediaController.LayoutParams.WRAP_CONTENT);
@@ -274,12 +290,10 @@ public class PlayVideoActivity extends AppCompatActivity {
mediaController.setLayoutParams(mediaControllerLayout);
}
private boolean checkIfhasSoftKeys(){
if(Build.VERSION.SDK_INT >= 17) {
return getNavigationBarHeight() != 0 || getNavigationBarWidth() != 0;
} else {
return true;
}
private boolean checkIfHasSoftKeys(){
return Build.VERSION.SDK_INT >= 17 ||
getNavigationBarHeight() != 0 ||
getNavigationBarWidth() != 0;
}
private int getNavigationBarHeight() {
@@ -316,7 +330,7 @@ public class PlayVideoActivity extends AppCompatActivity {
}
}
public boolean checkIfLandscape() {
private boolean checkIfLandscape() {
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
return displayMetrics.heightPixels < displayMetrics.widthPixels;
@@ -332,6 +346,6 @@ public class PlayVideoActivity extends AppCompatActivity {
}
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean(PREF_IS_LANDSCAPE, isLandscape);
editor.commit();
editor.apply();
}
}

View File

@@ -9,10 +9,9 @@ import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
@@ -70,14 +69,11 @@ public class SettingsActivity extends PreferenceActivity {
getDelegate().onPostCreate(savedInstanceState);
}
public ActionBar getSupportActionBar() {
private ActionBar getSupportActionBar() {
return getDelegate().getSupportActionBar();
}
public void setSupportActionBar(@Nullable Toolbar toolbar) {
getDelegate().setSupportActionBar(toolbar);
}
@NonNull
@Override
public MenuInflater getMenuInflater() {
return getDelegate().getMenuInflater();
@@ -162,7 +158,7 @@ public class SettingsActivity extends PreferenceActivity {
Environment.getExternalStorageDirectory().getAbsolutePath() + "/NewPipe";
spEditor.putString(context.getString(R.string.downloadPathPreference)
, newPipeDownloadStorage);
spEditor.commit();
spEditor.apply();
}
}
}

View File

@@ -1,5 +1,9 @@
package org.schabi.newpipe;
import org.schabi.newpipe.services.AbstractVideoInfo;
import java.util.List;
/**
* Created by Christian Schabesberger on 26.08.15.
*
@@ -20,126 +24,78 @@ package org.schabi.newpipe;
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/
import android.graphics.Bitmap;
import android.util.Log;
/**Info object for opened videos, ie the video ready to play.*/
@SuppressWarnings("ALL")
public class VideoInfo extends AbstractVideoInfo {
import java.util.Vector;
public String uploader_thumbnail_url = "";
public String description = "";
public VideoStream[] videoStreams = null;
public AudioStream[] audioStreams = null;
public int videoAvailableStatus = VIDEO_AVAILABLE;
public int duration = -1;
public class VideoInfo {
private static final String TAG = VideoInfo.class.toString();
// format identifier
public static final int I_MPEG_4 = 0x0;
public static final int I_3GPP = 0x1;
public static final int I_WEBM = 0x2;
public static final int I_M4A = 0x3;
public static final int I_WEBMA = 0x4;
// format name
public static final String F_MPEG_4 = "MPEG-4";
public static final String F_3GPP = "3GPP";
public static final String F_WEBM = "WebM";
public static final String F_M4A = "m4a";
public static final String F_WEBMA = "WebM";
// file suffix
public static final String C_MPEG_4 = "mp4";
public static final String C_3GPP = "3gp";
public static final String C_WEBM = "webm";
public static final String C_M4A = "m4a";
public static final String C_WEBMA = "webm";
// mimeType
public static final String M_MPEG_4 = "video/mp4";
public static final String M_3GPP = "video/3gpp";
public static final String M_WEBM = "video/webm";
public static final String M_M4A = "audio/mp4";
public static final String M_WEBMA = "audio/webm";
/*YouTube-specific fields
todo: move these to a subclass*/
public int age_limit = 0;
public int like_count = -1;
public int dislike_count = -1;
public String average_rating = "";
public VideoPreviewInfo nextVideo = null;
public List<VideoPreviewInfo> relatedVideos = null;
public int startPosition = -1;//in seconds. some metadata is not passed using a VideoInfo object!
public static final int VIDEO_AVAILABLE = 0x00;
public static final int VIDEO_UNAVAILABLE = 0x01;
public static final int VIDEO_UNAVAILABLE_GEMA = 0x02;
public static final int VIDEO_UNAVAILABLE_GEMA = 0x02;//German DRM organisation
public static String getNameById(int id) {
switch(id) {
case I_MPEG_4: return F_MPEG_4;
case I_3GPP: return F_3GPP;
case I_WEBM: return F_WEBM;
case I_M4A: return F_M4A;
case I_WEBMA: return F_WEBMA;
default: Log.e(TAG, "format not known: " +
Integer.toString(id) + "call the programmer he messed it up.");
}
return "";
}
public static String getSuffixById(int id) {
switch(id) {
case I_MPEG_4: return C_MPEG_4;
case I_3GPP: return C_3GPP;
case I_WEBM: return C_WEBM;
case I_M4A: return C_M4A;
case I_WEBMA: return C_WEBMA;
default: Log.e(TAG, "format not known: " +
Integer.toString(id) + "call the programmer he messed it up.");
}
return "";
}
public VideoInfo() {}
public static String getMimeById(int id) {
switch(id) {
case I_MPEG_4: return M_MPEG_4;
case I_3GPP: return M_3GPP;
case I_WEBM: return M_WEBM;
case I_M4A: return M_M4A;
case I_WEBMA: return M_WEBMA;
default: Log.e(TAG, "format not known: " +
Integer.toString(id) + "call the programmer he messed it up.");
/**Creates a new VideoInfo object from an existing AbstractVideoInfo.
* All the shared properties are copied to the new VideoInfo.*/
@SuppressWarnings("WeakerAccess")
public VideoInfo(AbstractVideoInfo avi) {
this.id = avi.id;
this.title = avi.title;
this.uploader = avi.uploader;
this.thumbnail_url = avi.thumbnail_url;
this.thumbnail = avi.thumbnail;
this.webpage_url = avi.webpage_url;
this.upload_date = avi.upload_date;
this.upload_date = avi.upload_date;
this.view_count = avi.view_count;
//todo: better than this
if(avi instanceof VideoPreviewInfo) {//shitty String to convert code
String dur = ((VideoPreviewInfo)avi).duration;
int minutes = Integer.parseInt(dur.substring(0, dur.indexOf(":")));
int seconds = Integer.parseInt(dur.substring(dur.indexOf(":")+1, dur.length()));
this.duration = (minutes*60)+seconds;
}
return "";
}
public static class VideoStream {
public VideoStream(String url, int format, String res) {
this.url = url; this.format = format; resolution = res;
}
public String url = ""; //url of the stream
public int format = -1;
public String resolution = "";
public VideoStream(String url, int format, String res) {
this.url = url; this.format = format; resolution = res;
}
}
@SuppressWarnings("unused")
public static class AudioStream {
public AudioStream(String url, int format, int bandWidth, int samplingRate) {
this.url = url; this.format = format;
this.bandWidth = bandWidth; this.samplingRate = samplingRate;
}
public String url = "";
public int format = -1;
public int bandWidth = -1;
public int bandwidth = -1;
public int samplingRate = -1;
public AudioStream(String url, int format, int bandwidth, int samplingRate) {
this.url = url; this.format = format;
this.bandwidth = bandwidth; this.samplingRate = samplingRate;
}
}
public String id = "";
public String uploader = "";
public String upload_date = "";
public String uploader_thumbnail_url = "";
public Bitmap uploader_thumbnail = null;
public String title = "";
public String thumbnail_url = "";
public Bitmap thumbnail = null;
public String description = "";
public int duration = -1;
public int age_limit = 0;
public String webpage_url = "";
public String view_count = "";
public String like_count = "";
public String dislike_count = "";
public String average_rating = "";
public VideoStream[] videoStreams = null;
public AudioStream[] audioStreams = null;
public VideoInfoItem nextVideo = null;
public Vector<VideoInfoItem> relatedVideos = null;
public int videoAvailableStatus = VIDEO_AVAILABLE;
}

View File

@@ -1,34 +0,0 @@
package org.schabi.newpipe;
import android.graphics.Bitmap;
/**
* Created by Christian Schabesberger on 26.08.15.
*
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
* VideoInfoItem.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 VideoInfoItem {
public String id = "";
public String title = "";
public String uploader = "";
public String duration = "";
public String thumbnail_url = "";
public Bitmap thumbnail = null;
public String webpage_url = "";
public String upload_date = "";
}

View File

@@ -0,0 +1,74 @@
package org.schabi.newpipe;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
/**
* Created by Christian Schabesberger on 24.10.15.
*
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
* VideoInfoItemViewCreator.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/>.
*/
class VideoInfoItemViewCreator {
private final LayoutInflater inflater;
public VideoInfoItemViewCreator(LayoutInflater inflater) {
this.inflater = inflater;
}
public View getViewByVideoInfoItem(View convertView, ViewGroup parent, VideoPreviewInfo info) {
ViewHolder holder;
if(convertView == null) {
convertView = inflater.inflate(R.layout.video_item, parent, false);
holder = new ViewHolder();
holder.itemThumbnailView = (ImageView) convertView.findViewById(R.id.itemThumbnailView);
holder.itemVideoTitleView = (TextView) convertView.findViewById(R.id.itemVideoTitleView);
holder.itemUploaderView = (TextView) convertView.findViewById(R.id.itemUploaderView);
holder.itemDurationView = (TextView) convertView.findViewById(R.id.itemDurationView);
holder.itemUploadDateView = (TextView) convertView.findViewById(R.id.itemUploadDateView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
if(info.thumbnail == null) {
holder.itemThumbnailView.setImageResource(R.drawable.dummy_thumbnail);
} else {
holder.itemThumbnailView.setImageBitmap(info.thumbnail);
}
holder.itemVideoTitleView.setText(info.title);
holder.itemUploaderView.setText(info.uploader);
holder.itemDurationView.setText(info.duration);
if(!info.upload_date.isEmpty()) {
holder.itemUploadDateView.setText(info.upload_date);
} else {
//tweak if necessary: This is a hack to prevent having white space in the layout :P
holder.itemUploadDateView.setText(String.format("%d", info.view_count));
}
return convertView;
}
private class ViewHolder {
public ImageView itemThumbnailView;
public TextView itemVideoTitleView, itemUploaderView, itemDurationView, itemUploadDateView;
}
}

View File

@@ -1,22 +1,17 @@
package org.schabi.newpipe;
import android.content.ContentProviderOperation;
import android.content.res.Configuration;
import android.os.Build;
import android.preference.PreferenceManager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.NavUtils;
import android.util.DisplayMetrics;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.WindowManager;
import android.widget.Toast;
import org.schabi.newpipe.youtube.YoutubeExtractor;
import org.schabi.newpipe.services.ServiceList;
import org.schabi.newpipe.services.StreamingService;
/**
@@ -41,17 +36,23 @@ public class VideoItemDetailActivity extends AppCompatActivity {
private static final String TAG = VideoItemDetailActivity.class.toString();
private VideoItemDetailFragment fragment;
private String videoUrl;
private int currentStreamingService = -1;
private boolean isLandscape;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_videoitem_detail);
// Show the Up button in the action bar.
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
ActionBarHandler.getHandler().setupNavMenu(this);
try {
//noinspection ConstantConditions
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch(Exception e) {
Log.d(TAG, "Could not get SupportActionBar");
e.printStackTrace();
}
// savedInstanceState is non-null when there is fragment state
// saved from previous configurations of this activity
@@ -69,22 +70,23 @@ public class VideoItemDetailActivity extends AppCompatActivity {
if (getIntent().getData() != null) {
videoUrl = getIntent().getData().toString();
StreamingService[] serviceList = ServiceList.getServices();
Extractor extractor = null;
//VideoExtractor videoExtractor = null;
for (int i = 0; i < serviceList.length; i++) {
if (serviceList[i].acceptUrl(videoUrl)) {
arguments.putInt(VideoItemDetailFragment.STREAMING_SERVICE, i);
try {
currentStreamingService = i;
extractor = (Extractor) ServiceList.getService(i)
.getExtractorClass().newInstance();
} catch (Exception e) {
e.printStackTrace();
}
currentStreamingService = i;
//videoExtractor = ServiceList.getService(i).getExtractorInstance();
break;
}
}
arguments.putString(VideoItemDetailFragment.VIDEO_URL,
extractor.getVideoUrl(extractor.getVideoId(videoUrl)));
if(currentStreamingService == -1) {
Toast.makeText(this, R.string.urlNotSupportedText, Toast.LENGTH_LONG)
.show();
}
//arguments.putString(VideoItemDetailFragment.VIDEO_URL,
// videoExtractor.getVideoUrl(videoExtractor.getVideoId(videoUrl)));//cleans URL
arguments.putString(VideoItemDetailFragment.VIDEO_URL, videoUrl);
arguments.putBoolean(VideoItemDetailFragment.AUTO_PLAY,
PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean(getString(R.string.autoPlayThroughIntent), false));
@@ -95,14 +97,27 @@ public class VideoItemDetailActivity extends AppCompatActivity {
arguments.putInt(VideoItemDetailFragment.STREAMING_SERVICE, currentStreamingService);
arguments.putBoolean(VideoItemDetailFragment.AUTO_PLAY, false);
}
// Create the detail fragment and add it to the activity
// using a fragment transaction.
VideoItemDetailFragment fragment = new VideoItemDetailFragment();
fragment.setArguments(arguments);
getSupportFragmentManager().beginTransaction()
.add(R.id.videoitem_detail_container, fragment)
.commit();
} else {
videoUrl = savedInstanceState.getString(VideoItemDetailFragment.VIDEO_URL);
currentStreamingService = savedInstanceState.getInt(VideoItemDetailFragment.STREAMING_SERVICE);
arguments = savedInstanceState;
}
// Create the detail fragment and add it to the activity
// using a fragment transaction.
fragment = new VideoItemDetailFragment();
fragment.setArguments(arguments);
getSupportFragmentManager().beginTransaction()
.add(R.id.videoitem_detail_container, fragment)
.commit();
}
@Override
public void onSaveInstanceState(Bundle outState) {
outState.putString(VideoItemDetailFragment.VIDEO_URL, videoUrl);
outState.putInt(VideoItemDetailFragment.STREAMING_SERVICE, currentStreamingService);
outState.putBoolean(VideoItemDetailFragment.AUTO_PLAY, false);
}
@Override
@@ -113,25 +128,23 @@ public class VideoItemDetailActivity extends AppCompatActivity {
// activity, the Up button is shown. Use NavUtils to allow users
// to navigate up one level in the application structure. For
// more details, see the Navigation pattern on Android Design:
//
// http://developer.android.com/design/patterns/navigation.html#up-vs-back
//
Intent intent = new Intent(this, VideoItemListActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
NavUtils.navigateUpTo(this, intent);
return true;
} else {
ActionBarHandler.getHandler().onItemSelected(item, this);
return fragment.onOptionsItemSelected(item) ||
super.onOptionsItemSelected(item);
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onCreatePanelMenu(int featured, Menu menu) {
super.onCreatePanelMenu(featured, menu);
MenuInflater inflater = getMenuInflater();
ActionBarHandler.getHandler().setupMenu(menu, inflater, this);
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
fragment.onCreateOptionsMenu(menu, getMenuInflater());
return true;
}
}

View File

@@ -2,22 +2,20 @@ package org.schabi.newpipe;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;
import android.util.DisplayMetrics;
import android.support.v7.widget.SearchView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.support.v7.widget.SearchView;
import android.widget.ImageView;
import java.util.ArrayList;
import org.schabi.newpipe.services.ServiceList;
/**
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
@@ -41,15 +39,27 @@ public class VideoItemListActivity extends AppCompatActivity
implements VideoItemListFragment.Callbacks {
private static final String TAG = VideoItemListFragment.class.toString();
// arguments to give to this activity
public static final String VIDEO_INFO_ITEMS = "video_info_items";
// savedInstanceBundle arguments
private static final String QUERY = "query";
private static final String STREAMING_SERVICE = "streaming_service";
// activity modes
private static final int SEARCH_MODE = 0;
private static final int PRESENT_VIDEOS_MODE = 1;
private int mode = SEARCH_MODE;
private int currentStreamingServiceId = -1;
private String searchQuery = "";
private VideoItemListFragment listFragment;
private VideoItemDetailFragment videoFragment = null;
private Menu menu = null;
public class SearchVideoQueryListener implements SearchView.OnQueryTextListener {
private class SearchVideoQueryListener implements SearchView.OnQueryTextListener {
@Override
public boolean onQueryTextSubmit(String query) {
@@ -60,15 +70,20 @@ public class VideoItemListActivity extends AppCompatActivity
// hide virtual keyboard
InputMethodManager inputManager =
(InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(
getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
try {
//noinspection ConstantConditions
inputManager.hideSoftInputFromWindow(
getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
} catch(NullPointerException e) {
Log.e(TAG, "Could not get widget with focus");
e.printStackTrace();
}
// clear focus
// 1. to not open up the keyboard after switching back to this
// 2. It's a workaround to a seeming bug by the Android OS it self, causing
// onQueryTextSubmit to trigger twice when focus is not cleared.
// See: http://stackoverflow.com/questions/17874951/searchview-onquerytextsubmit-runs-twice-while-i-pressed-once
getCurrentFocus().clearFocus();
hideWatermark();
} catch(Exception e) {
e.printStackTrace();
}
@@ -82,13 +97,6 @@ public class VideoItemListActivity extends AppCompatActivity
}
private void hideWatermark() {
ImageView waterMark = (ImageView) findViewById(R.id.list_view_watermark);
if(waterMark != null) {
waterMark.setVisibility(View.GONE);
}
}
/**
* Whether or not the activity is in two-pane mode, i.e. running on a tablet
* device.
@@ -100,21 +108,39 @@ public class VideoItemListActivity extends AppCompatActivity
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_videoitem_list);
listFragment = (VideoItemListFragment)
getSupportFragmentManager().findFragmentById(R.id.videoitem_list);
//-------- remove this line when multiservice support is implemented ----------
//------ todo: remove this line when multiservice support is implemented ------
currentStreamingServiceId = ServiceList.getIdOfService("Youtube");
//-----------------------------------------------------------------------------
VideoItemListFragment listFragment = (VideoItemListFragment) getSupportFragmentManager()
listFragment = (VideoItemListFragment) getSupportFragmentManager()
.findFragmentById(R.id.videoitem_list);
listFragment.setStreamingService(ServiceList.getService(currentStreamingServiceId));
if(savedInstanceState != null) {
Bundle arguments = getIntent().getExtras();
if(arguments != null) {
//Parcelable[] p = arguments.getParcelableArray(VIDEO_INFO_ITEMS);
ArrayList<VideoPreviewInfo> p = arguments.getParcelableArrayList(VIDEO_INFO_ITEMS);
if(p != null) {
mode = PRESENT_VIDEOS_MODE;
try {
//noinspection ConstantConditions
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch (NullPointerException e) {
Log.e(TAG, "Could not get SupportActionBar");
e.printStackTrace();
}
listFragment.present(p);
}
}
if(savedInstanceState != null
&& mode != PRESENT_VIDEOS_MODE) {
searchQuery = savedInstanceState.getString(QUERY);
currentStreamingServiceId = savedInstanceState.getInt(STREAMING_SERVICE);
if(!searchQuery.isEmpty()) {
hideWatermark();
listFragment.search(searchQuery);
}
}
@@ -134,18 +160,18 @@ public class VideoItemListActivity extends AppCompatActivity
.setActivateOnItemClick(true);
SearchView searchView = (SearchView)findViewById(R.id.searchViewTablet);
// Somehow the seticonifiedbydefault property set by the layout xml is not working on
// the support version on SearchView, so it needs to be set programmatically.
searchView.setIconifiedByDefault(false);
searchView.setIconified(false);
searchView.setOnQueryTextListener(new SearchVideoQueryListener());
ActionBarHandler.getHandler().setupNavMenu(this);
if(mode != PRESENT_VIDEOS_MODE) {
// Somehow the seticonifiedbydefault property set by the layout xml is not working on
// the support version on SearchView, so it needs to be set programmatically.
searchView.setIconifiedByDefault(false);
searchView.setIconified(false);
searchView.setOnQueryTextListener(new SearchVideoQueryListener());
} else {
searchView.setVisibility(View.GONE);
}
}
SettingsActivity.initSettings(this);
}
/**
@@ -167,10 +193,17 @@ public class VideoItemListActivity extends AppCompatActivity
arguments.putString(VideoItemDetailFragment.ARG_ITEM_ID, id);
arguments.putString(VideoItemDetailFragment.VIDEO_URL, webpage_url);
arguments.putInt(VideoItemDetailFragment.STREAMING_SERVICE, currentStreamingServiceId);
VideoItemDetailFragment fragment = new VideoItemDetailFragment();
fragment.setArguments(arguments);
videoFragment = new VideoItemDetailFragment();
videoFragment.setArguments(arguments);
videoFragment.setOnInvokeCreateOptionsMenuListener(new VideoItemDetailFragment.OnInvokeCreateOptionsMenuListener() {
@Override
public void createOptionsMenu() {
menu.clear();
onCreateOptionsMenu(menu);
}
});
getSupportFragmentManager().beginTransaction()
.replace(R.id.videoitem_detail_container, fragment)
.replace(R.id.videoitem_detail_container, videoFragment)
.commit();
} else {
// In single-pane mode, simply start the detail activity
@@ -184,10 +217,12 @@ public class VideoItemListActivity extends AppCompatActivity
}
public boolean onCreatePanelMenu(int featured, Menu menu) {
super.onCreatePanelMenu(featured, menu);
if(findViewById(R.id.videoitem_detail_container) == null) {
MenuInflater inflater = getMenuInflater();
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
this.menu = menu;
MenuInflater inflater = getMenuInflater();
if(mode != PRESENT_VIDEOS_MODE &&
findViewById(R.id.videoitem_detail_container) == null) {
inflater.inflate(R.menu.videoitem_list, menu);
MenuItem searchItem = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) searchItem.getActionView();
@@ -195,9 +230,10 @@ public class VideoItemListActivity extends AppCompatActivity
searchView.setOnQueryTextListener(
new SearchVideoQueryListener());
} else if (videoFragment != null){
videoFragment.onCreateOptionsMenu(menu, inflater);
} else {
MenuInflater inflater = getMenuInflater();
ActionBarHandler.getHandler().setupMenu(menu, inflater, this);
inflater.inflate(R.menu.videoitem_two_pannel, menu);
}
return true;
@@ -206,14 +242,23 @@ public class VideoItemListActivity extends AppCompatActivity
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if(id == R.id.action_settings) {
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
} else {
ActionBarHandler.getHandler().onItemSelected(item, this);
return super.onOptionsItemSelected(item);
switch(id) {
case android.R.id.home: {
Intent intent = new Intent(this, VideoItemListActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
NavUtils.navigateUpTo(this, intent);
return true;
}
case R.id.action_settings: {
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
return true;
}
default:
return videoFragment.onOptionsItemSelected(item) ||
super.onOptionsItemSelected(item);
}
return true;
}
@Override

View File

@@ -2,18 +2,18 @@ package org.schabi.newpipe;
import android.content.Context;
import android.graphics.Bitmap;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import java.util.List;
import java.util.Vector;
/**
* Created by the-scrabi on 11.08.15.
* Created by Christian Schabesberger on 11.08.15.
*
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
* VideoListAdapter.java is part of NewPipe.
@@ -32,22 +32,22 @@ import java.util.Vector;
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
*/
public class VideoListAdapter extends BaseAdapter {
private static final String TAG = VideoListAdapter.class.toString();
private LayoutInflater inflater;
private Vector<VideoInfoItem> videoList = new Vector<>();
class VideoListAdapter extends BaseAdapter {
private final Context context;
private final VideoInfoItemViewCreator viewCreator;
private Vector<VideoPreviewInfo> videoList = new Vector<>();
private Vector<Boolean> downloadedThumbnailList = new Vector<>();
VideoItemListFragment videoListFragment;
ListView listView;
private final ListView listView;
public VideoListAdapter(Context context, VideoItemListFragment videoListFragment) {
inflater = LayoutInflater.from(context);
this.videoListFragment = videoListFragment;
viewCreator = new VideoInfoItemViewCreator(LayoutInflater.from(context));
this.listView = videoListFragment.getListView();
this.listView.setDivider(null);
this.listView.setDividerHeight(0);
this.context = context;
}
public void addVideoList(Vector<VideoInfoItem> videos) {
public void addVideoList(List<VideoPreviewInfo> videos) {
videoList.addAll(videos);
for(int i = 0; i < videos.size(); i++) {
downloadedThumbnailList.add(false);
@@ -61,12 +61,12 @@ public class VideoListAdapter extends BaseAdapter {
notifyDataSetChanged();
}
public Vector<VideoInfoItem> getVideoList() {
public Vector<VideoPreviewInfo> getVideoList() {
return videoList;
}
public void updateDownloadedThumbnailList(int index, boolean val) {
downloadedThumbnailList.set(index, val);
public void updateDownloadedThumbnailList(int index) {
downloadedThumbnailList.set(index, true);
}
public Vector<Boolean> getDownloadedThumbnailList() {
@@ -96,42 +96,14 @@ public class VideoListAdapter extends BaseAdapter {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if(convertView == null) {
convertView = inflater.inflate(R.layout.video_item, parent, false);
holder = new ViewHolder();
holder.itemThumbnailView = (ImageView) convertView.findViewById(R.id.itemThumbnailView);
holder.itemVideoTitleView = (TextView) convertView.findViewById(R.id.itemVideoTitleView);
holder.itemUploaderView = (TextView) convertView.findViewById(R.id.itemUploaderView);
holder.itemDurationView = (TextView) convertView.findViewById(R.id.itemDurationView);
holder.itemUploadDateView = (TextView) convertView.findViewById(R.id.itemUploadDateView);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
final Context context = parent.getContext();
if(videoList.get(position).thumbnail == null) {
holder.itemThumbnailView.setImageResource(R.drawable.dummi_thumbnail);
} else {
holder.itemThumbnailView.setImageBitmap(videoList.get(position).thumbnail);
}
holder.itemVideoTitleView.setText(videoList.get(position).title);
holder.itemUploaderView.setText(videoList.get(position).uploader);
holder.itemDurationView.setText(videoList.get(position).duration);
holder.itemUploadDateView.setText(videoList.get(position).upload_date);
convertView = viewCreator.getViewByVideoInfoItem(convertView, parent, videoList.get(position));
if(listView.isItemChecked(position)) {
convertView.setBackgroundColor(context.getResources().getColor(R.color.primaryColorYoutube));
convertView.setBackgroundColor(ContextCompat.getColor(context,R.color.primaryColorYoutube));
} else {
convertView.setBackgroundColor(0);
}
return convertView;
}
private class ViewHolder {
public ImageView itemThumbnailView;
public TextView itemVideoTitleView, itemUploaderView, itemDurationView, itemUploadDateView;
}
}

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