Fixed bottom bar sometimes disappearing from itself after changing the theme.
This commit is contained in:
parent
207d5b381f
commit
bd89289a1f
4 changed files with 35 additions and 16 deletions
|
|
@ -28,12 +28,15 @@
|
|||
<h3>Version 0.9.43 beta2</h3>
|
||||
|
||||
<ol>
|
||||
<li><b>FIX:</b> Playlist view wrong background color on dark theme.
|
||||
<li><b>FIX:</b> Playlist view having wrong background color on dark theme.
|
||||
</li>
|
||||
<li><b>FIX:</b> Progress slider barely visible with dark theme and black accent or light theme
|
||||
<li><b>FIX:</b> Bottom bar sometimes disappearing from itself after changing the theme.
|
||||
</li>
|
||||
<li><b>FIX:</b> Progress slider being barely visible with dark theme and black accent or light
|
||||
theme
|
||||
and white accent.
|
||||
</li>
|
||||
<li><b>FIX:</b> Progress slider stops working when switching between alternative and regular
|
||||
<li><b>FIX:</b> Progress slider stopped working when switching between alternative and regular
|
||||
progress slider.
|
||||
</li>
|
||||
<li><b>FIX:</b> Removed the unneeded menu button from the artist and album list.
|
||||
|
|
|
|||
|
|
@ -161,7 +161,6 @@ public class MusicPlayerRemote {
|
|||
return -1;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ArrayList<Song> getPlayingQueue() {
|
||||
if (musicService != null) {
|
||||
return musicService.getPlayingQueue();
|
||||
|
|
|
|||
|
|
@ -262,8 +262,8 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
|
|||
}
|
||||
|
||||
private void updateNavigationDrawerHeader() {
|
||||
Song song = MusicPlayerRemote.getCurrentSong();
|
||||
if (song.id != -1) {
|
||||
if (!MusicPlayerRemote.getPlayingQueue().isEmpty()) {
|
||||
Song song = MusicPlayerRemote.getCurrentSong();
|
||||
if (navigationDrawerHeader == null) {
|
||||
navigationDrawerHeader = navigationView.inflateHeaderView(R.layout.navigation_drawer_header);
|
||||
//noinspection ConstantConditions
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.kabouzeid.gramophone.ui.activities.base;
|
|||
|
||||
import android.animation.Animator;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.ColorStateList;
|
||||
|
|
@ -11,6 +12,7 @@ import android.graphics.PorterDuff;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.LayoutRes;
|
||||
|
|
@ -185,11 +187,6 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
onPanelSlide(slidingUpPanelLayout, 1);
|
||||
onPanelExpanded(slidingUpPanelLayout);
|
||||
}
|
||||
// ensures that the fab and the mini player are hidden if the queue is empty
|
||||
if (MusicPlayerRemote.getCurrentSong().id == -1) {
|
||||
playPauseFab.setVisibility(View.GONE);
|
||||
hideBottomBar(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -220,6 +217,12 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
updateCurrentSong();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
hideBottomBarIfQueueIsEmpty();
|
||||
super.onServiceConnected(name, service);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRepeatModeChanged() {
|
||||
super.onRepeatModeChanged();
|
||||
|
|
@ -433,9 +436,19 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
|
||||
public void hideBottomBar(boolean hide) {
|
||||
if (hide) {
|
||||
slidingUpPanelLayout.setPanelHeight(0);
|
||||
slidingUpPanelLayout.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
slidingUpPanelLayout.setPanelHeight(0);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
slidingUpPanelLayout.setPanelHeight(getResources().getDimensionPixelSize(R.dimen.mini_player_height));
|
||||
slidingUpPanelLayout.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
slidingUpPanelLayout.setPanelHeight(getResources().getDimensionPixelSize(R.dimen.mini_player_height));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -710,15 +723,15 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
}
|
||||
|
||||
private void updateCurrentSong() {
|
||||
hideBottomBarIfQueueIsEmpty();
|
||||
getCurrentSong();
|
||||
updateMiniPlayerAndHeaderText();
|
||||
setUpAlbumArtAndApplyPalette();
|
||||
updatePlayerMenu();
|
||||
}
|
||||
|
||||
private void getCurrentSong() {
|
||||
song = MusicPlayerRemote.getCurrentSong();
|
||||
if (song.id == -1) {
|
||||
private void hideBottomBarIfQueueIsEmpty() {
|
||||
if (MusicPlayerRemote.getPlayingQueue().isEmpty()) {
|
||||
playPauseFab.setVisibility(View.GONE);
|
||||
hideBottomBar(true);
|
||||
} else {
|
||||
|
|
@ -727,6 +740,10 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
|||
}
|
||||
}
|
||||
|
||||
private void getCurrentSong() {
|
||||
song = MusicPlayerRemote.getCurrentSong();
|
||||
}
|
||||
|
||||
private void updateMiniPlayerAndHeaderText() {
|
||||
songTitle.setText(song.title);
|
||||
songText.setText(song.artistName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue