From 9085ee3020cdf8c742a2752974fb038a5f841687 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 17 Feb 2019 02:08:13 -0800 Subject: [PATCH] TransportFragment's title now acts as a toggle. --- .../remote/ui/shared/fragment/TransportFragment.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/shared/fragment/TransportFragment.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/shared/fragment/TransportFragment.kt index a8368f9d9..b04402abc 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/shared/fragment/TransportFragment.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/shared/fragment/TransportFragment.kt @@ -56,8 +56,15 @@ class TransportFragment: BaseFragment() { titleBar?.setOnClickListener { if (playback.service.state != PlaybackState.Stopped) { - if (appCompatActivity.supportFragmentManager.topOfStack != PlayQueueFragment.TAG) { - Navigate.toPlayQueue(playback.service.queuePosition, appCompatActivity, this) + appCompatActivity.supportFragmentManager.run { + when (topOfStack != PlayQueueFragment.TAG) { + true -> Navigate.toPlayQueue( + playback.service.queuePosition, + appCompatActivity, + this@TransportFragment) + false -> + this.popBackStack() + } } } }