polscm32 2 лет назад
Родитель
Сommit
d358ad396d
2 измененных файлов с 15 добавлено и 15 удалено
  1. 5 5
      LiveActivity/LiveActivity.swift
  2. 10 10
      LiveActivity/WidgetBobble.swift

+ 5 - 5
LiveActivity/LiveActivity.swift

@@ -71,7 +71,7 @@ struct LiveActivity: Widget {
 
     @ViewBuilder func chart(context: ActivityViewContext<LiveActivityAttributes>) -> some View {
         if context.isStale {
-            Text("--")
+            Text("No data available")
         } else {
             Chart {
                 ForEach(context.state.chart.indices, id: \.self) { index in
@@ -81,14 +81,14 @@ struct LiveActivity: Widget {
                     ).foregroundStyle(Color.green.gradient).symbolSize(12)
                 }
             }.chartPlotStyle { plotContent in
-                plotContent.background(.gray.opacity(0.1))
+                plotContent.background(.cyan.opacity(0.1))
             }
             .chartYAxis {
                 AxisMarks(position: .leading)
-            }.foregroundStyle(Color.white)
+            }
             .chartXAxis {
                 AxisMarks(position: .automatic)
-            }.foregroundStyle(Color.white)
+            }
         }
     }
 
@@ -120,7 +120,7 @@ struct LiveActivity: Widget {
             .padding(.all, 15)
             .background(Color.white.opacity(0.2))
             .foregroundColor(Color.white)
-            .activityBackgroundTint(Color.cyan.opacity(0.3))
+            .activityBackgroundTint(Color.black.opacity(0.7))
             .activitySystemActionForegroundColor(Color.black)
 
         } dynamicIsland: { context in

+ 10 - 10
LiveActivity/WidgetBobble.swift

@@ -12,7 +12,7 @@ struct WidgetBobble: View {
                 Group {
                     CircleShape(gradient: gradient)
                     TriangleShape(color: color)
-                }.shadow(color: Color.black.opacity(colorScheme == .dark ? 0.75 : 0.33), radius: colorScheme == .dark ? 5 : 3)
+                }
                 CircleShape(gradient: gradient)
             }
         }
@@ -25,15 +25,15 @@ struct CircleShape: View {
     let gradient: AngularGradient
 
     var body: some View {
-        let colorBackground: Color = colorScheme == .dark ? Color(
-            red: 0.05490196078,
-            green: 0.05490196078,
-            blue: 0.05490196078
-        ) : .white
+//        let colorBackground: Color = colorScheme == .dark ? Color(
+//            red: 0.05490196078,
+//            green: 0.05490196078,
+//            blue: 0.05490196078
+//        ) : .white
 
         Circle()
-            .stroke(gradient, lineWidth: 6)
-            .background(Circle().fill(colorBackground))
+            .stroke(gradient, lineWidth: 10)
+            .background(Circle().fill(.clear))
             .frame(width: 130, height: 130)
     }
 }
@@ -46,7 +46,7 @@ struct TriangleShape: View {
             .fill(color)
             .frame(width: 35, height: 35)
             .rotationEffect(.degrees(90))
-            .offset(x: 70)
+            .offset(x: 78)
     }
 }
 
@@ -54,7 +54,7 @@ struct Triangle: Shape {
     func path(in rect: CGRect) -> Path {
         var path = Path()
 
-        let cornerRadius: CGFloat = 8
+        let cornerRadius: CGFloat = 2
 
         path.move(to: CGPoint(x: rect.midX, y: rect.minY))
         path.addLine(to: CGPoint(x: rect.maxX, y: rect.maxY - cornerRadius))