mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 23:24:32 +00:00
HotFix: Remove Unnecessary Mach service for Stats
This commit is contained in:
parent
a2d18cda49
commit
28320e4cb8
11 changed files with 58 additions and 161 deletions
|
|
@ -1,98 +0,0 @@
|
|||
/*
|
||||
* Atoll (DynamicIsland)
|
||||
* Copyright (C) 2024-2026 Atoll Contributors
|
||||
*
|
||||
* Originally from boring.notch project
|
||||
* Modified and adapted for Atoll (DynamicIsland)
|
||||
* See NOTICE for details.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct MinimalFaceFeatures: View {
|
||||
@State private var isBlinking = false
|
||||
@State var height:CGFloat = 20;
|
||||
@State var width:CGFloat = 30;
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 4) { // Adjusted spacing to fit within 30x30
|
||||
// Eyes
|
||||
HStack(spacing: 4) { // Adjusted spacing to fit within 30x30
|
||||
Eye(isBlinking: $isBlinking)
|
||||
Eye(isBlinking: $isBlinking)
|
||||
}
|
||||
|
||||
// Nose and mouth combined
|
||||
VStack(spacing: 2) { // Adjusted spacing to fit within 30x30
|
||||
// Nose
|
||||
RoundedRectangle(cornerRadius: 2)
|
||||
.fill(Color.white)
|
||||
.frame(width: 3, height: 4)
|
||||
|
||||
// Mouth (happy)
|
||||
GeometryReader { geometry in
|
||||
Path { path in
|
||||
let width = geometry.size.width
|
||||
let height = geometry.size.height
|
||||
path.move(to: CGPoint(x: 0, y: height / 2))
|
||||
path.addQuadCurve(to: CGPoint(x: width, y: height / 2), control: CGPoint(x: width / 2, y: height))
|
||||
}
|
||||
.stroke(Color.white, lineWidth: 2)
|
||||
}
|
||||
.frame(width: 14, height: 10)
|
||||
}
|
||||
}
|
||||
.frame(width: self.width, height: self.height) // Maximum size of face
|
||||
.onAppear {
|
||||
startBlinking()
|
||||
}
|
||||
}
|
||||
|
||||
func startBlinking() {
|
||||
Timer.scheduledTimer(withTimeInterval: 3, repeats: true) { _ in
|
||||
withAnimation(.spring(duration: 0.2)) {
|
||||
isBlinking = true
|
||||
}
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||
withAnimation(.spring(duration: 0.2)) {
|
||||
isBlinking = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Eye: View {
|
||||
@Binding var isBlinking: Bool
|
||||
|
||||
var body: some View {
|
||||
RoundedRectangle(cornerRadius: 10)
|
||||
.fill(Color.white)
|
||||
.frame(width: 4, height: isBlinking ? 1 : 4)
|
||||
.frame(maxWidth: 15, maxHeight: 15) // Adjusted max size
|
||||
.animation(.easeInOut(duration: 0.1), value: isBlinking)
|
||||
}
|
||||
}
|
||||
|
||||
struct MinimalFaceFeatures_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ZStack {
|
||||
Color.black
|
||||
MinimalFaceFeatures()
|
||||
}
|
||||
.previewLayout(.fixed(width: 60, height: 60)) // Adjusted preview size for better visibility
|
||||
}
|
||||
}
|
||||
|
|
@ -28,8 +28,10 @@ struct EmptyStateView: View {
|
|||
|
||||
var body: some View {
|
||||
HStack {
|
||||
MinimalFaceFeatures(
|
||||
height: 70, width: 80)
|
||||
Image(systemName: "music.note")
|
||||
.font(.system(size: 24))
|
||||
.foregroundColor(.gray)
|
||||
.frame(width: 80, height: 70)
|
||||
Text(message)
|
||||
.font(.system(size:14))
|
||||
.foregroundColor(.gray)
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ struct IdleAnimationView: View {
|
|||
AnimationContentView(animation: animation)
|
||||
.id("\(animation.id)-\(overrides[animation.id.uuidString]?.hashValue ?? 0)") // Force recreation when override changes
|
||||
} else {
|
||||
// Fallback to original face if nothing selected
|
||||
MinimalFaceFeatures(height: 20, width: 30)
|
||||
// No animation selected
|
||||
EmptyView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -85,20 +85,6 @@ private struct AnimationContentView: View {
|
|||
.padding(.bottom, config.paddingBottom)
|
||||
.frame(width: config.expandWithAnimation ? nil : 30, height: 20)
|
||||
.clipped()
|
||||
|
||||
case .builtInFace:
|
||||
// Apply transforms to built-in face too!
|
||||
MinimalFaceFeatures(height: 20, width: 30)
|
||||
.frame(
|
||||
width: config.cropWidth * config.scale,
|
||||
height: config.cropHeight * config.scale
|
||||
)
|
||||
.offset(x: config.offsetX, y: config.offsetY)
|
||||
.rotationEffect(.degrees(config.rotation))
|
||||
.opacity(config.opacity)
|
||||
.padding(.bottom, config.paddingBottom)
|
||||
.frame(width: config.expandWithAnimation ? nil : 30, height: 20)
|
||||
.clipped()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,16 +170,11 @@ struct AnimationEditorView: View {
|
|||
.frame(width: 30 * previewScale, height: 20 * previewScale)
|
||||
|
||||
Group {
|
||||
if let existing = existingAnimation, case .builtInFace = existing.source {
|
||||
MinimalFaceFeatures(height: 20, width: 30)
|
||||
.scaleEffect(previewScale)
|
||||
} else {
|
||||
LottieView(state: LUStateData(
|
||||
type: .loadedFrom(sourceURL),
|
||||
speed: speed,
|
||||
loopMode: loopMode.lottieLoopMode
|
||||
))
|
||||
}
|
||||
LottieView(state: LUStateData(
|
||||
type: .loadedFrom(sourceURL),
|
||||
speed: speed,
|
||||
loopMode: loopMode.lottieLoopMode
|
||||
))
|
||||
}
|
||||
.frame(width: cropWidth * scale * previewScale, height: cropHeight * scale * previewScale)
|
||||
.offset(x: offsetX * previewScale, y: offsetY * previewScale)
|
||||
|
|
|
|||
|
|
@ -87,12 +87,6 @@ struct IdleAnimationsSettingsSection: View {
|
|||
print("🔧 [Edit] Lottie URL: \(url)")
|
||||
editorSourceURL = url
|
||||
editorIsRemote = true
|
||||
|
||||
case .builtInFace:
|
||||
print("🔧 [Edit] Built-in face - using dummy URL")
|
||||
// Use a dummy URL for built-in face (editor only needs URL for preview)
|
||||
editorSourceURL = URL(string: "builtin://face")!
|
||||
editorIsRemote = false
|
||||
}
|
||||
|
||||
// Show editor with slight delay to ensure state is set
|
||||
|
|
@ -118,7 +112,7 @@ struct IdleAnimationsSettingsSection: View {
|
|||
}
|
||||
.frame(height: 140)
|
||||
} else {
|
||||
Text("Enable \"Show cool face animation while inactivity\" to customize animations")
|
||||
Text("Enable \"Idle Animation\" to customize animations")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.vertical, 8)
|
||||
|
|
@ -388,10 +382,6 @@ struct AnimationPreview: View {
|
|||
loopMode: .loop
|
||||
))
|
||||
.frame(width: 60, height: 40)
|
||||
|
||||
case .builtInFace:
|
||||
MinimalFaceFeatures(height: 40, width: 60)
|
||||
.scaleEffect(2.0) // Scale up the face for preview
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -807,7 +807,7 @@ struct SettingsView: View {
|
|||
SettingsSearchEntry(tab: .appearance, title: "Slider color", keywords: ["slider", "accent"], highlightID: SettingsTab.appearance.highlightID(for: "Slider color")),
|
||||
SettingsSearchEntry(tab: .appearance, title: "Enable Dynamic mirror", keywords: ["mirror", "reflection"], highlightID: SettingsTab.appearance.highlightID(for: "Enable Dynamic mirror")),
|
||||
SettingsSearchEntry(tab: .appearance, title: "Mirror shape", keywords: ["mirror shape", "circle", "rectangle"], highlightID: SettingsTab.appearance.highlightID(for: "Mirror shape")),
|
||||
SettingsSearchEntry(tab: .appearance, title: "Show cool face animation while inactivity", keywords: ["face animation", "idle"], highlightID: SettingsTab.appearance.highlightID(for: "Show cool face animation while inactivity")),
|
||||
SettingsSearchEntry(tab: .appearance, title: "Idle Animation", keywords: ["face animation", "idle", "cool face"], highlightID: SettingsTab.appearance.highlightID(for: "Idle Animation")),
|
||||
SettingsSearchEntry(tab: .appearance, title: "App icon", keywords: ["app icon", "custom icon"], highlightID: SettingsTab.appearance.highlightID(for: "App icon")),
|
||||
|
||||
// Lock Screen
|
||||
|
|
@ -3951,8 +3951,8 @@ struct Appearance: View {
|
|||
.tag(MirrorShapeEnum.rectangle)
|
||||
}
|
||||
.settingsHighlight(id: highlightID("Mirror shape"))
|
||||
Defaults.Toggle("Show cool face animation while inactivity", key: .showNotHumanFace)
|
||||
.settingsHighlight(id: highlightID("Show cool face animation while inactivity"))
|
||||
Defaults.Toggle("Idle Animation", key: .showNotHumanFace)
|
||||
.settingsHighlight(id: highlightID("Idle Animation"))
|
||||
} header: {
|
||||
HStack {
|
||||
Text("Additional features")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue