2
* Ubuntu One Music - stream music from Ubuntu One cloud storage.
4
* Copyright 2012 Canonical Ltd.
6
* This file is part of Ubuntu One Music app.
8
* This program is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Affero General Public License as
10
* published by the Free Software Foundation, either version 3 of the
11
* License, or (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Affero General Public License for more details.
18
* You should have received a copy of the GNU Affero General Public License
19
* along with this program. If not, see http://www.gnu.org/licenses
22
package com.ubuntuone.android.music.adapter.holder;
24
import android.view.View;
25
import android.widget.ImageView;
26
import android.widget.TextView;
28
import com.ubuntuone.android.music.R;
29
import com.ubuntuone.android.music.util.U1ImageDownloader;
31
public class NowPlayingViewHolder
33
public View nowPlaying;
34
public ImageView albumArt;
35
public TextView songTitle;
36
public TextView songArtist;
38
public NowPlayingViewHolder(View contentView) {
39
nowPlaying = contentView;
40
albumArt = (ImageView) contentView.findViewById(R.id.ab_album_art);
41
songTitle = (TextView) contentView.findViewById(R.id.ab_song);
42
songArtist = (TextView) contentView.findViewById(R.id.ab_artist);
45
public void bindView(String title, String artist, String albumId,
46
U1ImageDownloader imageDownloader) {
47
songTitle.setText(title);
48
songArtist.setText(artist);
49
if (albumId != null) {
50
imageDownloader.getArt(albumId, albumArt);
52
nowPlaying.setVisibility(title != null ? View.VISIBLE : View.INVISIBLE);