Keep lock screen controls within a compact card
This commit is contained in:
@@ -34,6 +34,7 @@ final class LiveActivityManager: ObservableObject {
|
|||||||
|
|
||||||
func start(_ state: MediaState, connection: Connection) {
|
func start(_ state: MediaState, connection: Connection) {
|
||||||
guard !running, state.hasSession, UIApplication.shared.applicationState == .active else { return }
|
guard !running, state.hasSession, UIApplication.shared.applicationState == .active else { return }
|
||||||
|
guard connection.token != nil else { error = "Сначала выполните сопряжение с ПК."; return }
|
||||||
guard ActivityAuthorizationInfo().areActivitiesEnabled else {
|
guard ActivityAuthorizationInfo().areActivitiesEnabled else {
|
||||||
error = "Разрешите Live Activities в настройках MusicBridge на iPhone."
|
error = "Разрешите Live Activities в настройках MusicBridge на iPhone."
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ struct MusicActivityCard: View {
|
|||||||
let stale: Bool
|
let stale: Bool
|
||||||
var activityID: String = ""
|
var activityID: String = ""
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading, spacing: 10) {
|
VStack(alignment: .leading, spacing: 6) {
|
||||||
HStack(spacing: 12) {
|
HStack(spacing: 12) {
|
||||||
Image(systemName: "waveform").font(.title).foregroundStyle(.indigo)
|
Image(systemName: "waveform").font(.title).foregroundStyle(.indigo)
|
||||||
TrackLabels(state: state)
|
TrackLabels(state: state)
|
||||||
@@ -17,7 +17,7 @@ struct MusicActivityCard: View {
|
|||||||
ProgressView(value: state.progress).tint(.indigo)
|
ProgressView(value: state.progress).tint(.indigo)
|
||||||
ActivityStatus(state: state, stale: stale)
|
ActivityStatus(state: state, stale: stale)
|
||||||
MusicActivityControls(activityID: activityID)
|
MusicActivityControls(activityID: activityID)
|
||||||
}.padding(16)
|
}.padding(12)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user