diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java
index 7675b312a..6bf6eef49 100644
--- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java
+++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailActivity.java
@@ -8,6 +8,7 @@ import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
+import android.widget.Toast;
/**
@@ -74,6 +75,10 @@ public class VideoItemDetailActivity extends AppCompatActivity {
break;
}
}
+ if(extractor == null) {
+ Toast.makeText(this, R.string.urlNotSupportedText, Toast.LENGTH_LONG)
+ .show();
+ }
arguments.putString(VideoItemDetailFragment.VIDEO_URL,
extractor.getVideoUrl(extractor.getVideoId(videoUrl)));
arguments.putBoolean(VideoItemDetailFragment.AUTO_PLAY,
diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java
index 542b43a74..f7d803787 100644
--- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java
@@ -23,6 +23,7 @@ import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
+import android.content.Context;
import java.net.URL;
import java.util.Vector;
@@ -63,6 +64,8 @@ public class VideoItemDetailFragment extends Fragment {
private Thread extractorThread = null;
private VideoInfo currentVideoInfo = null;
+ private boolean showNextVideoItem = false;
+
private class ExtractorRunnable implements Runnable {
private Handler h = new Handler();
private Class extractorClass;
@@ -88,11 +91,13 @@ public class VideoItemDetailFragment extends Fragment {
new URL(videoInfo.uploader_thumbnail_url)
.openConnection()
.getInputStream()), SetThumbnailRunnable.CHANNEL_THUMBNAIL));
- h.post(new SetThumbnailRunnable(
- BitmapFactory.decodeStream(
- new URL(videoInfo.nextVideo.thumbnail_url)
- .openConnection()
- .getInputStream()), SetThumbnailRunnable.NEXT_VIDEO_THUMBNAIL));
+ if(showNextVideoItem) {
+ h.post(new SetThumbnailRunnable(
+ BitmapFactory.decodeStream(
+ new URL(videoInfo.nextVideo.thumbnail_url)
+ .openConnection()
+ .getInputStream()), SetThumbnailRunnable.NEXT_VIDEO_THUMBNAIL));
+ }
}
} catch (Exception e) {
e.printStackTrace();
@@ -177,6 +182,8 @@ public class VideoItemDetailFragment extends Fragment {
TextView descriptionView = (TextView) a.findViewById(R.id.detailDescriptionView);
ImageView thumbnailView = (ImageView) a.findViewById(R.id.detailThumbnailView);
FrameLayout nextVideoFrame = (FrameLayout) a.findViewById(R.id.detailNextVideoFrame);
+ RelativeLayout nextVideoRootFrame =
+ (RelativeLayout) a.findViewById(R.id.detailNextVideoRootLayout);
View nextVideoView = videoItemViewCreator
.getViewByVideoInfoItem(null, nextVideoFrame, info.nextVideo);
nextVideoFrame.addView(nextVideoView);
@@ -184,6 +191,9 @@ public class VideoItemDetailFragment extends Fragment {
contentMainView.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.GONE);
+ if(!showNextVideoItem) {
+ nextVideoRootFrame.setVisibility(View.GONE);
+ }
switch (info.videoAvailableStatus) {
case VideoInfo.VIDEO_AVAILABLE: {
@@ -262,6 +272,9 @@ public class VideoItemDetailFragment extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ Context context = getActivity();
+ showNextVideoItem = PreferenceManager.getDefaultSharedPreferences(getActivity())
+ .getBoolean(context.getString(R.string.showNextVideo), true);
}
@Override
diff --git a/app/src/main/res/layout-land/fragment_videoitem_detail.xml b/app/src/main/res/layout-land/fragment_videoitem_detail.xml
index b547e40e6..39313887c 100644
--- a/app/src/main/res/layout-land/fragment_videoitem_detail.xml
+++ b/app/src/main/res/layout-land/fragment_videoitem_detail.xml
@@ -134,54 +134,59 @@
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. "
/>
-
-
-
-
-
-
-
-
+ android:layout_below="@id/detailDescriptionView" >
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+ android:layout_below="@id/detailDescriptionView" >
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+ android:layout_below="@id/detailDescriptionView" >
-
+
+
+
+
+
+
+
+
+
+
+
+ android:layout_below="@id/detailNextVideoRootLayout"/>
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index b19f24c70..f9743430a 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -46,4 +46,6 @@
- Audio
Nächstes Video
+ Zeige \"Nächstes Video\" Auswahl.
+ Url wird nicht unterstützt.
diff --git a/app/src/main/res/values/settings_keys.xml b/app/src/main/res/values/settings_keys.xml
index d130ef4f3..e7c520aa4 100644
--- a/app/src/main/res/values/settings_keys.xml
+++ b/app/src/main/res/values/settings_keys.xml
@@ -23,4 +23,5 @@
- m4a
m4a
+ show_next_video
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 4ae821ec8..f6e4e966a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -46,4 +46,6 @@
- Audio
Next Video
+ Show \"Next video\" item.
+ Url not Supported.
\ No newline at end of file
diff --git a/app/src/main/res/xml/settings_screen.xml b/app/src/main/res/xml/settings_screen.xml
index 487532db7..e9250d4c9 100644
--- a/app/src/main/res/xml/settings_screen.xml
+++ b/app/src/main/res/xml/settings_screen.xml
@@ -46,4 +46,9 @@
android:entryValues="@array/audioFormatList"
android:defaultValue="@string/defaultAudioFormat"/>
+
+
\ No newline at end of file