Prevent now playing from closing during resume
This commit is contained in:
parent
2054ce5427
commit
d3a317dc9e
|
@ -70,6 +70,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
|
||||||
private SlidingUpPanelLayout slideUpPanel;
|
private SlidingUpPanelLayout slideUpPanel;
|
||||||
private SlidingUpPanelLayout.PanelSlideListener panelSlideListener;
|
private SlidingUpPanelLayout.PanelSlideListener panelSlideListener;
|
||||||
private boolean isPanelClosing = false;
|
private boolean isPanelClosing = false;
|
||||||
|
private boolean resuming = false;
|
||||||
private NowPlayingFragment nowPlayingFragment;
|
private NowPlayingFragment nowPlayingFragment;
|
||||||
private SubsonicFragment secondaryFragment;
|
private SubsonicFragment secondaryFragment;
|
||||||
private Toolbar mainToolbar;
|
private Toolbar mainToolbar;
|
||||||
|
@ -342,6 +343,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
|
resuming = true;
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
if (getIntent().hasExtra(Constants.INTENT_EXTRA_VIEW_ALBUM)) {
|
if (getIntent().hasExtra(Constants.INTENT_EXTRA_VIEW_ALBUM)) {
|
||||||
|
@ -365,6 +367,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
|
||||||
UserUtil.seedCurrentUser(this);
|
UserUtil.seedCurrentUser(this);
|
||||||
createAccount();
|
createAccount();
|
||||||
runWhenServiceAvailable(() -> getDownloadService().addOnSongChangedListener(SubsonicFragmentActivity.this));
|
runWhenServiceAvailable(() -> getDownloadService().addOnSongChangedListener(SubsonicFragmentActivity.this));
|
||||||
|
resuming = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -489,7 +492,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
|
||||||
protected void drawerItemSelected(String fragmentType) {
|
protected void drawerItemSelected(String fragmentType) {
|
||||||
super.drawerItemSelected(fragmentType);
|
super.drawerItemSelected(fragmentType);
|
||||||
|
|
||||||
if (isNowPlayingOpen()) {
|
if (isNowPlayingOpen() && !resuming) {
|
||||||
closeNowPlaying();
|
closeNowPlaying();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue