From d3a317dc9ee76fc7f200496c3cc62982a4b87006 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Tue, 3 Jul 2018 17:44:09 -0400 Subject: [PATCH] Prevent now playing from closing during resume --- .../nullsum/audinaut/activity/SubsonicFragmentActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/nullsum/audinaut/activity/SubsonicFragmentActivity.java b/app/src/main/java/net/nullsum/audinaut/activity/SubsonicFragmentActivity.java index 8215261..bab8dcf 100644 --- a/app/src/main/java/net/nullsum/audinaut/activity/SubsonicFragmentActivity.java +++ b/app/src/main/java/net/nullsum/audinaut/activity/SubsonicFragmentActivity.java @@ -70,6 +70,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo private SlidingUpPanelLayout slideUpPanel; private SlidingUpPanelLayout.PanelSlideListener panelSlideListener; private boolean isPanelClosing = false; + private boolean resuming = false; private NowPlayingFragment nowPlayingFragment; private SubsonicFragment secondaryFragment; private Toolbar mainToolbar; @@ -342,6 +343,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo @Override public void onResume() { + resuming = true; super.onResume(); if (getIntent().hasExtra(Constants.INTENT_EXTRA_VIEW_ALBUM)) { @@ -365,6 +367,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo UserUtil.seedCurrentUser(this); createAccount(); runWhenServiceAvailable(() -> getDownloadService().addOnSongChangedListener(SubsonicFragmentActivity.this)); + resuming = false; } @Override @@ -489,7 +492,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo protected void drawerItemSelected(String fragmentType) { super.drawerItemSelected(fragmentType); - if (isNowPlayingOpen()) { + if (isNowPlayingOpen() && !resuming) { closeNowPlaying(); } }