Commit 3fb7cf3c authored by linfeng's avatar linfeng

音乐功能

parent ce264934
package com.xxrv.video.adapter;
import android.widget.ImageView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.xxrv.video.R;
import com.xxrv.video.bean.circle.MusicInfo;
/**
* 音乐选择
*/
public class SelectMusicAdapter extends BaseQuickAdapter<MusicInfo, BaseViewHolder> {
public SelectMusicAdapter() {
super(R.layout.item_trill_music);
}
@Override
protected void convert(BaseViewHolder helper, MusicInfo item) {
helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_nike_name, item.getNikeName());
GlideManager.getInstance(mContext).loadImage(item.getCover(), (ImageView) helper.getView(R.id.iv_cover));
if (item.state == 0) {
helper.setGone(R.id.ll_next, false);
helper.setBackgroundRes(R.id.iv_play_state, R.drawable.ic_music_state0);
} else if (item.state == 1) {
helper.setGone(R.id.ll_next, true);
helper.setBackgroundRes(R.id.iv_play_state, R.drawable.ic_music_state2);
} else if (item.state == 2) {
helper.setGone(R.id.ll_next, false);
helper.setBackgroundRes(R.id.iv_play_state, R.drawable.ic_music_state1);
} else if (item.state == 3) {
helper.setGone(R.id.ll_next, true);
helper.setBackgroundRes(R.id.iv_play_state, R.drawable.ic_music_state0);
}
helper.addOnClickListener(R.id.rl_content);
helper.addOnClickListener(R.id.ll_next);
}
}
package com.xxrv.video.bean.circle;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.util.List;
public class MusicInfoBean extends BaseBean {
private List<MusicInfo> data;
private boolean rel;
public List<MusicInfo> getData() {
return data;
}
public void setData(List<MusicInfo> data) {
this.data = data;
}
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment