Skip to content

Commit

Permalink
Swap seekbar position with player buttons in background player screen
Browse files Browse the repository at this point in the history
Reorder the Control Elements of the background player (putting the Title down) TeamNewPipe/NewPipe#6824
Fixes: TeamNewPipe/NewPipe#6788
TeamNewPipe/NewPipe#2931

new icons in background player by avently commit in v0.20.0

made image view from playQueue visible by avently in commit
TeamNewPipe/NewPipe@dd726fa#diff-EFCAA05775EEBAE5D5E7D3DD8FB04196
from TeamNewPipe/NewPipe#4360

Co-Authored-By: phigjm <[email protected]>
Co-Authored-By: Stanislav Dmitrenko <[email protected]>
  • Loading branch information
3 people committed Jun 16, 2024
1 parent 39986d6 commit 7273b19
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 88 deletions.
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_next_white_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#ffffff">
<!-- Tint here is for preventing pixelization -->
<path android:fillColor="#ffffff"
android:pathData="M5,19 L15,12 5,5ZM16,5v14h3v-14z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_previous_white_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#ffffff">
<!-- Tint here is for preventing pixelization -->
<path android:fillColor="#ffffff"
android:pathData="m19,5 l-10,7 10,7zM8,19v-14H5v14z"/>
</vector>
166 changes: 80 additions & 86 deletions app/src/main/res/layout/activity_player_queue_control.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -22,50 +22,63 @@
android:layout_weight="1"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:title="@string/app_name"/>
app:title="@string/app_name" />

</com.google.android.material.appbar.AppBarLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/play_queue"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/metadata"
android:layout_below="@id/appbar"
android:layout_above="@id/center"
android:scrollbars="vertical"
app:layoutManager="LinearLayoutManager"
tools:listitem="@layout/play_queue_item"/>
tools:listitem="@layout/play_queue_item" />

<RelativeLayout
<TextView
android:id="@+id/seek_display"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_above="@id/metadata"
android:background="#c0000000"
android:paddingLeft="30dp"
android:paddingTop="5dp"
android:paddingRight="30dp"
android:paddingBottom="5dp"
android:textColor="@android:color/white"
android:textSize="22sp"
android:textStyle="bold"
android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:text="1:06:29"
tools:visibility="visible" />

<LinearLayout
android:id="@+id/metadata"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/center"
android:layout_above="@+id/playback_controls">
android:layout_above="@id/progress_bar"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:padding="8dp"
tools:ignore="RtlHardcoded,RtlSymmetry">

<LinearLayout
android:id="@+id/metadata"
<TextView
android:id="@+id/song_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
tools:ignore="RtlHardcoded,RtlSymmetry">

<TextView
android:id="@+id/song_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="14sp"
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis nec aliquam augue, eget cursus est. Ut id tristique enim, ut scelerisque tellus. Sed ultricies ipsum non mauris ultricies, commodo malesuada velit porta."
/>
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="14sp"
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis nec aliquam augue, eget cursus est. Ut id tristique enim, ut scelerisque tellus. Sed ultricies ipsum non mauris ultricies, commodo malesuada velit porta." />

<TextView
android:id="@+id/artist_name"
Expand All @@ -78,38 +91,18 @@
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="12sp"
tools:text="Duis posuere arcu condimentum lobortis mattis."/>
tools:text="Duis posuere arcu condimentum lobortis mattis." />
</LinearLayout>

<TextView
android:id="@+id/seek_display"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#c0000000"
android:paddingBottom="5dp"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:paddingTop="5dp"
android:textColor="@android:color/white"
android:textSize="22sp"
android:textStyle="bold"
android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:text="1:06:29"
tools:visibility="visible"/>
</RelativeLayout>

<LinearLayout
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:background="@drawable/player_controls_background"
android:orientation="horizontal"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:background="@drawable/player_controls_background">
android:layout_above="@+id/playback_controls">

<TextView
android:id="@+id/current_time"
Expand All @@ -120,7 +113,7 @@
android:text="-:--:--"
android:textColor="?attr/colorAccent"
tools:ignore="HardcodedText"
tools:text="1:06:29"/>
tools:text="1:06:29" />


<androidx.appcompat.widget.AppCompatSeekBar
Expand All @@ -130,11 +123,11 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingStart="12dp"
android:paddingTop="6dp"
android:paddingEnd="12dp"
android:paddingBottom="4dp"
android:paddingTop="6dp"
tools:progress="25"
tools:secondaryProgress="50"/>
tools:secondaryProgress="50" />

<TextView
android:id="@+id/end_time"
Expand All @@ -144,50 +137,51 @@
android:text="-:--:--"
android:textColor="?attr/colorAccent"
tools:ignore="HardcodedText"
tools:text="1:23:49"/>
tools:text="1:23:49" />

<TextView
android:id="@+id/live_sync"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:gravity="center"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:gravity="center"
android:text="@string/duration_live"
android:textAllCaps="true"
android:textColor="?attr/colorAccent"
android:background="?attr/selectableItemBackground"
android:visibility="gone"/>
android:visibility="gone" />
</LinearLayout>

<RelativeLayout
android:id="@+id/playback_controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/progress_bar"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_marginBottom="12dp"
tools:ignore="RtlHardcoded">

<ImageButton
android:id="@+id/control_repeat"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_toLeftOf="@+id/control_backward"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_toLeftOf="@+id/control_backward"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:focusable="true"
android:scaleType="fitXY"
android:tint="?attr/colorAccent"
app:srcCompat="@drawable/ic_repeat_white_24dp"
tools:ignore="ContentDescription"/>
tools:ignore="ContentDescription" />

<ImageButton
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/control_backward"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_toLeftOf="@+id/control_fast_rewind"
Expand All @@ -196,8 +190,8 @@
android:focusable="true"
android:scaleType="fitCenter"
android:tint="?attr/colorAccent"
android:src="@drawable/exo_controls_previous"
tools:ignore="ContentDescription"/>
app:srcCompat="@drawable/ic_previous_white_24dp"
tools:ignore="ContentDescription" />

<ImageButton
android:id="@+id/control_fast_rewind"
Expand All @@ -210,15 +204,15 @@
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:tint="?attr/colorAccent"
android:src="@drawable/exo_controls_rewind"/>
android:src="@drawable/exo_controls_rewind"
android:tint="?attr/colorAccent" />

<ImageButton
android:id="@+id/control_play_pause"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="?attr/selectableItemBackgroundBorderless"
Expand All @@ -227,26 +221,26 @@
android:scaleType="fitCenter"
android:tint="?attr/colorAccent"
app:srcCompat="@drawable/ic_pause_white_24dp"
tools:ignore="ContentDescription"/>
tools:ignore="ContentDescription" />

<ProgressBar
android:id="@+id/control_progress_bar"
style="?android:attr/progressBarStyleLargeInverse"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#00000000"
android:tint="?attr/colorAccent"
android:padding="2dp"
android:clickable="false"
android:scaleType="fitCenter"
android:indeterminate="true"
android:padding="2dp"
android:scaleType="fitCenter"
android:tint="?attr/colorAccent"
android:visibility="invisible"
tools:visibility="visible"/>
tools:visibility="visible" />


<ImageButton
Expand All @@ -260,13 +254,13 @@
android:clickable="true"
android:focusable="true"
android:scaleType="fitCenter"
android:tint="?attr/colorAccent"
android:src="@drawable/exo_controls_fastforward"/>
android:src="@drawable/exo_controls_fastforward"
android:tint="?attr/colorAccent" />

<ImageButton
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/control_forward"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:layout_toRightOf="@+id/control_fast_forward"
Expand All @@ -275,24 +269,24 @@
android:focusable="true"
android:scaleType="fitCenter"
android:tint="?attr/colorAccent"
android:src="@drawable/exo_controls_next"
tools:ignore="ContentDescription"/>
app:srcCompat="@drawable/ic_next_white_24dp"
tools:ignore="ContentDescription" />

<ImageButton
android:id="@+id/control_shuffle"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_toRightOf="@+id/control_forward"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_toRightOf="@+id/control_forward"
android:background="?attr/selectableItemBackgroundBorderless"
android:clickable="true"
android:focusable="true"
android:scaleType="fitXY"
android:tint="?attr/colorAccent"
app:srcCompat="@drawable/ic_shuffle_white_24dp"
tools:ignore="ContentDescription"/>
tools:ignore="ContentDescription" />

</RelativeLayout>

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/play_queue_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:paddingTop="6dp"
android:paddingBottom="6dp">

<ImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/itemSelected"
android:layout_width="10dp"
android:layout_height="10dp"
Expand All @@ -38,7 +38,7 @@
android:src="@drawable/dummy_thumbnail"
tools:ignore="RtlHardcoded"/>

<ImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/itemHandle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
Expand Down

0 comments on commit 7273b19

Please sign in to comment.