1 |
|
|
2 |
|
package pl.magot.vetch.ancal.reminder; |
3 |
|
|
4 |
|
|
5 |
|
import pl.magot.vetch.ancal.*; |
6 |
|
import android.view.View; |
7 |
|
import android.view.ViewGroup; |
8 |
|
import android.widget.AdapterView; |
9 |
|
import android.widget.ListAdapter; |
10 |
|
import java.util.*; |
11 |
|
import android.content.ComponentName; |
12 |
|
import android.content.Intent; |
13 |
|
import android.database.DataSetObserver; |
14 |
|
import android.os.*; |
15 |
|
import android.widget.*; |
16 |
|
|
17 |
|
|
|
|
| 79,1% |
Uncovered Elements: 48 (230) |
Complexity: 62 |
Complexity Density: 0,42 |
|
18 |
|
public class AlarmDialog extends CommonActivity |
19 |
|
{ |
20 |
|
|
21 |
|
|
|
|
| 75% |
Uncovered Elements: 6 (24) |
Complexity: 13 |
Complexity Density: 1,18 |
|
22 |
|
public class AlarmsAdapter implements ListAdapter |
23 |
|
{ |
24 |
|
|
25 |
|
private ArrayList<AlarmDialogDataItem> vecAlarmItems = null; |
26 |
|
|
27 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
28 |
5
|
AlarmsAdapter(ArrayList<AlarmDialogDataItem> vecAlarmItems)... |
29 |
|
{ |
30 |
5
|
this.vecAlarmItems = vecAlarmItems; |
31 |
|
} |
32 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
33 |
40
|
public int getCount()... |
34 |
|
{ |
35 |
40
|
return vecAlarmItems.size(); |
36 |
|
} |
37 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
38 |
0
|
public Object getItem(int position)... |
39 |
|
{ |
40 |
0
|
return vecAlarmItems.get(position); |
41 |
|
} |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
43 |
3
|
public long getItemId(int position)... |
44 |
|
{ |
45 |
3
|
return position; |
46 |
|
} |
47 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
48 |
3
|
public View getView(int position, View convertView, ViewGroup parent)... |
49 |
|
{ |
50 |
3
|
return vecAlarmItems.get(position).getView(); |
51 |
|
} |
52 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
53 |
5
|
public void registerDataSetObserver(DataSetObserver observer)... |
54 |
|
{ |
55 |
|
} |
56 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
57 |
5
|
public void unregisterDataSetObserver(DataSetObserver arg0)... |
58 |
|
{ |
59 |
|
} |
60 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
5
|
public boolean areAllItemsEnabled()... |
62 |
|
{ |
63 |
5
|
return true; |
64 |
|
} |
65 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
66 |
0
|
public boolean isEnabled(int position)... |
67 |
|
{ |
68 |
0
|
return true; |
69 |
|
} |
70 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
71 |
6
|
public int getItemViewType(int position)... |
72 |
|
{ |
73 |
6
|
return 0; |
74 |
|
} |
75 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
76 |
5
|
public int getViewTypeCount()... |
77 |
|
{ |
78 |
5
|
return 1; |
79 |
|
} |
80 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
81 |
5
|
public boolean hasStableIds()... |
82 |
|
{ |
83 |
5
|
return true; |
84 |
|
} |
85 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
0
|
public boolean isEmpty()... |
87 |
|
{ |
88 |
0
|
return (vecAlarmItems.size() == 0); |
89 |
|
} |
90 |
|
} |
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
ArrayList<AlarmDialogDataItem> vecAlarmItems = new ArrayList<AlarmDialogDataItem>(); |
95 |
|
|
96 |
|
|
97 |
|
private TextView labAlarmReminderHeader = null; |
98 |
|
private ListView listAlarmReminderContent = null; |
99 |
|
private ImageView imgAlarmReminderHeader = null; |
100 |
|
|
101 |
|
|
102 |
|
private Button btnAlarmReminderClear = null; |
103 |
|
private Button btnAlarmReminderSnooze = null; |
104 |
|
private Button btnAlarmReminderOpen = null; |
105 |
|
|
106 |
|
|
107 |
|
private Bundle data = null; |
108 |
|
private Handler handlerCloseDialog = new Handler(); |
109 |
|
private AlarmsManager alarmsManager = null; |
110 |
|
|
111 |
|
|
112 |
|
private String msgYouHaveASTS = ""; |
113 |
|
private String msgYouHaveTS = ""; |
114 |
|
private String msgYouHaveAS = ""; |
115 |
|
private String msgYouHaveNoASTS = ""; |
116 |
|
|
117 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 1 |
Complexity Density: 0,14 |
|
118 |
3
|
@Override... |
119 |
|
public void onCreate(Bundle icicle) |
120 |
|
{ |
121 |
3
|
super.onCreate(icicle); |
122 |
3
|
setContentView(R.layout.alarmdialog); |
123 |
|
|
124 |
|
|
125 |
3
|
alarmsManager = new AlarmsManager(this.userdb, this.prefs); |
126 |
|
|
127 |
|
|
128 |
3
|
msgYouHaveASTS = utils.GetResStr(R.string.msgYouHaveASTS); |
129 |
3
|
msgYouHaveTS = utils.GetResStr(R.string.msgYouHaveTS); |
130 |
3
|
msgYouHaveAS = utils.GetResStr(R.string.msgYouHaveAS); |
131 |
3
|
msgYouHaveNoASTS = utils.GetResStr(R.string.msgYouHaveNoASTS); |
132 |
|
} |
133 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0,2 |
|
134 |
3
|
@Override... |
135 |
|
public void onStart() |
136 |
|
{ |
137 |
3
|
super.onStart(); |
138 |
|
|
139 |
|
|
140 |
3
|
data = this.getIntent().getExtras(); |
141 |
3
|
GetIntentDataFromBundle(); |
142 |
|
|
143 |
|
|
144 |
3
|
InitViews(); |
145 |
3
|
InitState(); |
146 |
|
} |
147 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
148 |
3
|
@Override... |
149 |
|
public void onResume() |
150 |
|
{ |
151 |
3
|
super.onResume(); |
152 |
|
|
153 |
|
} |
154 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
155 |
3
|
@Override... |
156 |
|
public void onPause() |
157 |
|
{ |
158 |
3
|
super.onPause(); |
159 |
|
|
160 |
|
} |
161 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0,33 |
|
162 |
3
|
@Override... |
163 |
|
public void onStop() |
164 |
|
{ |
165 |
3
|
super.onStop(); |
166 |
|
|
167 |
|
|
168 |
3
|
alarmsManager.processAll(); |
169 |
|
|
170 |
|
|
171 |
3
|
AnCal.UpdateReminderService(this, this.prefs, CommonActivity.bundleTableUpdated); |
172 |
|
} |
173 |
|
|
|
|
| 85,7% |
Uncovered Elements: 2 (14) |
Complexity: 7 |
Complexity Density: 0,88 |
|
174 |
5
|
public String GetPopupMsg(int iCountAppts, int iCountTasks)... |
175 |
|
{ |
176 |
5
|
String msg = String.format(msgYouHaveASTS, iCountAppts, iCountTasks); |
177 |
5
|
if ((iCountAppts == 0) && (iCountTasks > 0)) |
178 |
0
|
msg = String.format(msgYouHaveTS, iCountTasks); |
179 |
5
|
if ((iCountTasks == 0) && (iCountAppts > 0)) |
180 |
3
|
msg = String.format(msgYouHaveAS, iCountAppts); |
181 |
5
|
if ((iCountAppts == 0) && (iCountTasks == 0)) |
182 |
2
|
msg = msgYouHaveNoASTS; |
183 |
5
|
return msg; |
184 |
|
} |
185 |
|
|
|
|
| 80% |
Uncovered Elements: 4 (20) |
Complexity: 5 |
Complexity Density: 0,42 |
|
186 |
5
|
private void UpdateHeaderInfo()... |
187 |
|
{ |
188 |
5
|
int iCountAppts = 0; |
189 |
5
|
int iCountTasks = 0; |
190 |
|
|
191 |
8
|
for (int i = 0; i < vecAlarmItems.size(); i++) |
192 |
|
{ |
193 |
3
|
AlarmDialogDataItem item = vecAlarmItems.get(i); |
194 |
3
|
if (item != null) |
195 |
|
{ |
196 |
3
|
if (item.getOrderFilter() == AlarmDataViewItem.iOrderAppts) |
197 |
3
|
iCountAppts++; |
198 |
3
|
if (item.getOrderFilter() == AlarmDataViewItem.iOrderTasks) |
199 |
0
|
iCountTasks++; |
200 |
|
} |
201 |
|
} |
202 |
|
|
203 |
5
|
String sTitle = GetPopupMsg(iCountAppts, iCountTasks); |
204 |
5
|
labAlarmReminderHeader.setText(sTitle); |
205 |
|
|
206 |
|
|
207 |
5
|
imgAlarmReminderHeader.setBackgroundResource(R.drawable.iconnotifyalarm); |
208 |
|
} |
209 |
|
|
|
|
| 83,3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0,5 |
|
210 |
3
|
private void GetIntentDataFromBundle()... |
211 |
|
{ |
212 |
3
|
if (data != null) |
213 |
|
{ |
214 |
3
|
vecAlarmItems.clear(); |
215 |
3
|
DecodeBundleData(vecAlarmItems, AlarmDataViewItem.iOrderAppts); |
216 |
3
|
DecodeBundleData(vecAlarmItems, AlarmDataViewItem.iOrderTasks); |
217 |
|
} |
218 |
|
} |
219 |
|
|
|
|
| 93,3% |
Uncovered Elements: 1 (15) |
Complexity: 3 |
Complexity Density: 0,27 |
|
220 |
6
|
private int DecodeBundleData(ArrayList<AlarmDialogDataItem> items, int iOrderFilter)... |
221 |
|
{ |
222 |
6
|
int iTotalCount = 0; |
223 |
6
|
String sTotalKey = "typetotal_" + Integer.toString(iOrderFilter); |
224 |
6
|
if (data.containsKey(sTotalKey)) |
225 |
|
{ |
226 |
6
|
iTotalCount = data.getInt(sTotalKey); |
227 |
9
|
for (int i = 0; i < iTotalCount; i++) |
228 |
|
{ |
229 |
3
|
String sKey = "_" + Integer.toString(iOrderFilter) + "_" + Integer.toString(i); |
230 |
|
|
231 |
3
|
long lID = data.getLong("rowid" + sKey); |
232 |
3
|
String sText = data.getString("text" + sKey); |
233 |
|
|
234 |
3
|
AlarmDialogDataItem item = new AlarmDialogDataItem(this, iOrderFilter, lID, sText); |
235 |
3
|
items.add(item); |
236 |
|
} |
237 |
|
} |
238 |
6
|
return iTotalCount; |
239 |
|
} |
240 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 1 |
Complexity Density: 0,11 |
|
241 |
3
|
private void InitViews()... |
242 |
|
{ |
243 |
|
|
244 |
3
|
labAlarmReminderHeader = (TextView)findViewById(R.id.labAlarmReminderHeader); |
245 |
3
|
listAlarmReminderContent = (ListView)findViewById(R.id.listAlarmReminderContent); |
246 |
3
|
imgAlarmReminderHeader = (ImageView)findViewById(R.id.imgAlarmReminderHeader); |
247 |
|
|
248 |
|
|
249 |
3
|
btnAlarmReminderClear = (Button)findViewById(R.id.btnAlarmReminderClear); |
250 |
3
|
btnAlarmReminderClear.setOnClickListener(mBtnOnClick_CLEAR); |
251 |
|
|
252 |
3
|
btnAlarmReminderSnooze = (Button)findViewById(R.id.btnAlarmReminderSnooze); |
253 |
3
|
btnAlarmReminderSnooze.setOnClickListener(mBtnOnClick_SNOOZE); |
254 |
|
|
255 |
3
|
btnAlarmReminderOpen = (Button)findViewById(R.id.btnAlarmReminderOpen); |
256 |
3
|
btnAlarmReminderOpen.setOnClickListener(mBtnOnClick_OPEN); |
257 |
|
} |
258 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (12) |
Complexity: 1 |
Complexity Density: 0,08 |
|
259 |
3
|
private void InitState()... |
260 |
|
{ |
261 |
|
|
262 |
3
|
String sSubTitle = utils.GetResStr(R.string.titleDefaultAlarmDialog); |
263 |
3
|
SetActivityTitle(sSubTitle); |
264 |
|
|
265 |
3
|
UpdateHeaderInfo(); |
266 |
|
|
267 |
|
|
268 |
3
|
SetListWithDataAdapter(); |
269 |
|
|
270 |
3
|
alarmsManager.clear(); |
271 |
|
|
272 |
3
|
btnAlarmReminderClear.setFocusable(true); |
273 |
3
|
btnAlarmReminderClear.setFocusableInTouchMode(true); |
274 |
|
|
275 |
3
|
listAlarmReminderContent.setOnItemClickListener(mListViewOnItemClick); |
276 |
3
|
listAlarmReminderContent.setOnItemSelectedListener(mListViewOnItemSelected); |
277 |
|
|
278 |
3
|
SelectFirstListItem(); |
279 |
|
|
280 |
3
|
UpdateBottomButtonsState(); |
281 |
|
|
282 |
3
|
btnAlarmReminderClear.requestFocus(); |
283 |
|
} |
284 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
285 |
5
|
private void SetListWithDataAdapter()... |
286 |
|
{ |
287 |
5
|
listAlarmReminderContent.setAdapter(new AlarmsAdapter(vecAlarmItems)); |
288 |
|
} |
289 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0,67 |
|
290 |
5
|
public void SelectFirstListItem()... |
291 |
|
{ |
292 |
5
|
ClearAllSelection(); |
293 |
5
|
if (vecAlarmItems.size() > 0) |
294 |
3
|
vecAlarmItems.get(0).setSelected(true); |
295 |
|
} |
296 |
|
|
297 |
|
|
298 |
|
@SuppressWarnings("all") |
299 |
|
private AdapterView.OnItemClickListener mListViewOnItemClick = new AdapterView.OnItemClickListener() |
300 |
|
{ |
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0,43 |
|
301 |
0
|
public void onItemClick(AdapterView parent, View v, int position, long id)... |
302 |
|
{ |
303 |
0
|
if (v != null) |
304 |
|
{ |
305 |
0
|
AlarmDialogDataItem.ViewItem item = (AlarmDialogDataItem.ViewItem)v; |
306 |
0
|
if (item != null) |
307 |
|
{ |
308 |
0
|
ClearAllSelection(); |
309 |
0
|
item.getDataItem().setSelected(true); |
310 |
0
|
btnAlarmReminderClear.requestFocus(); |
311 |
|
} |
312 |
|
} |
313 |
0
|
UpdateBottomButtonsState(); |
314 |
|
} |
315 |
|
}; |
316 |
|
|
317 |
|
|
318 |
|
@SuppressWarnings("all") |
319 |
|
private AdapterView.OnItemSelectedListener mListViewOnItemSelected = new AdapterView.OnItemSelectedListener() |
320 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
321 |
0
|
public void onItemSelected(AdapterView parent, View v, int position, long id)... |
322 |
|
{ |
323 |
0
|
UpdateBottomButtonsState(); |
324 |
|
} |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
325 |
0
|
public void onNothingSelected(AdapterView arg0)... |
326 |
|
{ |
327 |
0
|
UpdateBottomButtonsState(); |
328 |
|
} |
329 |
|
}; |
330 |
|
|
|
|
| 87,5% |
Uncovered Elements: 1 (8) |
Complexity: 3 |
Complexity Density: 0,75 |
|
331 |
5
|
public void ClearAllSelection()... |
332 |
|
{ |
333 |
8
|
for (int i = 0; i < vecAlarmItems.size(); i++) |
334 |
|
{ |
335 |
3
|
AlarmDialogDataItem item = vecAlarmItems.get(i); |
336 |
3
|
if (item != null) |
337 |
3
|
item.setSelected(false); |
338 |
|
} |
339 |
|
} |
340 |
|
|
|
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 4 |
Complexity Density: 0,67 |
|
341 |
5
|
public int GetAlarmItemSelectedCount()... |
342 |
|
{ |
343 |
5
|
int iCount = 0; |
344 |
8
|
for (int i = 0; i < vecAlarmItems.size(); i++) |
345 |
|
{ |
346 |
3
|
AlarmDialogDataItem item = vecAlarmItems.get(i); |
347 |
3
|
if ((item != null) && (item.isSelected())) |
348 |
3
|
iCount++; |
349 |
|
} |
350 |
5
|
return iCount; |
351 |
|
} |
352 |
|
|
|
|
| 66,7% |
Uncovered Elements: 3 (9) |
Complexity: 4 |
Complexity Density: 0,8 |
|
353 |
3
|
public AlarmDialogDataItem GetSelectedItem()... |
354 |
|
{ |
355 |
3
|
for (int i = 0; i < vecAlarmItems.size(); i++) |
356 |
|
{ |
357 |
3
|
AlarmDialogDataItem item = vecAlarmItems.get(i); |
358 |
3
|
if ((item != null) && (item.isSelected())) |
359 |
3
|
return item; |
360 |
|
} |
361 |
0
|
return null; |
362 |
|
} |
363 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0,2 |
|
364 |
5
|
public void UpdateBottomButtonsState()... |
365 |
|
{ |
366 |
5
|
int iSelectedCount = GetAlarmItemSelectedCount(); |
367 |
5
|
boolean bEnabled = (iSelectedCount == 1); |
368 |
5
|
btnAlarmReminderClear.setEnabled(bEnabled); |
369 |
5
|
btnAlarmReminderSnooze.setEnabled(bEnabled); |
370 |
5
|
btnAlarmReminderOpen.setEnabled(bEnabled); |
371 |
|
} |
372 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0,2 |
|
373 |
2
|
public void removeAlarmItem(AlarmDialogDataItem item)... |
374 |
|
{ |
375 |
2
|
vecAlarmItems.remove(item); |
376 |
2
|
SetListWithDataAdapter(); |
377 |
2
|
SelectFirstListItem(); |
378 |
2
|
UpdateHeaderInfo(); |
379 |
2
|
UpdateBottomButtonsState(); |
380 |
|
} |
381 |
|
|
|
|
| 66,7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0,5 |
|
382 |
3
|
public AlarmDialogDataItem getSelectedAlarmItemToProcess()... |
383 |
|
{ |
384 |
3
|
AlarmDialogDataItem item = GetSelectedItem(); |
385 |
3
|
if (item != null) |
386 |
|
{ |
387 |
3
|
return item; |
388 |
|
} |
389 |
0
|
return null; |
390 |
|
} |
391 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
392 |
2
|
public boolean NoAlarmItems()... |
393 |
|
{ |
394 |
2
|
return (vecAlarmItems.size() == 0); |
395 |
|
} |
396 |
|
|
397 |
|
private View.OnClickListener mBtnOnClick_CLEAR = new View.OnClickListener() |
398 |
|
{ |
|
|
| 85,7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0,4 |
|
399 |
1
|
public void onClick(View arg0)... |
400 |
|
{ |
401 |
1
|
AlarmDialogDataItem item = getSelectedAlarmItemToProcess(); |
402 |
1
|
if (item != null) |
403 |
|
{ |
404 |
1
|
alarmsManager.putAlarmToProcess(item, AlarmsManager.iAction_CLEAR); |
405 |
1
|
removeAlarmItem(item); |
406 |
|
} |
407 |
1
|
CloseDialogIfEmpty(); |
408 |
|
} |
409 |
|
}; |
410 |
|
|
411 |
|
private View.OnClickListener mBtnOnClick_SNOOZE = new View.OnClickListener() |
412 |
|
{ |
|
|
| 85,7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0,4 |
|
413 |
1
|
public void onClick(View arg0)... |
414 |
|
{ |
415 |
1
|
AlarmDialogDataItem item = getSelectedAlarmItemToProcess(); |
416 |
1
|
if (item != null) |
417 |
|
{ |
418 |
1
|
alarmsManager.putAlarmToProcess(item, AlarmsManager.iAction_SNOOZE); |
419 |
1
|
removeAlarmItem(item); |
420 |
|
} |
421 |
1
|
CloseDialogIfEmpty(); |
422 |
|
} |
423 |
|
}; |
424 |
|
|
|
|
| 80% |
Uncovered Elements: 1 (5) |
Complexity: 2 |
Complexity Density: 0,67 |
|
425 |
2
|
private void CloseDialogIfEmpty()... |
426 |
|
{ |
427 |
2
|
if (NoAlarmItems()) |
428 |
|
{ |
429 |
|
|
430 |
2
|
handlerCloseDialog.removeCallbacks(handlerUpdateDialogTask); |
431 |
2
|
handlerCloseDialog.postDelayed(handlerUpdateDialogTask, 1000); |
432 |
|
} |
433 |
|
} |
434 |
|
|
435 |
|
private Runnable handlerUpdateDialogTask = new Runnable() |
436 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
437 |
2
|
public void run()... |
438 |
|
{ |
439 |
2
|
AlarmDialog.this.finish(); |
440 |
|
} |
441 |
|
}; |
442 |
|
|
|
|
| 66,7% |
Uncovered Elements: 3 (9) |
Complexity: 3 |
Complexity Density: 0,6 |
|
443 |
1
|
public void OpenDataForEdit(AlarmDialogDataItem item)... |
444 |
|
{ |
445 |
1
|
bundleOtherDataStartup.clear(); |
446 |
1
|
if (item.getOrderFilter() == AlarmDataViewItem.iOrderAppts) |
447 |
1
|
OpenActivity(0, "android.intent.action.AnCal.ACTION_MODE_EDIT_APPOINTMENT", item.getID()); |
448 |
1
|
if (item.getOrderFilter() == AlarmDataViewItem.iOrderTasks) |
449 |
0
|
OpenActivity(0, "android.intent.action.AnCal.ACTION_MODE_EDIT_TASK", item.getID()); |
450 |
|
} |
451 |
|
|
452 |
|
private View.OnClickListener mBtnOnClick_OPEN = new View.OnClickListener() |
453 |
|
{ |
|
|
| 83,3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0,5 |
|
454 |
1
|
public void onClick(View arg0)... |
455 |
|
{ |
456 |
1
|
AlarmDialogDataItem item = getSelectedAlarmItemToProcess(); |
457 |
1
|
if (item != null) |
458 |
|
{ |
459 |
1
|
OpenDataForEdit(item); |
460 |
1
|
AlarmDialog.this.finish(); |
461 |
|
} |
462 |
|
} |
463 |
|
}; |
464 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 1 |
Complexity Density: 0,12 |
|
465 |
0
|
public boolean UpdateReminderService(String sKey)... |
466 |
|
{ |
467 |
0
|
Bundle args = new Bundle(); |
468 |
|
|
469 |
0
|
args.putBoolean(sKey, true); |
470 |
|
|
471 |
0
|
args.putBoolean("b24HourMode", prefs.b24HourMode); |
472 |
0
|
args.putInt("iFirstDayOfWeek", prefs.iFirstDayOfWeek); |
473 |
|
|
474 |
|
|
475 |
0
|
Intent intent = new Intent(this, AlarmService.class); |
476 |
0
|
intent.putExtras(args); |
477 |
0
|
ComponentName cpn = startService(intent); |
478 |
0
|
return (cpn != null); |
479 |
|
} |
480 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
481 |
0
|
@Override... |
482 |
|
protected void restoreStateFromFreeze() |
483 |
|
{ |
484 |
|
|
485 |
|
} |
486 |
|
|
487 |
|
} |
488 |
|
|
489 |
|
|