Add a toggle at the player fragment

This commit is contained in:
Bnyro 2022-10-23 15:58:06 +02:00
parent a4b0857879
commit 2e4b6beb2f
6 changed files with 23 additions and 48 deletions

View File

@ -311,10 +311,7 @@ class MainActivity : BaseActivity() {
true true
} }
R.id.action_queue -> { R.id.action_queue -> {
Log.e("open queue", "open queue") PlayingQueueSheet().show(supportFragmentManager, null)
supportFragmentManager.let {
PlayingQueueSheet().show(it, null)
}
true true
} }
else -> super.onOptionsItemSelected(item) else -> super.onOptionsItemSelected(item)

View File

@ -404,7 +404,8 @@ class PlayerFragment : BaseFragment() {
toggleComments() toggleComments()
} }
binding.queueToggle.setOnClickListener { playerBinding.queueToggle.visibility = View.VISIBLE
playerBinding.queueToggle.setOnClickListener {
PlayingQueueSheet().show(childFragmentManager, null) PlayingQueueSheet().show(childFragmentManager, null)
} }

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="48"
android:viewportHeight="48">
<path
android:fillColor="@android:color/white"
android:pathData="M32,40q-2.45,0 -4.2,-1.675t-1.75,-4.075q0,-2.4 1.675,-4.075Q29.4,28.5 31.8,28.5q0.8,0 1.575,0.15 0.775,0.15 1.525,0.5L34.9,12L44,12v3.55h-6.1L37.9,34.3q0,2.35 -1.725,4.025Q34.45,40 32,40ZM6,31.5v-3h15.3v3ZM6,23.25v-3h23.65v3ZM6,15v-3h23.65v3Z" />
</vector>

View File

@ -67,10 +67,17 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layoutDirection="ltr"> android:layoutDirection="ltr">
<ImageButton
android:id="@+id/queue_toggle"
style="@style/PlayerControlTop"
android:layout_marginEnd="2dp"
android:src="@drawable/ic_queue"
android:visibility="gone"
app:tint="@android:color/white" />
<ImageButton <ImageButton
android:id="@+id/toggle_options" android:id="@+id/toggle_options"
style="@style/PlayerControlTop" style="@style/PlayerControlTop"
android:layout_marginTop="-1dp"
android:src="@drawable/ic_arrow_down" android:src="@drawable/ic_arrow_down"
app:tint="@android:color/white" /> app:tint="@android:color/white" />

View File

@ -298,53 +298,12 @@
app:cornerRadius="11dp" /> app:cornerRadius="11dp" />
</LinearLayout> </LinearLayout>
<com.google.android.material.card.MaterialCardView
android:id="@+id/queue_toggle"
style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="10dp"
app:cardCornerRadius="18dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:orientation="horizontal">
<TextView
android:id="@+id/queueToggleTV"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:text="@string/playing_queue"
android:textSize="17sp" />
<ImageView
android:id="@+id/queueToggleIV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="3dp"
android:src="@drawable/ic_arrow_up_down" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:id="@+id/comments_toggle" android:id="@+id/comments_toggle"
style="@style/Widget.Material3.CardView.Elevated" style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_margin="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="10dp"
app:cardCornerRadius="18dp"> app:cardCornerRadius="18dp">
<LinearLayout <LinearLayout

View File

@ -34,6 +34,7 @@
android:id="@+id/title" android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textSize="16sp" android:textSize="16sp"