1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 02:53:09 +01:00

removed play fab button

This commit is contained in:
Christian Schabesberger 2016-02-17 23:55:19 +01:00
parent 648b9b5d02
commit f0705c612e
9 changed files with 436 additions and 12 deletions

View File

@ -98,6 +98,7 @@ public class VideoItemDetailFragment extends Fragment {
private Bitmap videoThumbnail; private Bitmap videoThumbnail;
private View thumbnailWindowLayout; private View thumbnailWindowLayout;
//this only remains dueto downwards compartiblity
private FloatingActionButton playVideoButton; private FloatingActionButton playVideoButton;
private final Point initialThumbnailPos = new Point(0, 0); private final Point initialThumbnailPos = new Point(0, 0);
@ -232,7 +233,13 @@ public class VideoItemDetailFragment extends Fragment {
initThumbnailViews(info, nextVideoFrame); initThumbnailViews(info, nextVideoFrame);
textContentLayout.setVisibility(View.VISIBLE); textContentLayout.setVisibility(View.VISIBLE);
if (android.os.Build.VERSION.SDK_INT < 18) {
playVideoButton.setVisibility(View.VISIBLE); playVideoButton.setVisibility(View.VISIBLE);
} else {
ImageView playArrowView = (ImageView) activity.findViewById(R.id.playArrowView);
playArrowView.setVisibility(View.VISIBLE);
}
if (!showNextVideoItem) { if (!showNextVideoItem) {
nextVideoRootFrame.setVisibility(View.GONE); nextVideoRootFrame.setVisibility(View.GONE);
similarTitle.setVisibility(View.GONE); similarTitle.setVisibility(View.GONE);
@ -298,12 +305,14 @@ public class VideoItemDetailFragment extends Fragment {
playVideo(info); playVideo(info);
} }
if (android.os.Build.VERSION.SDK_INT < 18) {
playVideoButton.setOnClickListener(new View.OnClickListener() { playVideoButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
playVideo(info); playVideo(info);
} }
}); });
}
backgroundButton.setOnClickListener(new View.OnClickListener() { backgroundButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -653,7 +662,9 @@ public class VideoItemDetailFragment extends Fragment {
public void onActivityCreated(Bundle savedInstanceBundle) { public void onActivityCreated(Bundle savedInstanceBundle) {
super.onActivityCreated(savedInstanceBundle); super.onActivityCreated(savedInstanceBundle);
Activity a = getActivity(); Activity a = getActivity();
if (android.os.Build.VERSION.SDK_INT < 18) {
playVideoButton = (FloatingActionButton) a.findViewById(R.id.playVideoButton); playVideoButton = (FloatingActionButton) a.findViewById(R.id.playVideoButton);
}
thumbnailWindowLayout = a.findViewById(R.id.detailVideoThumbnailWindowLayout); thumbnailWindowLayout = a.findViewById(R.id.detailVideoThumbnailWindowLayout);
Button backgroundButton = (Button) Button backgroundButton = (Button)
a.findViewById(R.id.detailVideoThumbnailWindowBackgroundButton); a.findViewById(R.id.detailVideoThumbnailWindowBackgroundButton);
@ -661,7 +672,7 @@ public class VideoItemDetailFragment extends Fragment {
// Sometimes when this fragment is not visible it still gets initiated // Sometimes when this fragment is not visible it still gets initiated
// then we must not try to access objects of this fragment. // then we must not try to access objects of this fragment.
// Otherwise the applications would crash. // Otherwise the applications would crash.
if(playVideoButton != null) { if(backgroundButton != null) {
try { try {
streamingServiceId = getArguments().getInt(STREAMING_SERVICE); streamingServiceId = getArguments().getInt(STREAMING_SERVICE);
StreamingService streamingService = ServiceList.getService(streamingServiceId); StreamingService streamingService = ServiceList.getService(streamingServiceId);
@ -674,13 +685,15 @@ public class VideoItemDetailFragment extends Fragment {
e.printStackTrace(); e.printStackTrace();
} }
// todo: Fix this workaround (probably with a better design), so that older android
// versions don't have problems rendering the thumbnail right.
if(Build.VERSION.SDK_INT >= 18) { if(Build.VERSION.SDK_INT >= 18) {
ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detailThumbnailView); ImageView thumbnailView = (ImageView) activity.findViewById(R.id.detailThumbnailView);
thumbnailView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { thumbnailView.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
// This is used to synchronize the thumbnailWindowButton and the playVideoButton // This is used to synchronize the thumbnailWindowButton and the playVideoButton
// inside the ScrollView with the actual size of the thumbnail. // inside the ScrollView with the actual size of the thumbnail.
//todo: onLayoutChage sometimes not triggered
// background buttons area seem to overlap the thumbnail view
// So although you just clicked slightly beneath the thumbnail the action still
// gets triggered.
@Override @Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, public void onLayoutChange(View v, int left, int top, int right, int bottom,
int oldLeft, int oldTop, int oldRight, int oldBottom) { int oldLeft, int oldTop, int oldRight, int oldBottom) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -0,0 +1,279 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".VideoItemDetailFragment"
android:textIsSelectable="true"
style="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/videoitem_detail">
<com.nirhart.parallaxscroll.views.ParallaxScrollView
android:id="@+id/detailMainContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible"
app:parallax_factor="1.9"
tools:ignore="UselessParent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/detailVideoThumbnailWindowLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground">
<ImageView android:id="@+id/detailThumbnailView"
android:contentDescription="@string/detail_thumbnail_view_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="@android:color/black"
android:src="@drawable/dummy_thumbnail_dark"/>
<ProgressBar android:id="@+id/detailProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"/>
<ImageView android:id="@+id/playArrowView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:layout_centerInParent="true"
android:src="@drawable/ic_play_circle_transparent"
android:visibility="invisible"/>
<Button
android:id="@+id/detailVideoThumbnailWindowBackgroundButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"/>
</RelativeLayout>
<RelativeLayout android:id="@+id/detailTextContentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/detailVideoThumbnailWindowLayout"
android:background="@color/light_background_color"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/detailTopView">
<TextView android:id="@+id/detailVideoTitleView"
android:layout_width="0dp"
android:layout_weight=".7"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_title_text_size"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginTop="12dp"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:text="Title"/>
<ImageView
android:layout_width="15dp"
android:layout_height="30dp"
android:id="@+id/toggleDescriptionView"
android:src="@drawable/arrow_down"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_marginRight="10dp"
android:layout_marginEnd="10dp"
android:layout_marginTop="8dp"/>
</LinearLayout>
<TextView android:id="@+id/detailViewCountView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_views_text_size"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:text="10,069,948 views"
android:layout_below="@id/detailTopView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="5dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/detailViewCountView"
android:id="@+id/detailExtraView"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"
android:visibility="gone">
<TextView android:id="@+id/detailUploadDateView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_upload_date_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Upload date"
android:layout_marginTop="3dp" />
<TextView android:id="@+id/detailDescriptionView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_description_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_below="@id/detailUploadDateView"
android:text="Description............."
android:layout_marginTop="3dp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayout"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_below="@+id/detailExtraView"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginTop="5dp">
<ImageView android:id="@+id/detailThumbsUpImgView"
android:contentDescription="@string/detail_likes_img_view_description"
android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height"
android:src="@drawable/thumbs_up" />
<TextView android:id="@+id/detailThumbsUpCountView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="200" />
<ImageView android:id="@+id/detailThumbsDownImgView"
android:contentDescription="@string/detail_dislikes_img_view_description"
android:layout_width="@dimen/video_item_detail_like_image_width"
android:layout_height="@dimen/video_item_detail_like_image_height"
android:src="@drawable/thumbs_down"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"/>
<TextView android:id="@+id/detailThumbsDownCountView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/video_item_detail_likes_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="100" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayout"
android:id="@+id/detailUploaderWrapView"
android:layout_marginTop="12dp">
<View
android:background="#000"
android:layout_width="match_parent"
android:layout_height="1px" />
<de.hdodenhof.circleimageview.CircleImageView android:id="@+id/detailUploaderThumbnailView"
android:contentDescription="@string/detail_uploader_thumbnail_view_description"
android:layout_width="@dimen/video_item_detail_uploader_image_size"
android:layout_height="@dimen/video_item_detail_uploader_image_size"
android:src="@drawable/buddy"
android:layout_marginLeft="10dp"
android:layout_marginStart="10dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"/>
<TextView android:id="@+id/detailUploaderView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textSize="@dimen/video_item_detail_uploader_text_size"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Uploader"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/detailUploaderThumbnailView"
android:layout_toEndOf="@+id/detailUploaderThumbnailView"
android:layout_marginLeft="15dp"
android:layout_marginStart="28dp" />
<View
android:background="#000"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@id/detailUploaderThumbnailView"/>
</RelativeLayout>
<RelativeLayout android:id="@+id/detailNextVideoRootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal|bottom"
android:layout_below="@+id/detailUploaderWrapView"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp">
<TextView android:id="@+id/detailNextVideoTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textSize="@dimen/video_item_detail_next_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/next_video_title"
android:textAllCaps="true" />
<RelativeLayout android:id="@+id/detailNextVidButtonAndContentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/detailNextVideoTitle">
<FrameLayout
android:id="@+id/detailNextVideoFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/detailNextVideoButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignTop="@id/detailNextVideoFrame"
android:layout_alignBottom="@id/detailNextVideoFrame"
android:background="?attr/selectableItemBackground"/>
</RelativeLayout>
<TextView android:id="@+id/detailSimilarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textSize="@dimen/video_item_detail_next_text_size"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/similar_videos_btn_text"
android:layout_below="@id/detailNextVidButtonAndContentLayout"
android:textAllCaps="true" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/similarVideosView"
android:layout_below="@id/detailSimilarTitle">
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</com.nirhart.parallaxscroll.views.ParallaxScrollView>
</FrameLayout>

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="80"
viewBox="0 0 80 80"
width="80"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="ic_play_circle_transparent.svg"
style="fill:#000000">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#66666c"
borderopacity="0.90588235"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1012"
id="namedview8"
showgrid="false"
borderlayer="false"
inkscape:zoom="4.8022522"
inkscape:cx="38.183981"
inkscape:cy="89.843249"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<path
d="m 0,56 24,0 0,24 -24,0 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:none" />
<path
d="M 40.000001,6.6666663 C 21.6,6.6666663 6.6666667,21.6 6.6666667,40 6.6666667,58.4 21.6,73.333333 40.000001,73.333333 58.4,73.333333 73.333333,58.4 73.333333,40 73.333333,21.6 58.4,6.6666663 40.000001,6.6666663 Z M 33.333333,55 l 0,-30 20.000001,15 -20.000001,15 z"
id="path6"
style="fill:#ffffff;fill-opacity:0.70547944"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="80"
viewBox="0 0 80 80"
width="80"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="ic_play_circle_transparent_80px.svg"
style="fill:#000000"
inkscape:export-filename="/home/the-scrabi/Desktop/ic_play_circle_transparent.png"
inkscape:export-xdpi="360"
inkscape:export-ydpi="360">
<metadata
id="metadata12">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs10" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#66666c"
borderopacity="0.90588235"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1044"
id="namedview8"
showgrid="false"
borderlayer="false"
inkscape:zoom="15.461127"
inkscape:cx="33.023889"
inkscape:cy="40.665216"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg2" />
<path
d="m 0,56 24,0 0,24 -24,0 z"
id="path4"
inkscape:connector-curvature="0"
style="fill:none" />
<path
d="M 39.999999,6.6666663 C 21.6,6.6666663 6.6666667,21.6 6.6666667,40 6.6666667,58.4 21.6,73.333333 39.999999,73.333333 58.4,73.333333 73.333333,58.4 73.333333,40 73.333333,21.6 58.4,6.6666663 39.999999,6.6666663 Z M 33.333333,55 l 0,-30 20.000001,15 -20.000001,15 z"
id="path6"
style="fill:#ffffff;fill-opacity:0.73287672"
inkscape:connector-curvature="0"
inkscape:export-xdpi="431.99997"
inkscape:export-ydpi="431.99997"
inkscape:export-filename="/home/the-scrabi/Desktop/path6.png" />
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB