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

    if (getActivity() != null) {
      ((MainActivity) getActivity()).onMusicPlay(songId);
    }
  }
Esempio n. 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();
   }
 }
Esempio n. 5
0
 @Override
 public void onServiceDisconnected(ComponentName name) {
   if (mSongAdapter == null) return;
   mSongAdapter.setPlaying(-1);
 }
Esempio n. 6
0
 @Override
 public void onMusicStop() {
   if (mSongAdapter == null) return;
   mSongAdapter.setPlaying(-1);
 }