예제 #1
0
  // 실제 데이타 셋팅
  @Override
  public void bindView(View view, Context context, Cursor cursor) {
    ViewHolder holder = (ViewHolder) view.getTag();

    // 이미지 셋팅
    mAsyncBitmapLoader.loadBitmap(cursor.getPosition(), holder.imageView);
  }
    public CurrentPlaylistAdapter(Context context, ArrayList<MusicInfo> list) {
      mContext = context;
      mList = list;

      mAsyncBitmapLoader = new AsyncBitmapLoader(context);
      mAsyncBitmapLoader.setBitmapLoadListener(this);
    }
예제 #3
0
  public LoadPictureAdapter(Context context, Cursor c, boolean autoRequery) {
    super(context, c, autoRequery);

    mLayoutInflater = LayoutInflater.from(context);

    // 다이나믹 비트맵 로더 생성 및 이벤트 연결
    mAsyncBitmapLoader = new AsyncBitmapLoader(context);
    mAsyncBitmapLoader.setBitmapLoadListener(this);
  }
    @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;
    }