Probably finally fixed the double notification bug.
This commit is contained in:
parent
cbe8751ce0
commit
ee1e0d4267
3 changed files with 11 additions and 7 deletions
|
|
@ -45,7 +45,7 @@ public class PlayingNotificationHelper {
|
||||||
|
|
||||||
private final NotificationManager notificationManager;
|
private final NotificationManager notificationManager;
|
||||||
private Notification notification;
|
private Notification notification;
|
||||||
private int notificationId = hashCode();
|
private int notificationId = 1;
|
||||||
|
|
||||||
private RemoteViews notificationLayout;
|
private RemoteViews notificationLayout;
|
||||||
private RemoteViews notificationLayoutBig;
|
private RemoteViews notificationLayoutBig;
|
||||||
|
|
@ -262,7 +262,9 @@ public class PlayingNotificationHelper {
|
||||||
if (notificationLayoutBig != null) {
|
if (notificationLayoutBig != null) {
|
||||||
notificationLayoutBig.setImageViewResource(R.id.action_play_pause, playPauseRes);
|
notificationLayoutBig.setImageViewResource(R.id.action_play_pause, playPauseRes);
|
||||||
}
|
}
|
||||||
notificationManager.notify(notificationId, notification);
|
if (notification != null) {
|
||||||
|
notificationManager.notify(notificationId, notification);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setNotificationTextDark(boolean setDark) {
|
private void setNotificationTextDark(boolean setDark) {
|
||||||
|
|
|
||||||
|
|
@ -879,7 +879,11 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
|
||||||
break;
|
break;
|
||||||
case QUEUE_CHANGED:
|
case QUEUE_CHANGED:
|
||||||
saveState();
|
saveState();
|
||||||
prepareNext();
|
if (playingQueue.size() > 0) {
|
||||||
|
prepareNext();
|
||||||
|
} else {
|
||||||
|
playingNotificationHelper.killNotification();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,14 +153,12 @@ public abstract class AbsSlidingMusicPanelActivity extends AbsMusicServiceActivi
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (hide) {
|
if (hide) {
|
||||||
|
playerFragment.onBackPressed();
|
||||||
slidingUpPanelLayout.setPanelHeight(0);
|
slidingUpPanelLayout.setPanelHeight(0);
|
||||||
if (slidingUpPanelLayout.getPanelState() != SlidingUpPanelLayout.PanelState.COLLAPSED) {
|
slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
||||||
slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
slidingUpPanelLayout.setPanelHeight(getResources().getDimensionPixelSize(R.dimen.mini_player_height));
|
slidingUpPanelLayout.setPanelHeight(getResources().getDimensionPixelSize(R.dimen.mini_player_height));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue