Use helper function to close now playing

This commit is contained in:
Andrew Rabert 2018-07-03 17:34:58 -04:00
parent 59c814cf16
commit 405fc8cafd

View File

@ -418,7 +418,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED && secondaryFragment == null) { if (slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED && secondaryFragment == null) {
slideUpPanel.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); closeNowPlaying();
} else if (slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) { } else if (slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {
removeCurrent(); removeCurrent();
} else { } else {
@ -488,7 +488,7 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo
super.drawerItemSelected(fragmentType); super.drawerItemSelected(fragmentType);
if (slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) { if (slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {
slideUpPanel.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); closeNowPlaying();
} }
} }