Clover Coverage Report - AnCal Coverage Report
Coverage timestamp: gio dic 18 2014 12:18:42 EST
../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
21   64   4   7
0   48   0,19   3
3     1,33  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  Prefs       Line # 9 21 4 95,8% 0.9583333
 
No Tests
 
1   
2    package pl.magot.vetch.ancal;
3   
4   
5    import java.util.Calendar;
6    import android.content.*;
7   
8   
 
9    public class Prefs
10    {
11    //private fields
12    private final String sPrefsName = "AnCalPrefs";
13    private SharedPreferences prefs = null;
14   
15    //prefs data
16    private int iMinutesOffset; //offset start of new appointment
17    public int iMinutesDuration; //duration of appointment
18    public boolean b24HourMode; //time mode
19    public int iFirstDayOfWeek; //first day of week
20    public boolean bShowAllTasks; //show all tasks in today, or hide undued
21    public int iSnoozeCount; //count of snooze times to change alarm to cleared
22    public int iSnoozeMinutesOverdue; //snooze minutes alarm overdue
23   
 
24  32 toggle public Prefs(Context ctx)
25    {
26  32 prefs = ctx.getSharedPreferences(sPrefsName, Context.MODE_WORLD_WRITEABLE);
27  32 Load();
28    }
29   
 
30  4 toggle public boolean Save()
31    {
32  4 try
33    {
34  4 SharedPreferences.Editor ed = prefs.edit();
35   
36  4 ed.putInt("iMinutesOffset", iMinutesOffset);
37  4 ed.putInt("iMinutesDuration", iMinutesDuration);
38  4 ed.putBoolean("b24HourMode", b24HourMode);
39  4 ed.putInt("iFirstDayOfWeek", iFirstDayOfWeek);
40  4 ed.putBoolean("bShowAllTasks", bShowAllTasks);
41  4 ed.putInt("iSnoozeCount", iSnoozeCount);
42  4 ed.putInt("iSnoozeMinutesOverdue", iSnoozeMinutesOverdue);
43   
44    //return ed.commit();
45   
46  4 ed.commit();
47   
48  4 return true;
49    } catch (Exception e) {
50  0 return false;
51    }
52    }
53   
 
54  33 toggle public void Load()
55    {
56  33 iMinutesOffset = prefs.getInt("iMinutesOffset", 30);
57  33 iMinutesDuration = prefs.getInt("iMinutesDuration", 15);
58  33 b24HourMode = prefs.getBoolean("b24HourMode", false);
59  33 iFirstDayOfWeek = prefs.getInt("iFirstDayOfWeek", Calendar.MONDAY);
60  33 bShowAllTasks = prefs.getBoolean("bShowAllTasks", false);
61  33 iSnoozeCount = prefs.getInt("iSnoozeCount", 5);
62  33 iSnoozeMinutesOverdue = prefs.getInt("iSnoozeMinutesOverdue", 5);
63    }
64    }