Skip to content

Commit 8c00f29

Browse files
committed
Further progress
1 parent 1b4e01a commit 8c00f29

File tree

9 files changed

+373
-2
lines changed

9 files changed

+373
-2
lines changed

app/google-services.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"project_info": {
3+
"project_id": "xdrip-plus",
4+
"project_number": "10591810485",
5+
"name": "xDrip plus"
6+
},
7+
"client": [
8+
{
9+
"client_info": {
10+
"mobilesdk_app_id": "1:10591810485:android:b70845957aa2e415",
11+
"client_id": "android:com.eveningoutpost.dexdrip",
12+
"client_type": 1,
13+
"android_client_info": {
14+
"package_name": "com.eveningoutpost.dexdrip"
15+
}
16+
},
17+
"oauth_client": [],
18+
"api_key": [],
19+
"services": {
20+
"analytics_service": {
21+
"status": 1
22+
},
23+
"cloud_messaging_service": {
24+
"status": 2,
25+
"apns_config": []
26+
},
27+
"appinvite_service": {
28+
"status": 1,
29+
"other_platform_oauth_client": []
30+
},
31+
"google_signin_service": {
32+
"status": 1
33+
},
34+
"ads_service": {
35+
"status": 1
36+
}
37+
}
38+
}
39+
],
40+
"client_info": [],
41+
"ARTIFACT_VERSION": "1"
42+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.eveningoutpost.dexdrip.Models;
2+
3+
/**
4+
* Created by jamorham on 04/01/16.
5+
*/
6+
public class CobCalc {
7+
double initialCarbs;
8+
double decayedBy;
9+
double isDecaying;
10+
double carbTime;
11+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.eveningoutpost.dexdrip.Models;
2+
3+
/**
4+
* Created by jamorham on 02/01/16.
5+
*/
6+
public class Iob {
7+
public long timestamp;
8+
public double iob = 0;
9+
public CobCalc cobCalc;
10+
public double cob = 0;
11+
public double rawCarbImpact = 0;
12+
public double jCarbImpact = 0;
13+
public double activity = 0;
14+
public double jActivity = 0;
15+
}
16+
17+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.eveningoutpost.dexdrip.Models;
2+
3+
import java.text.DecimalFormat;
4+
5+
/**
6+
* Created by jamorham on 06/01/16.
7+
*
8+
* lazy helper class for utilities
9+
*/
10+
public class JoH {
11+
final protected static char[] hexArray = "0123456789ABCDEF".toCharArray();
12+
13+
// qs = quick string conversion of double for printing
14+
public static String qs(double x) {
15+
return qs(x, 2);
16+
}
17+
18+
public static String qs(double x, int digits) {
19+
DecimalFormat df = new DecimalFormat("#");
20+
df.setMaximumFractionDigits(digits);
21+
df.setMinimumIntegerDigits(1);
22+
return df.format(x);
23+
}
24+
25+
public static String bytesToHex(byte[] bytes) {
26+
char[] hexChars = new char[bytes.length * 2];
27+
for (int j = 0; j < bytes.length; j++) {
28+
int v = bytes[j] & 0xFF;
29+
hexChars[j * 2] = hexArray[v >>> 4];
30+
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
31+
}
32+
return new String(hexChars);
33+
}
34+
}

app/src/main/res/layout/activity_home.xml

Lines changed: 139 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,152 @@
6363
android:layout_width="wrap_content"
6464
android:layout_height="wrap_content"
6565
android:textAppearance="?android:attr/textAppearanceSmall"
66-
android:text="100%"
66+
android:layout_marginTop="-1dp"
67+
android:text=""
6768
android:id="@+id/textBridgeBattery"
6869
android:textStyle="normal"
6970
android:textSize="12sp"
7071
android:inputType="none"
7172
android:layout_below="@+id/notices"
7273
android:layout_alignParentStart="true"
7374
android:background="@android:color/transparent"/>
75+
76+
<ImageButton
77+
android:layout_marginTop="7dp"
78+
android:background="@android:color/transparent"
79+
android:gravity="right"
80+
android:layout_width="wrap_content"
81+
android:layout_height="wrap_content"
82+
android:id="@+id/btnSpeak"
83+
android:src="@android:drawable/ic_btn_speak_now"
84+
android:contentDescription="@string/speaktreatment"
85+
android:layout_below="@+id/currentBgValueRealTime"
86+
android:layout_marginRight="10dp"
87+
android:layout_alignRight="@+id/currentBgValueRealTime"/>
88+
89+
<TextView
90+
91+
android:background="@android:color/transparent"
92+
android:layout_marginTop="6dp"
93+
android:layout_width="wrap_content"
94+
android:layout_height="wrap_content"
95+
android:text="Treatment voice data appears here"
96+
android:gravity="right"
97+
android:textAlignment="gravity"
98+
android:textSize="14dp"
99+
android:textColor="@android:color/holo_green_light"
100+
101+
android:shadowColor="@android:color/black"
102+
android:shadowDy="1"
103+
android:shadowDx="1"
104+
android:shadowRadius="0"
105+
android:id="@+id/treatmentTextView"
106+
android:layout_alignTop="@+id/btnSpeak"
107+
android:layout_toStartOf="@+id/btnSpeak" />
108+
109+
<ImageButton
110+
android:layout_marginStart="29dp"
111+
android:src="@android:drawable/ic_input_add"
112+
android:layout_width="wrap_content"
113+
android:layout_height="wrap_content"
114+
android:id="@+id/approveTreatment"
115+
android:contentDescription="Confirm Treatment"
116+
android:layout_below="@+id/btnSpeak"
117+
android:layout_alignParentStart="true" />
118+
119+
<ImageButton
120+
android:src="@android:drawable/ic_delete"
121+
android:layout_width="wrap_content"
122+
android:layout_height="wrap_content"
123+
android:id="@+id/cancelTreatment"
124+
android:layout_alignTop="@+id/approveTreatment"
125+
android:layout_toEndOf="@+id/approveTreatment" />
126+
127+
<ImageButton
128+
android:src="@drawable/ic_touch_app_white_48dp"
129+
android:layout_width="wrap_content"
130+
131+
android:layout_height="wrap_content"
132+
android:id="@+id/bloodTestButton"
133+
android:layout_alignBottom="@+id/cancelTreatment"
134+
android:layout_toEndOf="@+id/cancelTreatment"
135+
android:layout_marginStart="29dp" />
136+
137+
<TextView
138+
android:layout_width="wrap_content"
139+
android:layout_height="wrap_content"
140+
android:textSize="22dp"
141+
android:textColor="@android:color/holo_green_light"
142+
android:textStyle="bold"
143+
android:text="102 mg/dl"
144+
android:id="@+id/textBloodGlucose"
145+
android:background="@android:color/transparent"
146+
android:layout_alignBottom="@+id/bloodTestButton"
147+
android:layout_marginBottom="12dp"
148+
android:layout_toEndOf="@+id/bloodTestButton" />
149+
150+
<ImageButton
151+
android:src="@drawable/ic_local_dining_white_48dp"
152+
android:layout_width="wrap_content"
153+
android:layout_height="wrap_content"
154+
android:id="@+id/buttonCarbs"
155+
android:layout_below="@+id/bloodTestButton"
156+
android:layout_alignStart="@+id/bloodTestButton" />
157+
158+
<TextView
159+
android:layout_width="wrap_content"
160+
android:layout_height="wrap_content"
161+
android:textSize="22dp"
162+
android:textColor="@android:color/holo_green_light"
163+
android:textStyle="bold"
164+
android:text="65 grams"
165+
android:id="@+id/textCarbohydrate"
166+
android:background="@android:color/transparent"
167+
android:layout_marginBottom="12dp"
168+
android:layout_alignBottom="@+id/buttonCarbs"
169+
android:layout_toEndOf="@+id/buttonCarbs" />
170+
171+
<ImageButton
172+
android:src="@drawable/ic_colorize_white_48dp"
173+
android:layout_width="wrap_content"
174+
android:layout_height="wrap_content"
175+
android:id="@+id/buttonInsulin"
176+
android:layout_below="@+id/buttonCarbs"
177+
android:layout_alignStart="@+id/buttonCarbs" />
178+
179+
<TextView
180+
android:layout_width="wrap_content"
181+
android:layout_height="wrap_content"
182+
android:textSize="22dp"
183+
android:textColor="@android:color/holo_green_light"
184+
android:background="@android:color/transparent"
185+
android:textStyle="bold"
186+
android:text="14 units"
187+
android:id="@+id/textInsulinUnits"
188+
android:layout_marginBottom="12dp"
189+
android:layout_alignBottom="@+id/buttonInsulin"
190+
android:layout_toEndOf="@+id/buttonInsulin" />
191+
192+
<ImageButton
193+
android:src="@drawable/ic_av_timer_white_36dp"
194+
android:layout_width="wrap_content"
195+
android:layout_height="wrap_content"
196+
android:id="@+id/timeButton"
197+
android:layout_below="@+id/bloodTestButton"
198+
android:layout_alignStart="@+id/approveTreatment" />
199+
<TextView
200+
android:layout_width="wrap_content"
201+
android:layout_height="wrap_content"
202+
android:textSize="22dp"
203+
android:textColor="@android:color/holo_green_light"
204+
android:textStyle="bold"
205+
android:text="00:00"
206+
android:id="@+id/textTimeButton"
207+
android:background="@android:color/transparent"
208+
android:layout_marginBottom="12dp"
209+
android:layout_alignBottom="@+id/timeButton"
210+
android:layout_toEndOf="@+id/timeButton" />
211+
74212
</RelativeLayout>
75213

76214
<lecho.lib.hellocharts.view.PreviewLineChartView

app/src/main/res/menu/menu_home.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,28 @@
1818
android:orderInCategory="1"
1919
android:showAsAction="never"/>
2020

21+
<item android:id="@+id/importsettings"
22+
android:title="Import Settings"
23+
android:checkable="false"
24+
android:orderInCategory="1"
25+
android:showAsAction="never"/>
26+
27+
<item android:id="@+id/exportsettings"
28+
android:title="Export Settings (warning!)"
29+
android:checkable="false"
30+
android:orderInCategory="1"
31+
android:showAsAction="never"/>
32+
33+
<item android:id="@+id/synctreatments"
34+
android:title="Sync Treatments"
35+
android:checkable="false"
36+
android:orderInCategory="1"
37+
android:showAsAction="never"/>
38+
39+
<item android:id="@+id/action_toggle_speakreadings"
40+
android:title="@string/menu_toggle_speakreadings"
41+
android:checkable="true"
42+
android:orderInCategory="2"
43+
android:visible="false"
44+
android:showAsAction="never"/>
2145
</menu>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{"entries":[
2+
{"lexicon": "stop",
3+
"matchWords":[
4+
"stop",
5+
"cancel",
6+
"done",
7+
"end",
8+
"top",
9+
"ansell",
10+
"finished",
11+
"finish",
12+
"quit"
13+
]},
14+
15+
{"lexicon": "rapid",
16+
"matchWords":[
17+
"rapid",
18+
"rapid acting",
19+
"rapid-acting",
20+
"nova rapid",
21+
"nova log",
22+
"rapido",
23+
"fast-acting",
24+
"fast",
25+
"resurrecting",
26+
"reflecting",
27+
"units",
28+
"unit",
29+
"u",
30+
"you"
31+
]},
32+
33+
{"lexicon": "long",
34+
"matchWords":[
35+
"long",
36+
"long acting",
37+
"lantus"
38+
]},
39+
40+
{"lexicon": "carbs",
41+
"matchWords":[
42+
"carbs",
43+
"cards",
44+
"carbohydrate",
45+
"carbohydrates",
46+
"grams",
47+
"gram",
48+
"carb",
49+
"g",
50+
"gee"
51+
]},
52+
53+
{"lexicon": "time",
54+
"matchWords":[
55+
"time",
56+
"times",
57+
"clock",
58+
"o'clock",
59+
"oclock",
60+
"hour",
61+
"hours",
62+
"at"
63+
]},
64+
65+
{"lexicon": "ago",
66+
"matchWords":[
67+
"ago"
68+
]},
69+
70+
71+
{"lexicon": "blood",
72+
"matchWords":[
73+
"mmol",
74+
"mmols",
75+
"animal",
76+
"miles",
77+
"mile",
78+
"memo",
79+
"mobile",
80+
"month",
81+
"mm",
82+
"mg",
83+
"bg",
84+
"milligram",
85+
"milligrams",
86+
"normal",
87+
"mole",
88+
"moles",
89+
"sugar",
90+
"blood",
91+
"test",
92+
"blood sugar",
93+
"obsessed"
94+
]},
95+
96+
{"lexicon": "grams",
97+
"matchWords":[
98+
]},
99+
100+
{"lexicon": "units",
101+
"matchWords":[
102+
]}
103+
104+
]}

0 commit comments

Comments
 (0)