// 실제 데이타 셋팅 @Override public void bindView(View view, Context context, Cursor cursor) { ViewHolder holder = (ViewHolder) view.getTag(); // 이미지 셋팅 mAsyncBitmapLoader.loadBitmap(cursor.getPosition(), holder.imageView); }
@Override public View getView(int position, View convertView, ViewGroup parent) { final ViewHolder viewHolder; if (convertView == null) { convertView = LayoutInflater.from(mContext).inflate(R.layout.item_current_playlist, parent, false); viewHolder = new ViewHolder(); viewHolder.mCurrentPlaylistIsPlayingImageView = (ImageView) convertView.findViewById(R.id.item_songs_isPlay_iv); viewHolder.mCurrentPlaylistAlbumArtImageView = (ImageView) convertView.findViewById(R.id.item_artist_child_album_iv); viewHolder.mCurrentPlaylistArtistTextView = (TextView) convertView.findViewById(R.id.item_artist_child_artist_tv); viewHolder.mCurrentPlaylistTitleTextView = (TextView) convertView.findViewById(R.id.item_artist_child_title_tv); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } MusicInfo musicInfo = (MusicInfo) getItem(position); if (mCurrentEvent != null) { if (mCurrentEvent.getMusicInfo() != null) { if (musicInfo.get_id() == mCurrentEvent.getMusicInfo().get_id()) { viewHolder.mCurrentPlaylistIsPlayingImageView.setVisibility(View.VISIBLE); if (mPlayback.isPlaying()) { viewHolder.mCurrentPlaylistIsPlayingImageView.setSelected(true); } else { viewHolder.mCurrentPlaylistIsPlayingImageView.setSelected(false); } } else { viewHolder.mCurrentPlaylistIsPlayingImageView.setVisibility(View.GONE); } } } mAsyncBitmapLoader.loadBitmap(position, viewHolder.mCurrentPlaylistAlbumArtImageView); viewHolder.mCurrentPlaylistArtistTextView.setText(musicInfo.getArtist()); viewHolder.mCurrentPlaylistTitleTextView.setText(musicInfo.getTitle()); return convertView; }