use of com.wm.remusic.fragment.PlayQueueFragment in project remusic by aa112901.
the class PlayingActivity method setTools.
private void setTools() {
mPlayingmode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MusicPlayer.cycleRepeat();
updatePlaymode();
}
});
mPre.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// MusicPlayer.previous(PlayingActivity.this.getApplication(), true);
Message msg = new Message();
msg.what = PRE_MUSIC;
mPlayHandler.sendMessage(msg);
}
});
mControl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (MusicPlayer.isPlaying()) {
mControl.setImageResource(R.drawable.play_rdi_btn_pause);
} else {
mControl.setImageResource(R.drawable.play_rdi_btn_play);
}
if (MusicPlayer.getQueueSize() != 0) {
MusicPlayer.playOrPause();
}
}
});
mNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mRotateAnim != null) {
mRotateAnim.end();
mRotateAnim = null;
}
// mHandler.removeCallbacks(mNextRunnable);
// mHandler.postDelayed(mNextRunnable,300);
Message msg = new Message();
msg.what = NEXT_MUSIC;
mPlayHandler.sendMessage(msg);
// MusicPlayer.mNext();
}
});
mPlaylist.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
PlayQueueFragment playQueueFragment = new PlayQueueFragment();
playQueueFragment.show(getSupportFragmentManager(), "playlistframent");
}
});
mMore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SimpleMoreFragment moreFragment = SimpleMoreFragment.newInstance(MusicPlayer.getCurrentAudioId());
moreFragment.show(getSupportFragmentManager(), "music");
}
});
mFav.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (isFav) {
mPlaylistsManager.removeItem(PlayingActivity.this, IConstants.FAV_PLAYLIST, MusicPlayer.getCurrentAudioId());
mFav.setImageResource(R.drawable.play_rdi_icn_love);
isFav = false;
} else {
try {
MusicInfo info = MusicPlayer.getPlayinfos().get(MusicPlayer.getCurrentAudioId());
mPlaylistsManager.insertMusic(PlayingActivity.this, IConstants.FAV_PLAYLIST, info);
} catch (Exception e) {
e.printStackTrace();
}
mFav.setImageResource(R.drawable.play_icn_loved);
isFav = true;
}
Intent intent = new Intent(IConstants.PLAYLIST_COUNT_CHANGED);
sendBroadcast(intent);
}
});
}
Aggregations