use of com.wm.remusic.fragment.MoreFragment in project remusic by aa112901.
the class PlaylistDetailAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder itemHolder, final int i) {
if (itemHolder instanceof ItemViewHolder) {
MusicInfo localItem = arraylist.get(i - 1);
((ItemViewHolder) itemHolder).trackNumber.setText(i + "");
((ItemViewHolder) itemHolder).title.setText(localItem.musicName);
((ItemViewHolder) itemHolder).artist.setText(localItem.artist);
((ItemViewHolder) itemHolder).menu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
MoreFragment morefragment = MoreFragment.newInstance(arraylist.get(i - 1).songId + "", IConstants.MUSICOVERFLOW);
morefragment.show(((AppCompatActivity) mContext).getSupportFragmentManager(), "music");
}
});
} else if (itemHolder instanceof CommonItemViewHolder) {
((CommonItemViewHolder) itemHolder).textView.setText("(共" + arraylist.size() + "首)");
((CommonItemViewHolder) itemHolder).select.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mContext, PlaylistSelectActivity.class);
intent.putParcelableArrayListExtra("ids", arraylist);
intent.putExtra("playlistid", playlistId);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
mContext.startActivity(intent);
}
});
}
}
Aggregations