Jelajahi Sumber

Playing around with UI of WatchApp. Commit nr 1.

Jon Mårtensson 4 tahun lalu
induk
melakukan
4efe4e0d5e
1 mengubah file dengan 8 tambahan dan 3 penghapusan
  1. 8 3
      FreeAPSWatch WatchKit Extension/Views/MainView.swift

+ 8 - 3
FreeAPSWatch WatchKit Extension/Views/MainView.swift

@@ -60,9 +60,14 @@ struct MainView: View {
             }
             Spacer()
             HStack {
-                Text("IOB: " + iobFormatter.string(from: (state.iob ?? 0) as NSNumber)! + " U").font(.caption2)
+                Text(iobFormatter.string(from: (state.iob ?? 0) as NSNumber)!).font(.caption2)
+                Text(" U").foregroundColor(.insulin)
+
+                Spacer()
+                Text(iobFormatter.string(from: (state.cob ?? 0) as NSNumber)!).font(.caption2)
+                Text(" g").foregroundColor(.loopYellow)
+                Spacer()
                 Spacer()
-                Text("COB: " + iobFormatter.string(from: (state.cob ?? 0) as NSNumber)! + " g").font(.caption2)
             }
             Spacer()
         }.padding()
@@ -122,7 +127,7 @@ struct MainView: View {
         if minAgo > 1440 {
             return "--"
         }
-        return "\(minAgo) " + NSLocalizedString("min ago", comment: "Minutes ago since last loop")
+        return "\(minAgo) " + NSLocalizedString("min", comment: "Minutes ago since last loop")
     }
 
     private var color: Color {