Add stream segments to player

This commit is contained in:
vkay94 2021-01-14 21:58:19 +01:00
parent 8fd48a88be
commit 37aa41afae
12 changed files with 406 additions and 49 deletions

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="#FFFFFF"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M2,17h2v0.5L3,17.5v1h1v0.5L2,19v1h3v-4L2,16v1zM3,8h1L4,4L2,4v1h1v3zM2,11h1.8L2,13.1v0.9h3v-1L3.2,13L5,10.9L5,10L2,10v1zM7,5v2h14L21,5L7,5zM7,19h14v-2L7,17v2zM7,13h14v-2L7,11v2z" />
</vector>

View file

@ -191,6 +191,24 @@
tools:ignore="ContentDescription,RtlHardcoded"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/segmentsButton"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="8dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="3dp"
android:paddingTop="5dp"
android:paddingEnd="3dp"
android:paddingBottom="3dp"
android:scaleType="fitCenter"
android:visibility="gone"
app:srcCompat="@drawable/ic_format_list_numbered_white_24"
tools:ignore="ContentDescription,RtlHardcoded"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/moreOptionsButton"
android:layout_width="wrap_content"
@ -452,7 +470,7 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/playQueuePanel"
android:id="@+id/itemsListPanel"
android:layout_width="380dp"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
@ -461,14 +479,30 @@
tools:visibility="visible">
<RelativeLayout
android:id="@+id/playQueueControl"
android:id="@+id/itemsListControl"
android:layout_width="match_parent"
android:layout_height="60dp"
android:clickable="true"
android:focusable="true">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/itemsListHeaderTitle"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@id/itemsListClose"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginStart="16dp"
android:layout_marginEnd="56dp"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/chapters"
android:textColor="@android:color/white"
android:visibility="gone" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/playQueueClose"
android:id="@+id/itemsListClose"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentEnd="true"
@ -517,10 +551,10 @@
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/playQueue"
android:id="@+id/itemsList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/playQueueControl"
android:layout_below="@id/itemsListControl"
android:scrollbars="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/play_queue_item" />

View file

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selector"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
android:paddingStart="16dp"
android:paddingTop="4dp"
android:paddingEnd="16dp"
android:paddingBottom="4dp">
<ImageView
android:id="@+id/previewImage"
android:layout_width="0dp"
android:layout_height="@dimen/play_queue_thumbnail_width"
android:scaleType="centerCrop"
android:src="@drawable/dummy_thumbnail"
app:layout_constraintDimensionRatio="16:9"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<LinearLayout
android:id="@+id/textContainer"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
android:paddingStart="8dp"
android:paddingEnd="0dp"
app:layout_constraintBottom_toBottomOf="@id/previewImage"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/previewImage"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/textViewTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="@dimen/video_item_search_title_text_size"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Lorem ipusum is widely used to create long sample text which is used here too" />
<TextView
android:id="@+id/textViewStartSeconds"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="@dimen/video_item_search_upload_date_text_size"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewTitle"
tools:text="04:26" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -192,6 +192,23 @@
app:srcCompat="@drawable/ic_list_white_24dp"
tools:ignore="ContentDescription,RtlHardcoded" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/segmentsButton"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="8dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:paddingStart="6dp"
android:paddingTop="5dp"
android:paddingEnd="6dp"
android:paddingBottom="3dp"
android:scaleType="fitCenter"
android:visibility="gone"
app:srcCompat="@drawable/ic_format_list_numbered_white_24"
tools:ignore="ContentDescription,RtlHardcoded" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/moreOptionsButton"
android:layout_width="wrap_content"
@ -450,7 +467,7 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/playQueuePanel"
android:id="@+id/itemsListPanel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/queue_background_color"
@ -458,14 +475,30 @@
tools:visibility="visible">
<RelativeLayout
android:id="@+id/playQueueControl"
android:id="@+id/itemsListControl"
android:layout_width="match_parent"
android:layout_height="60dp"
android:clickable="true"
android:focusable="true">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/itemsListHeaderTitle"
style="@style/TextAppearance.AppCompat.Medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@id/itemsListClose"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginStart="16dp"
android:layout_marginEnd="56dp"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/chapters"
android:textColor="@android:color/white"
android:visibility="gone" />
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/playQueueClose"
android:id="@+id/itemsListClose"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentEnd="true"
@ -514,10 +547,10 @@
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/playQueue"
android:id="@+id/itemsList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/playQueueControl"
android:layout_below="@id/itemsListControl"
android:scrollbars="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/play_queue_item" />

View file

@ -692,4 +692,5 @@
<string name="show_thumbnail_title">Show thumbnail</string>
<string name="show_thumbnail_summary">Use thumbnail for both lock screen background and notifications</string>
<string name="recent">Recent</string>
<string name="chapters">Chapters</string>
</resources>