Skip to content

Commit

Permalink
fix/#87-watch issue 모두 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
KimPilGyeom committed Nov 13, 2024
1 parent 1a65fdd commit 4ddcf7a
Show file tree
Hide file tree
Showing 16 changed files with 286 additions and 154 deletions.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "MainCircle.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "MainCircle 1.svg",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "MainCircle 2.svg",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 13 additions & 9 deletions hearo/HearoadWatch Watch App/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,28 @@ struct ContentView: View {
@ObservedObject var sessionManager = WatchSessionManager.shared

var body: some View {



ZStack {
// 배경색을 alert 상태에 따라 변경
sessionManager.isAlerting ? Color.red.edgesIgnoringSafeArea(.all) : Color.black.edgesIgnoringSafeArea(.all)



// 알림 상태에 따른 아이콘 표시
if sessionManager.isAlerting {
if sessionManager.isAlerting {
Image(sessionManager.alertImageName())
.resizable()
.scaledToFit()
.frame(width: 200, height: 200)
.padding()
} else {
// 알림이 아닐 때는 MainCircle 이미지를 표시
Image("MainCircle")
.resizable()
.frame(width: 200, height: 200)
.padding()
}
}
else{
Image("MainCircle")
.resizable()
.frame(width: 200, height: 200)
.padding()
}
}
.onAppear {
// 초기화
Expand Down
14 changes: 13 additions & 1 deletion hearo/HearoadWatch Watch App/WatchSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,29 @@ class WatchSessionManager: NSObject, ObservableObject, WCSessionDelegate {
case "Bicyclebell":
return "Bicycle" // bicycle 이미지 이름
default:
return "exclamationmark.triangle.fill" // 기본 알림 아이콘
return "Car" // 기본 알림 아이콘
}
}

// 3초 동안 알림 표시 후 기본 상태로 복구
func showAlert(with message: String) {
// "녹음 시작 전" 메시지는 무시
guard message != "녹음 시작 전" else {
print("메시지 무시: \(message)")
return
}

alertMessage = message
isAlerting = true

// 강한 진동 알림 발생
playUrgentHapticPattern()

// UI 업데이트: 빨간 배경, 아이콘 표시
DispatchQueue.main.async {
print("UI 업데이트 - 배경색: 빨간색, 메시지: \(message)")
}

// 3초 후에 기본 상태로 복구
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
self.resetAlert()
Expand All @@ -79,6 +90,7 @@ class WatchSessionManager: NSObject, ObservableObject, WCSessionDelegate {
func resetAlert() {
alertMessage = "인식중"
isAlerting = false
print("UI 상태 복구 - 배경색: 검정, 메시지: 기본 상태")
}

// WCSession 활성화 완료 시 호출되는 메서드
Expand Down
20 changes: 10 additions & 10 deletions hearo/hearo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,8 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"hearo/Preview Content\"";
DEVELOPMENT_TEAM = GT56H2MYWV;
DEVELOPMENT_ASSET_PATHS = "hearo/Preview\\ Content HearoadWatch\\ Watch\\ App";
DEVELOPMENT_TEAM = J5N8Y9F8Z8;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = hearo/Info.plist;
Expand Down Expand Up @@ -1049,8 +1049,8 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"hearo/Preview Content\"";
DEVELOPMENT_TEAM = GT56H2MYWV;
DEVELOPMENT_ASSET_PATHS = "hearo/Preview\\ Content HearoadWatch\\ Watch\\ App";
DEVELOPMENT_TEAM = J5N8Y9F8Z8;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = hearo/Info.plist;
Expand Down Expand Up @@ -1155,8 +1155,8 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"HearoadWatch Watch App/Preview Content\"";
DEVELOPMENT_TEAM = GT56H2MYWV;
DEVELOPMENT_ASSET_PATHS = "hearo HearoadWatch\\ Watch\\ App/Preview\\ Content";
DEVELOPMENT_TEAM = J5N8Y9F8Z8;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "HearoadWatch-Watch-App-Info.plist";
Expand Down Expand Up @@ -1186,8 +1186,8 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"HearoadWatch Watch App/Preview Content\"";
DEVELOPMENT_TEAM = GT56H2MYWV;
DEVELOPMENT_ASSET_PATHS = "hearo HearoadWatch\\ Watch\\ App/Preview\\ Content";
DEVELOPMENT_TEAM = J5N8Y9F8Z8;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "HearoadWatch-Watch-App-Info.plist";
Expand Down Expand Up @@ -1295,7 +1295,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = GT56H2MYWV;
DEVELOPMENT_TEAM = J5N8Y9F8Z8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = LiveActivity/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = LiveActivity;
Expand Down Expand Up @@ -1323,7 +1323,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = GT56H2MYWV;
DEVELOPMENT_TEAM = J5N8Y9F8Z8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = LiveActivity/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = LiveActivity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,4 @@
uuid = "E612D0C1-8F2A-42B7-B849-5689FA63B147"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "88C89FED-F133-41C7-AF37-E3E6A1698142"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "hearo/Sources/Helper/Coordinator.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "6"
endingLineNumber = "6"
landmarkName = "unknown"
landmarkType = "0">
</BreakpointContent>
</BreakpointProxy>
<<<<<<< Updated upstream
=======
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "35B5EB06-74AC-48F5-97F1-7808B582A78F"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "hearo/Sources/Presentations/Working/ViewModel/WorkingViewModel.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "67"
endingLineNumber = "67"
landmarkName = "WorkingViewModel"
landmarkType = "3">
</BreakpointContent>
</BreakpointProxy>
>>>>>>> Stashed changes
</Breakpoints>
</Bucket>
7 changes: 3 additions & 4 deletions hearo/hearo/Application/hearoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ struct hearoApp: App {
}

final class AppRootManager: ObservableObject {
static let shared = AppRootManager() // 싱글톤 객체

@Published var currentRoot: AppRoot = .splash {
didSet {
// working 상태로 전환될 때 오디오 수집 자동 시작
Expand Down Expand Up @@ -87,10 +89,7 @@ final class AppRootManager: ObservableObject {
case warning
}

init() {
self.hornSoundDetector = HornSoundDetector(appRootManager: self)
}


// 스플래시 끝났을 때 호출
func determineNextRoot() {
let hasSeenOnboarding = UserDefaults.standard.bool(forKey: "hasSeenOnboarding")
Expand Down
7 changes: 2 additions & 5 deletions hearo/hearo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>WKCompanionAppBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>UIAppFonts</key>
<array>
<string>Pretendard-Light.otf</string>
<string>Pretendard-Regular.otf</string>
<string>Pretendard-Medium.otf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>Audio</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"images" : [
{
"filename" : "Icon 오후 9.05.06 1.png",
"filename" : "Icon 오후 9.05.06 1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Icon 오후 9.05.06.png",
"filename" : "Icon 오후 9.05.06.png",
"idiom" : "universal",
"scale" : "2x"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "시작하기.svg",
"filename" : "시작하기.svg",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
Loading

0 comments on commit 4ddcf7a

Please sign in to comment.