From 2e4b6beb2f05f71c5ce63ed71270dd814e607d76 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 23 Oct 2022 15:58:06 +0200 Subject: [PATCH] Add a toggle at the player fragment --- .../libretube/ui/activities/MainActivity.kt | 5 +-- .../libretube/ui/fragments/PlayerFragment.kt | 3 +- app/src/main/res/drawable/ic_queue.xml | 10 +++++ .../layout/exo_styled_player_control_view.xml | 9 +++- app/src/main/res/layout/fragment_player.xml | 43 +------------------ app/src/main/res/layout/queue_row.xml | 1 + 6 files changed, 23 insertions(+), 48 deletions(-) create mode 100644 app/src/main/res/drawable/ic_queue.xml diff --git a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt index bdf30f72c..d1d6f1840 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/MainActivity.kt @@ -311,10 +311,7 @@ class MainActivity : BaseActivity() { true } R.id.action_queue -> { - Log.e("open queue", "open queue") - supportFragmentManager.let { - PlayingQueueSheet().show(it, null) - } + PlayingQueueSheet().show(supportFragmentManager, null) true } else -> super.onOptionsItemSelected(item) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index 398800cc0..6f470ce70 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -404,7 +404,8 @@ class PlayerFragment : BaseFragment() { toggleComments() } - binding.queueToggle.setOnClickListener { + playerBinding.queueToggle.visibility = View.VISIBLE + playerBinding.queueToggle.setOnClickListener { PlayingQueueSheet().show(childFragmentManager, null) } diff --git a/app/src/main/res/drawable/ic_queue.xml b/app/src/main/res/drawable/ic_queue.xml new file mode 100644 index 000000000..1bc9c0aad --- /dev/null +++ b/app/src/main/res/drawable/ic_queue.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/exo_styled_player_control_view.xml b/app/src/main/res/layout/exo_styled_player_control_view.xml index 6aaeb0d73..e508662f6 100644 --- a/app/src/main/res/layout/exo_styled_player_control_view.xml +++ b/app/src/main/res/layout/exo_styled_player_control_view.xml @@ -67,10 +67,17 @@ android:layout_gravity="center" android:layoutDirection="ltr"> + + diff --git a/app/src/main/res/layout/fragment_player.xml b/app/src/main/res/layout/fragment_player.xml index a0680cc65..f6326dda2 100644 --- a/app/src/main/res/layout/fragment_player.xml +++ b/app/src/main/res/layout/fragment_player.xml @@ -298,53 +298,12 @@ app:cornerRadius="11dp" /> - - - - - - - - - - - -