Чат: вертикальное центрирование bubble вложений, tap-to-download аватар и мгновенный показ call-attachment
This commit is contained in:
37
RosettaLiveActivityWidget/CallLiveActivity.swift
Normal file
37
RosettaLiveActivityWidget/CallLiveActivity.swift
Normal file
@@ -0,0 +1,37 @@
|
||||
import ActivityKit
|
||||
import SwiftUI
|
||||
import WidgetKit
|
||||
|
||||
struct CallLiveActivity: Widget {
|
||||
var body: some WidgetConfiguration {
|
||||
ActivityConfiguration(for: CallActivityAttributes.self) { context in
|
||||
// Lock Screen
|
||||
Text("Rosetta Call: \(context.attributes.peerName)")
|
||||
.foregroundColor(.white)
|
||||
.padding()
|
||||
.activityBackgroundTint(.black)
|
||||
} dynamicIsland: { context in
|
||||
DynamicIsland {
|
||||
DynamicIslandExpandedRegion(.center) {
|
||||
Text(context.attributes.peerName)
|
||||
.foregroundColor(.white)
|
||||
}
|
||||
DynamicIslandExpandedRegion(.bottom) {
|
||||
Text("Encrypted call")
|
||||
.font(.caption2)
|
||||
.foregroundColor(.gray)
|
||||
}
|
||||
} compactLeading: {
|
||||
Image(systemName: "phone.fill")
|
||||
.foregroundColor(.green)
|
||||
} compactTrailing: {
|
||||
Text("Call")
|
||||
.font(.caption2)
|
||||
.foregroundColor(.green)
|
||||
} minimal: {
|
||||
Image(systemName: "phone.fill")
|
||||
.foregroundColor(.green)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user