use of com.bilibili.magicasakura.widgets.TintImageView in project remusic by aa112901.
the class QuickControlsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.bottom_nav, container, false);
this.rootView = rootView;
mPlayPause = (TintImageView) rootView.findViewById(R.id.control);
mProgress = (TintProgressBar) rootView.findViewById(R.id.song_progress_normal);
mTitle = (TextView) rootView.findViewById(R.id.playbar_info);
mArtist = (TextView) rootView.findViewById(R.id.playbar_singer);
mAlbumArt = (SimpleDraweeView) rootView.findViewById(R.id.playbar_img);
next = (ImageView) rootView.findViewById(R.id.play_next);
playQueue = (ImageView) rootView.findViewById(R.id.play_list);
mProgress.setProgressTintList(ThemeUtils.getThemeColorStateList(mContext, R.color.theme_color_primary));
mProgress.postDelayed(mUpdateProgress, 0);
mPlayPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mPlayPause.setImageResource(MusicPlayer.isPlaying() ? R.drawable.playbar_btn_pause : R.drawable.playbar_btn_play);
mPlayPause.setImageTintList(R.color.theme_color_primary);
if (MusicPlayer.getQueueSize() == 0) {
Toast.makeText(MainApplication.context, getResources().getString(R.string.queue_is_empty), Toast.LENGTH_SHORT).show();
} else {
HandlerUtil.getInstance(MainApplication.context).postDelayed(new Runnable() {
@Override
public void run() {
MusicPlayer.playOrPause();
}
}, 60);
}
}
});
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
MusicPlayer.next();
}
}, 60);
}
});
playQueue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
PlayQueueFragment playQueueFragment = new PlayQueueFragment();
playQueueFragment.show(getFragmentManager(), "playqueueframent");
}
}, 60);
}
});
rootView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(MainApplication.context, PlayingActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
MainApplication.context.startActivity(intent);
}
});
return rootView;
}
Aggregations