Search in sources :

Example 1 with MoreFragment

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);
            }
        });
    }
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) Intent(android.content.Intent) MoreFragment(com.wm.remusic.fragment.MoreFragment) MusicInfo(com.wm.remusic.info.MusicInfo) ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Aggregations

Intent (android.content.Intent)1 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 MoreFragment (com.wm.remusic.fragment.MoreFragment)1 MusicInfo (com.wm.remusic.info.MusicInfo)1