diff --git a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java
index 84009069a..7a9dc5a05 100644
--- a/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/VideoItemDetailFragment.java
@@ -84,6 +84,9 @@ public class VideoItemDetailFragment extends Fragment {
private VideoInfo currentVideoInfo = null;
private boolean showNextVideoItem = false;
+
+ private View thumbnailWindow;
+
public interface OnInvokeCreateOptionsMenuListener {
void createOptionsMenu();
}
@@ -202,7 +205,7 @@ public class VideoItemDetailFragment extends Fragment {
VideoInfoItemViewCreator videoItemViewCreator =
new VideoInfoItemViewCreator(LayoutInflater.from(getActivity()));
- ScrollView contentMainView = (ScrollView) activity.findViewById(R.id.detailMainContent);
+ RelativeLayout textContentLayout = (RelativeLayout) activity.findViewById(R.id.detailTextContentLayout);
ProgressBar progressBar = (ProgressBar) activity.findViewById(R.id.detailProgressBar);
TextView videoTitleView = (TextView) activity.findViewById(R.id.detailVideoTitleView);
TextView uploaderView = (TextView) activity.findViewById(R.id.detailUploaderView);
@@ -221,7 +224,7 @@ public class VideoItemDetailFragment extends Fragment {
Button nextVideoButton = (Button) activity.findViewById(R.id.detailNextVideoButton);
Button similarVideosButton = (Button) activity.findViewById(R.id.detailShowSimilarButton);
- contentMainView.setVisibility(View.VISIBLE);
+ textContentLayout.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.GONE);
if(!showNextVideoItem) {
nextVideoRootFrame.setVisibility(View.GONE);
@@ -239,8 +242,6 @@ public class VideoItemDetailFragment extends Fragment {
viewCountView.setText(
String.format(
res.getString(R.string.viewCountText), localisedViewCount));
- /*viewCountView.setText(localisedViewCount
- + " " + activity.getString(R.string.viewSufix)); */
thumbsUpView.setText(nf.format(info.like_count));
@@ -336,6 +337,7 @@ public class VideoItemDetailFragment extends Fragment {
activity = (AppCompatActivity) getActivity();
showNextVideoItem = PreferenceManager.getDefaultSharedPreferences(getActivity())
.getBoolean(activity.getString(R.string.showNextVideo), true);
+
}
@Override
@@ -408,6 +410,19 @@ public class VideoItemDetailFragment extends Fragment {
activity.startActivity(intent);
}
});
+
+ ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detailThumbnailView);
+ thumbnailWindow = activity.findViewById(R.id.detailVideoThumbnailWindow);
+ thumbnailView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
+ // This is used to synchronize the thumbnailWindow inside the ScrollView with
+ // the actual size of the thumbnail.
+ @Override
+ public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
+ Log.d(TAG, Integer.toString(right - left) + " : " + Integer.toString(bottom - top));
+ RelativeLayout.LayoutParams newLayoutParams = new RelativeLayout.LayoutParams(right - left, bottom - top);
+ thumbnailWindow.setLayoutParams(newLayoutParams);
+ }
+ });
}
}
diff --git a/app/src/main/res/layout/fragment_videoitem_detail.xml b/app/src/main/res/layout/fragment_videoitem_detail.xml
index 02f7a0eb9..cd668ae1c 100644
--- a/app/src/main/res/layout/fragment_videoitem_detail.xml
+++ b/app/src/main/res/layout/fragment_videoitem_detail.xml
@@ -8,7 +8,8 @@
style="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:id="@+id/videoitem_detail">
+ android:id="@+id/videoitem_detail"
+ android:background="@color/background_gray">
+
+
+ android:visibility="visible">
-
+ android:layout_height="250dp"
+ android:background="@android:color/transparent" />
-
+ android:paddingLeft="5dp"
+ android:background="@color/background_gray">
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 610d00f89..da6355615 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -6,4 +6,5 @@
#aa000000
#eeffffff
#66000000
+ #EEEEEE
\ No newline at end of file