Clover Coverage Report - Subsonic-Android Coverage Report
Coverage timestamp: ven dic 19 2014 17:57:13 EST
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
16   71   5   8
4   37   0,31   2
2     2,5  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  EntryAdapter       Line # 32 16 5 100% 1.0
 
No Tests
 
1    /*
2    This file is part of Subsonic.
3   
4    Subsonic is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8   
9    Subsonic is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12    GNU General Public License for more details.
13   
14    You should have received a copy of the GNU General Public License
15    along with Subsonic. If not, see <http://www.gnu.org/licenses/>.
16   
17    Copyright 2010 (C) Sindre Mehus
18    */
19    package net.sourceforge.subsonic.androidapp.util;
20   
21    import java.util.List;
22   
23    import android.view.View;
24    import android.view.ViewGroup;
25    import android.widget.ArrayAdapter;
26    import net.sourceforge.subsonic.androidapp.activity.SubsonicTabActivity;
27    import net.sourceforge.subsonic.androidapp.domain.MusicDirectory;
28   
29    /**
30    * @author Sindre Mehus
31    */
 
32    public class EntryAdapter extends ArrayAdapter<MusicDirectory.Entry> {
33   
34    private final SubsonicTabActivity activity;
35    private final ImageLoader imageLoader;
36    private final boolean checkable;
37   
 
38  12 toggle public EntryAdapter(SubsonicTabActivity activity, ImageLoader imageLoader, List<MusicDirectory.Entry> entries, boolean checkable) {
39  12 super(activity, android.R.layout.simple_list_item_1, entries);
40  12 this.activity = activity;
41  12 this.imageLoader = imageLoader;
42  12 this.checkable = checkable;
43    }
44   
 
45  157 toggle @Override
46    public View getView(int position, View convertView, ViewGroup parent) {
47  157 MusicDirectory.Entry entry = getItem(position);
48   
49  157 if (entry.isDirectory()) {
50  30 AlbumView view;
51    // TODO: Reuse AlbumView objects once cover art loading is working.
52    // if (convertView != null && convertView instanceof AlbumView) {
53    // view = (AlbumView) convertView;
54    // } else {
55  30 view = new AlbumView(activity);
56    // }
57  30 view.setAlbum(entry, imageLoader);
58  30 return view;
59   
60    } else {
61  127 SongView view;
62  127 if (convertView != null && convertView instanceof SongView) {
63  82 view = (SongView) convertView;
64    } else {
65  45 view = new SongView(activity);
66    }
67  127 view.setSong(entry, checkable);
68  127 return view;
69    }
70    }
71    }