@Override public void onMusicPlaying(int progress, long max) { if (mSongAdapter != null && mSongAdapter.getPlayingId() == 0) { SongInfo song = SongManager.with(getActivity()).getCurrentSong(); if (song != null) { mSongAdapter.setPlaying(song.getId()); } } }
@Override public void onMusicPlay(int songId) { if (mSongAdapter == null) return; mSongAdapter.setPlaying(songId); if (getActivity() != null) { ((MainActivity) getActivity()).onMusicPlay(songId); } }
@Override public void onServiceDisconnected(ComponentName name) { if (mSongAdapter == null) return; mSongAdapter.setPlaying(-1); }
@Override public void onMusicStop() { if (mSongAdapter == null) return; mSongAdapter.setPlaying(-1); }