mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-28 23:54:32 +00:00
Restored files from old Mac, force pushing
This commit is contained in:
parent
5dd95228b8
commit
5040381840
126 changed files with 10431 additions and 67 deletions
|
|
@ -0,0 +1,43 @@
|
|||
//
|
||||
// LiveActivityModifier.swift
|
||||
// boringNotch
|
||||
//
|
||||
// Created by Richard Kunkli on 12/08/2024.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
enum ActivityType {
|
||||
case mediaPlayback
|
||||
case charging
|
||||
case download
|
||||
}
|
||||
|
||||
struct LiveActivityModifier<Left: View, Right: View>: ViewModifier {
|
||||
let `for`: ActivityType
|
||||
let leftContent: () -> Left
|
||||
let rightContent: () -> Right
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
content
|
||||
.overlay(
|
||||
HStack {
|
||||
leftContent()
|
||||
Spacer()
|
||||
//.frame(minWidth: vm.closedNotchSize.width)
|
||||
rightContent()
|
||||
}
|
||||
.padding()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
extension View {
|
||||
func liveActivity<Left: View, Right: View>(
|
||||
for activityId: ActivityType,
|
||||
@ViewBuilder left: @escaping () -> Left,
|
||||
@ViewBuilder right: @escaping () -> Right
|
||||
) -> some View {
|
||||
self.modifier(LiveActivityModifier(for: activityId, leftContent: left, rightContent: right))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue