From 87d5c3552d89e245707fe59d95e5cc0b2431e61e Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 25 Jun 2015 08:57:26 -0700 Subject: Reimplement hiding bottom bar using setPanelState(HIDDEN) --- .../daneren2005/dsub/activity/SubsonicFragmentActivity.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index f7ba429f..43bd15c7 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -597,6 +597,9 @@ public class SubsonicFragmentActivity extends SubsonicActivity { DownloadFile current = downloadService.getCurrentPlaying(); PlayerState state = downloadService.getPlayerState(); if(current == currentPlaying && state == currentState) { + if(current == null && slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) { + slideUpPanel.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN); + } return; } else { currentPlaying = current; @@ -608,9 +611,12 @@ public class SubsonicFragmentActivity extends SubsonicActivity { song = current.getSong(); trackView.setText(song.getTitle()); artistView.setText(song.getArtist()); - } else { - trackView.setText(R.string.main_title); - artistView.setText(R.string.main_artist); + + if(slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.HIDDEN) { + slideUpPanel.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); + } + } else if(slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) { + slideUpPanel.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN); } if (coverArtView != null) { -- cgit v1.2.3