Ivan Valkou 4 лет назад
Родитель
Сommit
4c72251a7f
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      FreeAPSWatch WatchKit Extension/Views/BolusConfirmationView.swift

+ 7 - 2
FreeAPSWatch WatchKit Extension/Views/BolusConfirmationView.swift

@@ -16,12 +16,17 @@ struct BolusConfirmationView: View {
     var body: some View {
         VStack {
             GeometryReader { geo in
-                ZStack {
+                ZStack(alignment: .top) {
                     RoundedRectangle(cornerRadius: elementSize / 2, style: .circular)
                         .fill(.secondary)
                         .frame(width: elementSize, height: geo.size.height)
                         .opacity(0.2)
 
+                    RoundedRectangle(cornerRadius: elementSize / 2, style: .circular)
+                        .fill(Color.insulin)
+                        .frame(width: elementSize, height: elementSize + (geo.size.height - elementSize) * progress / 100)
+                        .opacity(0.2)
+
                     Image(systemName: "arrow.right")
                         .resizable()
                         .frame(width: elementSize / 2, height: elementSize / 2)
@@ -104,6 +109,6 @@ struct BolusConfirmationView: View {
 
 struct BolusConfirmationView_Previews: PreviewProvider {
     static var previews: some View {
-        BolusConfirmationView().environmentObject(WatchStateModel())
+        BolusConfirmationView(progress: 50, done: false).environmentObject(WatchStateModel())
     }
 }