diff --git a/SodaLive/Resources/Assets.xcassets/ic_thumb_play_blue.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/ic_alarm_clock_blue.imageset/Contents.json similarity index 85% rename from SodaLive/Resources/Assets.xcassets/ic_thumb_play_blue.imageset/Contents.json rename to SodaLive/Resources/Assets.xcassets/ic_alarm_clock_blue.imageset/Contents.json index d705adf..2cdd4b8 100644 --- a/SodaLive/Resources/Assets.xcassets/ic_thumb_play_blue.imageset/Contents.json +++ b/SodaLive/Resources/Assets.xcassets/ic_alarm_clock_blue.imageset/Contents.json @@ -9,7 +9,7 @@ "scale" : "2x" }, { - "filename" : "ic_thumb_play_blue.png", + "filename" : "ic_alarm_clock_blue.png", "idiom" : "universal", "scale" : "3x" } diff --git a/SodaLive/Resources/Assets.xcassets/ic_alarm_clock_blue.imageset/ic_alarm_clock_blue.png b/SodaLive/Resources/Assets.xcassets/ic_alarm_clock_blue.imageset/ic_alarm_clock_blue.png new file mode 100644 index 0000000..bca0e7c Binary files /dev/null and b/SodaLive/Resources/Assets.xcassets/ic_alarm_clock_blue.imageset/ic_alarm_clock_blue.png differ diff --git a/SodaLive/Resources/Assets.xcassets/ic_thumb_play_blue.imageset/ic_thumb_play_blue.png b/SodaLive/Resources/Assets.xcassets/ic_thumb_play_blue.imageset/ic_thumb_play_blue.png deleted file mode 100644 index 9688e54..0000000 Binary files a/SodaLive/Resources/Assets.xcassets/ic_thumb_play_blue.imageset/ic_thumb_play_blue.png and /dev/null differ diff --git a/SodaLive/Resources/Assets.xcassets/ic_thumb_play_purple.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/ic_thumb_play_purple.imageset/Contents.json new file mode 100644 index 0000000..31a55f7 --- /dev/null +++ b/SodaLive/Resources/Assets.xcassets/ic_thumb_play_purple.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ic_thumb_play_purple.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SodaLive/Resources/Assets.xcassets/ic_thumb_play_purple.imageset/ic_thumb_play_purple.png b/SodaLive/Resources/Assets.xcassets/ic_thumb_play_purple.imageset/ic_thumb_play_purple.png new file mode 100644 index 0000000..dcba530 Binary files /dev/null and b/SodaLive/Resources/Assets.xcassets/ic_thumb_play_purple.imageset/ic_thumb_play_purple.png differ diff --git a/SodaLive/Resources/Assets.xcassets/img_bg_morning_call.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/img_bg_morning_call.imageset/Contents.json new file mode 100644 index 0000000..c29c69b --- /dev/null +++ b/SodaLive/Resources/Assets.xcassets/img_bg_morning_call.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "img_bg_morning_call.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/SodaLive/Resources/Assets.xcassets/img_bg_morning_call.imageset/img_bg_morning_call.png b/SodaLive/Resources/Assets.xcassets/img_bg_morning_call.imageset/img_bg_morning_call.png new file mode 100644 index 0000000..aab5dac Binary files /dev/null and b/SodaLive/Resources/Assets.xcassets/img_bg_morning_call.imageset/img_bg_morning_call.png differ diff --git a/SodaLive/Resources/Assets.xcassets/img_bg_review_live.imageset/img_bg_review_live.png b/SodaLive/Resources/Assets.xcassets/img_bg_review_live.imageset/img_bg_review_live.png index 87f554d..333d3ae 100644 Binary files a/SodaLive/Resources/Assets.xcassets/img_bg_review_live.imageset/img_bg_review_live.png and b/SodaLive/Resources/Assets.xcassets/img_bg_review_live.imageset/img_bg_review_live.png differ diff --git a/SodaLive/Resources/Assets.xcassets/img_bg_short_play.imageset/img_bg_short_play.png b/SodaLive/Resources/Assets.xcassets/img_bg_short_play.imageset/img_bg_short_play.png index d497918..2897d60 100644 Binary files a/SodaLive/Resources/Assets.xcassets/img_bg_short_play.imageset/img_bg_short_play.png and b/SodaLive/Resources/Assets.xcassets/img_bg_short_play.imageset/img_bg_short_play.png differ diff --git a/SodaLive/Sources/Content/ContentRepository.swift b/SodaLive/Sources/Content/ContentRepository.swift index a00299c..695b805 100644 --- a/SodaLive/Sources/Content/ContentRepository.swift +++ b/SodaLive/Sources/Content/ContentRepository.swift @@ -82,7 +82,7 @@ final class ContentRepository { return api.requestPublisher( .getNewContentOfTheme( theme: theme, - isAdultContentVisible: UserDefaults.bool(forKey: .isAdultContentVisible), + isAdultContentVisible: UserDefaults.isAdultContentVisible(), contentType: ContentType(rawValue: UserDefaults.string(forKey: .contentPreference)) ?? ContentType.ALL ) ) @@ -91,7 +91,7 @@ final class ContentRepository { func getCurationList(page: Int, size: Int) -> AnyPublisher { return api.requestPublisher( .getCurationList( - isAdultContentVisible: UserDefaults.bool(forKey: .isAdultContentVisible), + isAdultContentVisible: UserDefaults.isAdultContentVisible(), contentType: ContentType(rawValue: UserDefaults.string(forKey: .contentPreference)) ?? ContentType.ALL, page: page, size: size @@ -115,7 +115,7 @@ final class ContentRepository { return api.requestPublisher( .getNewContentAllOfTheme( theme: theme, - isAdultContentVisible: UserDefaults.bool(forKey: .isAdultContentVisible), + isAdultContentVisible: UserDefaults.isAdultContentVisible(), contentType: ContentType(rawValue: UserDefaults.string(forKey: .contentPreference)) ?? ContentType.ALL, page: page, size: size diff --git a/SodaLive/Sources/Content/Main/ContentMainView.swift b/SodaLive/Sources/Content/Main/ContentMainView.swift index 0ffb3a6..8d42fac 100644 --- a/SodaLive/Sources/Content/Main/ContentMainView.swift +++ b/SodaLive/Sources/Content/Main/ContentMainView.swift @@ -40,6 +40,28 @@ struct ContentMainView: View { ContentMainRecommendSeriesView() HStack(spacing: 8) { + ZStack { + Image("img_bg_morning_call") + .resizable() + .frame(height: 53.3) + .frame(maxWidth: .infinity) + .cornerRadius(2.6) + + HStack(spacing: 2.7) { + Image("ic_alarm_clock_blue") + + Text("보이스 모닝콜") + .font(.custom(Font.bold.rawValue, size: 16.7)) + .foregroundColor(Color(hex: "0057ff")) + } + .cornerRadius(2.6) + } + .onTapGesture { + AppState.shared.setAppStep( + step: .contentAllByTheme(themeId: 12) + ) + } + ZStack { Image("img_bg_short_play") .resizable() @@ -61,28 +83,6 @@ struct ContentMainView: View { step: .contentAllByTheme(themeId: 11) ) } - - ZStack { - Image("img_bg_review_live") - .resizable() - .frame(height: 53.3) - .frame(maxWidth: .infinity) - .cornerRadius(2.6) - - HStack(spacing: 2.7) { - Image("ic_thumb_play_blue") - - Text("라이브 다시듣기") - .font(.custom(Font.bold.rawValue, size: 16.7)) - .foregroundColor(Color(hex: "0057ff")) - } - .cornerRadius(2.6) - } - .onTapGesture { - AppState.shared.setAppStep( - step: .contentAllByTheme(themeId: 7) - ) - } } .padding(.bottom, 40) .padding(.horizontal, 13.3) diff --git a/SodaLive/Sources/Extensions/UserDefaultsExtension.swift b/SodaLive/Sources/Extensions/UserDefaultsExtension.swift index 6545e6e..1f03f75 100644 --- a/SodaLive/Sources/Extensions/UserDefaultsExtension.swift +++ b/SodaLive/Sources/Extensions/UserDefaultsExtension.swift @@ -68,6 +68,11 @@ extension UserDefaults { return UserDefaults.standard.data(forKey: key) } + static func isAdultContentVisible() -> Bool { + let key = UserDefaultsKey.isAdultContentVisible.rawValue + return UserDefaults.standard.object(forKey: key) != nil ? bool(forKey: .isAdultContentVisible) : true + } + static func reset() { UserDefaultsKey.allCases.forEach { UserDefaults.standard.removeObject(forKey: $0.rawValue) } } diff --git a/SodaLive/Sources/Live/LiveView.swift b/SodaLive/Sources/Live/LiveView.swift index 5bca709..82f5c29 100644 --- a/SodaLive/Sources/Live/LiveView.swift +++ b/SodaLive/Sources/Live/LiveView.swift @@ -26,6 +26,29 @@ struct LiveView: View { .padding(.top, 13.3) } + ZStack { + Image("img_bg_review_live") + .resizable() + .frame(height: 53.3) + .frame(maxWidth: .infinity) + .cornerRadius(2.6) + + HStack(spacing: 2.7) { + Image("ic_thumb_play_purple") + + Text("라이브 다시듣기") + .font(.custom(Font.bold.rawValue, size: 16.7)) + .foregroundColor(Color(hex: "672bff")) + } + .cornerRadius(2.6) + } + .padding(.horizontal, 13.3) + .onTapGesture { + AppState.shared.setAppStep( + step: .contentAllByTheme(themeId: 7) + ) + } + if viewModel.recommendChannelItems.count > 0 { SectionRecommendChannelView( items: viewModel.isFollowingList ? diff --git a/SodaLive/Sources/Live/LiveViewModel.swift b/SodaLive/Sources/Live/LiveViewModel.swift index 843d43f..ffe2d1d 100644 --- a/SodaLive/Sources/Live/LiveViewModel.swift +++ b/SodaLive/Sources/Live/LiveViewModel.swift @@ -99,7 +99,7 @@ final class LiveViewModel: ObservableObject { timezone: TimeZone.current.identifier, dateString: nil, status: .NOW, - isAdultContentVisible: UserDefaults.bool(forKey: .isAdultContentVisible), + isAdultContentVisible: UserDefaults.isAdultContentVisible(), page: 1, size: 10 ) @@ -110,7 +110,7 @@ final class LiveViewModel: ObservableObject { timezone: TimeZone.current.identifier, dateString: nil, status: .RESERVATION, - isAdultContentVisible: UserDefaults.bool(forKey: .isAdultContentVisible), + isAdultContentVisible: UserDefaults.isAdultContentVisible(), page: 1, size: 10 ) @@ -289,7 +289,7 @@ final class LiveViewModel: ObservableObject { timezone: TimeZone.current.identifier, dateString: nil, status: .NOW, - isAdultContentVisible: UserDefaults.bool(forKey: .isAdultContentVisible), + isAdultContentVisible: UserDefaults.isAdultContentVisible(), page: page, size: pageSize ) @@ -347,7 +347,7 @@ final class LiveViewModel: ObservableObject { timezone: TimeZone.current.identifier, dateString: selectedDateString, status: .RESERVATION, - isAdultContentVisible: UserDefaults.bool(forKey: .isAdultContentVisible), + isAdultContentVisible: UserDefaults.isAdultContentVisible(), page: page, size: pageSize ) diff --git a/SodaLive/Sources/Settings/Content/ContentSettingsViewModel.swift b/SodaLive/Sources/Settings/Content/ContentSettingsViewModel.swift index 38888c4..9c11091 100644 --- a/SodaLive/Sources/Settings/Content/ContentSettingsViewModel.swift +++ b/SodaLive/Sources/Settings/Content/ContentSettingsViewModel.swift @@ -8,7 +8,7 @@ import Foundation final class ContentSettingsViewModel: ObservableObject { - @Published var isAdultContentVisible = UserDefaults.bool(forKey: .isAdultContentVisible) { + @Published var isAdultContentVisible = UserDefaults.isAdultContentVisible() { didSet { if oldValue != isAdultContentVisible { UserDefaults.set(isAdultContentVisible, forKey: .isAdultContentVisible)