Clover Coverage Report - SaveApp Coverage Report
Coverage timestamp: mar dic 23 2014 15:53:11 EST
../../../../img/srcFileCovDistChart9.png 12% of files have more coverage
33   76   7   33
12   54   0,21   1
1     7  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  OutlayListItem       Line # 10 33 7 87% 0.8695652
 
No Tests
 
1    package com.loopback.androidapps.saveapp;
2   
3    import android.content.Context;
4    import android.util.Log;
5    import android.view.LayoutInflater;
6    import android.view.ViewGroup;
7    import android.widget.LinearLayout;
8    import android.widget.TextView;
9   
 
10    public class OutlayListItem extends LinearLayout {
11   
12    private LinearLayout rootContainer; // root container that is used to stack
13    private TextView txtId, txtDate, txtTime, txtItem, txtPlace, txtCharge;
14    private String date, charge, item, place, currencySymbol;
15   
16    public static SaveApp saveApp;
17   
 
18  42 toggle public OutlayListItem(Context _context, Outlay outlay, int position, boolean landscape) {
19    // Set Context
20  42 super(_context);
21  42 Log.i("OLI", "Init...");
22    // Assign Values
23  42 date = outlay.getDate();
24  42 item = String.valueOf(outlay.getItemDesc());
25  42 place = String.valueOf(outlay.getPlaceDesc());
26  42 charge = String.valueOf(outlay.getCharge());
27  42 currencySymbol = saveApp.getCurrencySymbol();
28   
29    // Inflate: Build the view from the XML.
30  42 LayoutInflater inflater = (LayoutInflater) _context
31    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
32  42 if (landscape)
33  0 rootContainer = (LinearLayout) inflater.inflate(
34    R.layout.outlaylistitemland,
35    (ViewGroup) findViewById(R.id.root_container));
36    else
37  42 rootContainer = (LinearLayout) inflater.inflate(
38    R.layout.outlaylistitem,
39    (ViewGroup) findViewById(R.id.root_container));
40   
41    // Get Views
42  42 txtId = (TextView) rootContainer.findViewById(R.id.ide);
43  42 txtDate = (TextView) rootContainer.findViewById(R.id.date);
44  42 txtTime = (TextView) rootContainer.findViewById(R.id.time);
45  42 txtItem = (TextView) rootContainer.findViewById(R.id.item);
46  42 txtPlace = (TextView) rootContainer.findViewById(R.id.place);
47  42 txtCharge = (TextView) rootContainer.findViewById(R.id.charge);
48   
49    // Set Text
50  42 txtId.setTextColor(getResources().getColor(R.color.black));
51  42 txtDate.setTextColor(getResources().getColor(R.color.black));
52  42 txtTime.setTextColor(getResources().getColor(R.color.black));
53  42 txtItem.setTextColor(getResources().getColor(R.color.black));
54  42 txtPlace.setTextColor(getResources().getColor(R.color.black));
55  42 txtCharge.setTextColor(getResources().getColor(R.color.black));
56  42 if (Integer.valueOf(charge) > 0)
57  30 txtCharge.setTextColor(getResources().getColor(R.color.green));
58    //TODO Change color depending on the Charge.
59    //else if ((Integer.valueOf(charge) < 0)
60    // && (-1 * (Integer.valueOf(charge)) < (HomeActivity.ACCOUNT_BUDGET / 5)))
61    //txtCharge.setTextColor(getResources().getColor(R.color.red));
62   
63  42 txtId.setText(String.valueOf(position));
64  42 txtDate.setText((date == null) ? "No data" : Utilities.printDate(date).substring(0, 10));
65  42 txtTime.setText((date == null) ? "No data" : date.substring(11, 16));
66  42 txtItem.setText((item == null) ? "No data" : item);
67  42 txtPlace.setText((place == null) ? "No data" : place);
68  42 txtCharge.setText(charge + currencySymbol);
69   
70    // Add View
71  42 this.addView(rootContainer);
72  42 Log.i("OLI", "Initiated");
73   
74    }
75   
76    }