private Drawable getDrawableByState(Context context, int state) {
switch (state) {
case PlaybackStateCompat.STATE_NONE:
Drawable pauseDrawable = ContextCompat.getDrawable(context, R.drawable.ic_play);
DrawableCompat.setTintList(pauseDrawable, colorPlay);
return pauseDrawable;
case PlaybackStateCompat.STATE_PLAYING:
AnimationDrawable animation = (AnimationDrawable) ContextCompat.getDrawable(context, R.drawable.equalizer);
DrawableCompat.setTintList(animation, colorPlay);
animation.start();
return animation;
case PlaybackStateCompat.STATE_PAUSED:
Drawable playDrawable = ContextCompat.getDrawable(context, R.drawable.equalizer);
DrawableCompat.setTintList(playDrawable, colorPause);
return playDrawable;
default:
Drawable noneDrawable = ContextCompat.getDrawable(context, R.drawable.ic_play);
DrawableCompat.setTintList(noneDrawable, colorPlay);
return noneDrawable;
}
}
AdapterMusic.java 文件源码
java
阅读 41
收藏 0
点赞 0
评论 0
项目:DMAudioStreamer
作者:
评论列表
文章目录