コード例 #1
0
 @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());
     }
   }
 }
コード例 #2
0
 @Override
 public void onThemeChange(int color) {
   mStartScanView.setBackgroundColor(color);
   if (mSongAdapter != null) {
     mSongAdapter.notifyDataSetChanged();
   }
 }
コード例 #3
0
  @Override
  public void onMusicPlay(int songId) {
    if (mSongAdapter == null) return;
    mSongAdapter.setPlaying(songId);

    if (getActivity() != null) {
      ((MainActivity) getActivity()).onMusicPlay(songId);
    }
  }
コード例 #4
0
 private void updateList() {
   View footerView = getFooterView();
   if (mListView.getFooterViewsCount() == 0) {
     mListView.addFooterView(footerView);
   }
   if (mSongAdapter == null) {
     mSongAdapter = new SongAdapter();
     mListView.setEmptyView(getEmptyView());
     mListView.setAdapter(mSongAdapter);
   } else {
     mSongAdapter.notifyDataSetChanged();
   }
 }
コード例 #5
0
 @Override
 public void onServiceDisconnected(ComponentName name) {
   if (mSongAdapter == null) return;
   mSongAdapter.setPlaying(-1);
 }
コード例 #6
0
 @Override
 public void onMusicStop() {
   if (mSongAdapter == null) return;
   mSongAdapter.setPlaying(-1);
 }