-Added dropdown to start play for all StreamInfoItem.

-Refactored NavigationHelper to allow service player control to open anywhere.
-Refactored NavigationHelper to allow starting player at anywhere.
This commit is contained in:
John Zhen Mo 2017-11-01 22:33:13 -07:00
parent 38b2ffd450
commit 87febf8679
25 changed files with 240 additions and 48 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

View file

@ -7,7 +7,9 @@
android:layout_height="@dimen/video_item_search_height"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:padding="@dimen/video_item_search_padding">
android:focusable="true"
android:paddingTop="@dimen/video_item_search_padding"
android:paddingBottom="@dimen/video_item_search_padding">
<ImageView
android:id="@+id/itemThumbnailView"
@ -16,6 +18,7 @@
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="@dimen/video_item_search_padding"
android:layout_marginRight="@dimen/video_item_search_image_right_margin"
android:contentDescription="@string/list_thumbnail_view_description"
android:scaleType="centerCrop"
@ -42,12 +45,30 @@
tools:ignore="RtlHardcoded"
tools:text="1:09:10"/>
<ImageButton
android:id="@+id/itemActionDropdown"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginLeft="@dimen/video_item_search_image_right_margin"
android:layout_marginStart="@dimen/video_item_search_image_right_margin"
android:background="?attr/selectableItemBackground"
android:src="?attr/more_vertical"
android:visibility="gone"
tools:visibility="visible"
tools:ignore="ContentDescription"/>
<TextView
android:id="@+id/itemVideoTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/itemActionDropdown"
android:layout_toStartOf="@id/itemActionDropdown"
android:layout_toRightOf="@+id/itemThumbnailView"
android:layout_toEndOf="@+id/itemThumbnailView"
android:ellipsize="end"
android:maxLines="2"
android:textAppearance="?android:attr/textAppearanceLarge"
@ -59,7 +80,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/itemVideoTitleView"
android:layout_toLeftOf="@id/itemActionDropdown"
android:layout_toStartOf="@id/itemActionDropdown"
android:layout_toRightOf="@+id/itemThumbnailView"
android:layout_toEndOf="@+id/itemThumbnailView"
android:lines="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_uploader_text_size"
@ -70,7 +94,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/itemActionDropdown"
android:layout_toStartOf="@id/itemActionDropdown"
android:layout_toRightOf="@+id/itemThumbnailView"
android:layout_toEndOf="@+id/itemThumbnailView"
android:lines="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_upload_date_text_size"

View file

@ -7,7 +7,9 @@
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:padding="@dimen/video_item_search_padding">
android:focusable="true"
android:paddingTop="@dimen/video_item_search_padding"
android:paddingBottom="@dimen/video_item_search_padding">
<ImageView
android:id="@+id/itemThumbnailView"
@ -16,6 +18,7 @@
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="@dimen/video_item_search_padding"
android:layout_marginRight="@dimen/video_item_search_image_right_margin"
android:contentDescription="@string/list_thumbnail_view_description"
android:scaleType="centerCrop"
@ -41,13 +44,28 @@
tools:ignore="RtlHardcoded"
tools:text="1:09:10"/>
<ImageButton
android:id="@+id/itemActionDropdown"
android:layout_width="wrap_content"
android:layout_height="55dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="?attr/selectableItemBackground"
android:src="?attr/more_vertical"
android:visibility="gone"
tools:visibility="visible"
tools:ignore="ContentDescription"/>
<TextView
android:id="@+id/itemVideoTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/itemActionDropdown"
android:layout_toStartOf="@id/itemActionDropdown"
android:layout_toRightOf="@+id/itemThumbnailView"
android:layout_toEndOf="@+id/itemThumbnailView"
android:ellipsize="end"
android:maxLines="2"
android:textAppearance="?android:attr/textAppearanceLarge"
@ -59,7 +77,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/itemVideoTitleView"
android:layout_toLeftOf="@id/itemActionDropdown"
android:layout_toStartOf="@id/itemActionDropdown"
android:layout_toRightOf="@+id/itemThumbnailView"
android:layout_toEndOf="@+id/itemThumbnailView"
android:lines="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_uploader_text_size"

View file

@ -20,6 +20,7 @@
<attr name="history" format="reference"/>
<attr name="drag_handle" format="reference"/>
<attr name="selected" format="reference"/>
<attr name="more_vertical" format="reference"/>
<!-- Can't refer to colors directly into drawable's xml-->
<attr name="toolbar_shadow_drawable" format="reference"/>

View file

@ -310,4 +310,6 @@
<string name="play_queue_stream_detail">Details</string>
<string name="play_queue_audio_settings">Audio Settings</string>
<string name="hold_to_append">Hold To Enqueue</string>
<string name="enqueue_on_background">Enqueue on Background</string>
<string name="enqueue_on_popup">Enqueue on Popup</string>
</resources>

View file

@ -27,6 +27,7 @@
<item name="history">@drawable/ic_history_black_24dp</item>
<item name="drag_handle">@drawable/ic_drag_handle_black_24dp</item>
<item name="selected">@drawable/ic_fiber_manual_record_black_24dp</item>
<item name="more_vertical">@drawable/ic_more_vert_black_24dp</item>
<item name="separator_color">@color/light_separator_color</item>
<item name="contrast_background_color">@color/light_contrast_background_color</item>
@ -65,6 +66,7 @@
<item name="history">@drawable/ic_history_white_24dp</item>
<item name="drag_handle">@drawable/ic_drag_handle_white_24dp</item>
<item name="selected">@drawable/ic_fiber_manual_record_white_24dp</item>
<item name="more_vertical">@drawable/ic_more_vert_white_24dp</item>
<item name="separator_color">@color/dark_separator_color</item>
<item name="contrast_background_color">@color/dark_contrast_background_color</item>