From 038c59ce666c28e947601906f5310e5992c7517e Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sat, 24 Oct 2015 16:04:27 +0200 Subject: [PATCH] fiexed some smaller displaying errors --- .idea/misc.xml | 2 +- .../org/schabi/newpipe/PlayVideoActivity.java | 20 +++++++++++-------- .../newpipe/youtube/YoutubeExtractor.java | 14 ++++++------- .../res/layout/fragment_videoitem_detail.xml | 6 ++++++ 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 5d1998103..fbb68289f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java b/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java index 07a5886aa..d05f721a2 100644 --- a/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java +++ b/app/src/main/java/org/schabi/newpipe/PlayVideoActivity.java @@ -133,9 +133,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) { @@ -245,11 +247,13 @@ 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); } diff --git a/app/src/main/java/org/schabi/newpipe/youtube/YoutubeExtractor.java b/app/src/main/java/org/schabi/newpipe/youtube/YoutubeExtractor.java index 6b8ef314b..39425db27 100644 --- a/app/src/main/java/org/schabi/newpipe/youtube/YoutubeExtractor.java +++ b/app/src/main/java/org/schabi/newpipe/youtube/YoutubeExtractor.java @@ -294,23 +294,23 @@ public class YoutubeExtractor implements Extractor { // view count videoInfo.view_count = doc.select("div[class=\"watch-view-count\"]").first().text(); - /* todo finish this code - + /* // next video videoInfo.nextVideo = extractVideoInfoItem(doc.select("div[class=\"watch-sidebar-section\"]").first() .select("li").first()); + int i = 0; // related videos + videoInfo.relatedVideos = new Vector<>(); for(Element li : doc.select("ul[id=\"watch-related\"]").first().children()) { // first check if we have a playlist. If so leave them out if(li.select("a[class*=\"content-link\"]").first() != null) { - //videoInfo.relatedVideos.add(extractVideoInfoItem(li)); - //i++; - //Log.d(TAG, Integer.toString(i)); + videoInfo.relatedVideos.add(extractVideoInfoItem(li)); + i++; + Log.d(TAG, Integer.toString(i)); } } - */ return videoInfo; @@ -319,7 +319,7 @@ public class YoutubeExtractor implements Extractor { private VideoInfo.AudioStream[] parseDashManifest(String dashManifest, String decryptoinCode) { if(!dashManifest.contains("/signature/")) { String encryptedSig = ""; - String decryptedSig = ""; + String decryptedSig; try { Pattern p = Pattern.compile("/s/([a-fA-F0-9\\.]+)"); Matcher m = p.matcher(dashManifest); diff --git a/app/src/main/res/layout/fragment_videoitem_detail.xml b/app/src/main/res/layout/fragment_videoitem_detail.xml index 3d802b904..c0b37efe8 100644 --- a/app/src/main/res/layout/fragment_videoitem_detail.xml +++ b/app/src/main/res/layout/fragment_videoitem_detail.xml @@ -139,6 +139,12 @@ android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmodtempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. " /> + +