Fix bottom bar lag on first start. Fixes #255

This commit is contained in:
Karim Abou Zeid 2017-09-02 23:27:16 +02:00
commit b8e608816a

View file

@ -119,7 +119,13 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
public void onServiceConnected() {
super.onServiceConnected();
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
hideBottomBar(false);
slidingUpPanelLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
slidingUpPanelLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
hideBottomBar(false);
}
});
} // don't call hideBottomBar(true) here as it causes a bug with the SlidingUpPanelLayout
}