EMMA Coverage Report (generated Wed Mar 15 00:45:44 CET 2017)
[all classes][kdk.android.simplydo]

COVERAGE SUMMARY FOR SOURCE FILE [ListPropertiesAdapter.java]

nameclass, %method, %block, %line, %
ListPropertiesAdapter.java100% (1/1)100% (5/5)93%  (78/84)90%  (18/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ListPropertiesAdapter100% (1/1)100% (5/5)93%  (78/84)90%  (18/20)
getView (int, View, ViewGroup): View 100% (1/1)90%  (55/61)85%  (11/13)
ListPropertiesAdapter (SimplyDoActivity, DataViewer): void 100% (1/1)100% (9/9)100% (4/4)
getCount (): int 100% (1/1)100% (5/5)100% (1/1)
getItem (int): Object 100% (1/1)100% (6/6)100% (1/1)
getItemId (int): long 100% (1/1)100% (3/3)100% (1/1)

1/*
2 * Copyright (C) 2010 Keith Kildare
3 * 
4 * This file is part of SimplyDo.
5 * 
6 * SimplyDo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 * 
11 * SimplyDo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 * 
16 * You should have received a copy of the GNU General Public License
17 * along with SimplyDo.  If not, see <http://www.gnu.org/licenses/>.
18 * 
19 */
20package kdk.android.simplydo;
21 
22import android.util.Log;
23import android.view.View;
24import android.view.ViewGroup;
25import android.widget.BaseAdapter;
26import android.widget.TextView;
27 
28public class ListPropertiesAdapter extends BaseAdapter
29{
30    private SimplyDoActivity context;
31    private DataViewer dataViewer;
32    
33    public ListPropertiesAdapter(SimplyDoActivity context, DataViewer dataViewer)
34    {
35        this.context = context;
36        this.dataViewer = dataViewer;
37    }
38    
39    
40    @Override
41    public int getCount()
42    {
43        return dataViewer.getListData().size();
44    }
45 
46    @Override
47    public Object getItem(int position)
48    {
49        return dataViewer.getListData().get(position);
50    }
51 
52    @Override
53    public long getItemId(int position)
54    {
55        return position;
56    }
57 
58    
59 
60    @Override
61    public View getView(final int position, View convertView, ViewGroup parent)
62    {
63        View rv = null;
64        
65        try
66        {
67            if(convertView == null)
68            {
69                rv = View.inflate(context, R.layout.list_entry, null);
70            }
71            else
72            {
73                rv = convertView;
74            }
75 
76            TextView t1 = (TextView)rv.findViewById(R.id.text1);
77            ListDesc listDesc = dataViewer.getListData().get(position);
78            t1.setText(listDesc.getLabel());
79            
80            TextView t2 = (TextView)rv.findViewById(R.id.text2);
81            t2.setText("("+ listDesc.getActiveItems() + "/" + listDesc.getTotalItems() + ")");
82        }
83        catch(Exception e)
84        {
85            Log.e(L.TAG, "Error in getView()", e);
86        }
87 
88        return rv;
89    }
90    
91}

[all classes][kdk.android.simplydo]
EMMA 2.0.5312 (C) Vladimir Roubtsov