1 |
|
|
2 |
|
package pl.magot.vetch.ancal.reminder; |
3 |
|
|
4 |
|
|
5 |
|
import pl.magot.vetch.ancal.R; |
6 |
|
import android.content.Context; |
7 |
|
import android.widget.*; |
8 |
|
|
9 |
|
|
|
|
| 90,9% |
Uncovered Elements: 2 (22) |
Complexity: 9 |
Complexity Density: 0,69 |
|
10 |
|
public class AlarmDialogDataItem |
11 |
|
{ |
12 |
|
|
13 |
|
|
14 |
|
|
|
|
| 91,3% |
Uncovered Elements: 2 (23) |
Complexity: 5 |
Complexity Density: 0,31 |
|
15 |
|
public class ViewItem extends LinearLayout |
16 |
|
{ |
17 |
|
|
18 |
|
private AlarmDialogDataItem item; |
19 |
|
private TextView mText; |
20 |
|
private ImageView mImage; |
21 |
|
|
22 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 1 |
Complexity Density: 0,08 |
|
23 |
3
|
public ViewItem(Context context, AlarmDialogDataItem item, String sText)... |
24 |
|
{ |
25 |
3
|
super(context); |
26 |
3
|
this.setOrientation(HORIZONTAL); |
27 |
3
|
this.item = item; |
28 |
|
|
29 |
3
|
mText = new TextView(context); |
30 |
3
|
mText.setTextSize(20); |
31 |
3
|
mText.setTextColor(0xFFBBBBBB); |
32 |
3
|
mText.setText(sText); |
33 |
|
|
34 |
3
|
mImage = new ImageView(context); |
35 |
3
|
mImage.setImageResource(R.drawable.arrowright); |
36 |
3
|
mImage.setPadding(2, 2, 2, 0); |
37 |
|
|
38 |
3
|
addView(mImage, new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT)); |
39 |
3
|
addView(mText, new LinearLayout.LayoutParams(android.view.ViewGroup.LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT)); |
40 |
|
|
41 |
3
|
setAlarmItemSelected(false); |
42 |
|
} |
43 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 3 |
Complexity Density: 1,5 |
|
44 |
9
|
private void setAlarmItemSelected(boolean bSelected)... |
45 |
|
{ |
46 |
9
|
mImage.setVisibility((bSelected)?VISIBLE:INVISIBLE); |
47 |
9
|
mText.setTextColor((bSelected)?0xFFFFFFFF:0xFFBBBBBB); |
48 |
|
} |
49 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
50 |
0
|
public AlarmDialogDataItem getDataItem()... |
51 |
|
{ |
52 |
0
|
return item; |
53 |
|
} |
54 |
|
} |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
private boolean bSelected = false; |
59 |
|
private int iOrderFilter = -1; |
60 |
|
private long ID = -1; |
61 |
|
private String sText = null; |
62 |
|
private ViewItem listViewItem = null; |
63 |
|
private int iAction = 0; |
64 |
|
|
65 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0,25 |
|
66 |
3
|
AlarmDialogDataItem(Context context, int iOrderFilter, long ID, String sText)... |
67 |
|
{ |
68 |
3
|
this.iOrderFilter = iOrderFilter; |
69 |
3
|
this.ID = ID; |
70 |
3
|
this.sText = sText; |
71 |
3
|
this.listViewItem = new ViewItem(context, this, this.sText); |
72 |
|
} |
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
74 |
6
|
public boolean isSelected()... |
75 |
|
{ |
76 |
6
|
return bSelected; |
77 |
|
} |
78 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
79 |
10
|
public int getOrderFilter()... |
80 |
|
{ |
81 |
10
|
return iOrderFilter; |
82 |
|
} |
83 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
84 |
3
|
public long getID()... |
85 |
|
{ |
86 |
3
|
return ID; |
87 |
|
} |
88 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
89 |
0
|
public String getText()... |
90 |
|
{ |
91 |
0
|
return sText; |
92 |
|
} |
93 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
94 |
6
|
public void setSelected(boolean bSelected)... |
95 |
|
{ |
96 |
6
|
this.bSelected = bSelected; |
97 |
6
|
this.listViewItem.setAlarmItemSelected(bSelected); |
98 |
|
} |
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
3
|
public ViewItem getView()... |
101 |
|
{ |
102 |
3
|
return listViewItem; |
103 |
|
} |
104 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
105 |
2
|
public void setAction(int iAction)... |
106 |
|
{ |
107 |
2
|
this.iAction = iAction; |
108 |
|
} |
109 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
110 |
2
|
public int getAction()... |
111 |
|
{ |
112 |
2
|
return iAction; |
113 |
|
} |
114 |
|
|
115 |
|
} |