feat: 하단 탭 아이콘 변경

This commit is contained in:
Yu Sung
2025-07-10 19:18:50 +09:00
parent da3ca96960
commit fca5425e81
27 changed files with 248 additions and 66 deletions

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_chat.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_chat_selected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_home.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_home_selected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_live.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_live_selected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_my.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_my_selected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_subscribe.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_subscribe_selected.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "img_text_logo.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -285,16 +285,10 @@ extension AppDelegate : UNUserNotificationCenterDelegate {
AppState.shared.pushMessageId = messageId AppState.shared.pushMessageId = messageId
} }
if let auditionIdString = auditionIdString, let auditionId = Int(auditionIdString), auditionId > 0 {
AppState.shared.startTab = .audition
NotificationCenter.default.post(name: .didReceiveHomeTab, object: HomeViewModel.CurrentTab.audition)
}
completionHandler() completionHandler()
} }
} }
extension Notification.Name { extension Notification.Name {
static let pointGranted = Notification.Name("POINT_GRANTED") static let pointGranted = Notification.Name("POINT_GRANTED")
static let didReceiveHomeTab = Notification.Name("didReceiveHomeTab")
} }

View File

@@ -44,7 +44,7 @@ class AppState: ObservableObject {
@Published var purchasedContentOrderType = OrderType.KEEP @Published var purchasedContentOrderType = OrderType.KEEP
@Published var isChangeAdultContentVisible = false @Published var isChangeAdultContentVisible = false
@Published var startTab: HomeViewModel.CurrentTab = .content @Published var startTab: HomeViewModel.CurrentTab = .home
@Published var marketingUtmSource = "" @Published var marketingUtmSource = ""
@Published var marketingUtmMedium = "" @Published var marketingUtmMedium = ""

View File

@@ -13,27 +13,27 @@ struct BottomTabView: View {
var body: some View { var body: some View {
HStack(spacing: 0) { HStack(spacing: 0) {
let tabWidth = width / 4 let tabWidth = width / 3
TabButton( TabButton(
title: "콘텐츠", title: "",
action: { action: {
if currentTab != .content { if currentTab != .home {
currentTab = .content currentTab = .home
} }
}, },
image: { image: {
currentTab == .content ? currentTab == .home ?
"ic_tabbar_content_selected" : "ic_home_selected" :
"ic_tabbar_content_normal" "ic_home"
}, },
fontName: { fontName: {
currentTab == .content ? currentTab == .home ?
Font.bold.rawValue : Font.bold.rawValue :
Font.medium.rawValue Font.medium.rawValue
}, },
color: { color: {
currentTab == .content ? currentTab == .home ?
Color.button : Color.button :
Color.graybb Color.graybb
}, },
@@ -49,8 +49,8 @@ struct BottomTabView: View {
}, },
image: { image: {
currentTab == .live ? currentTab == .live ?
"ic_tabbar_live_selected" : "ic_live_selected" :
"ic_tabbar_live_normal" "ic_live"
}, },
fontName: { fontName: {
currentTab == .live ? currentTab == .live ?
@@ -65,31 +65,6 @@ struct BottomTabView: View {
width: tabWidth width: tabWidth
) )
TabButton(
title: "오디션",
action: {
if currentTab != .audition {
currentTab = .audition
}
},
image: {
currentTab == .audition ?
"ic_tabbar_audition_selected" :
"ic_tabbar_audition_normal"
},
fontName: {
currentTab == .audition ?
Font.bold.rawValue :
Font.medium.rawValue
},
color: {
currentTab == .audition ?
Color.button :
Color.graybb
},
width: tabWidth
)
TabButton( TabButton(
title: "마이", title: "마이",
action: { action: {
@@ -99,8 +74,8 @@ struct BottomTabView: View {
}, },
image: { image: {
currentTab == .mypage ? currentTab == .mypage ?
"ic_tabbar_my_selected" : "ic_my_selected" :
"ic_tabbar_my_normal" "ic_my"
}, },
fontName: { fontName: {
currentTab == .mypage ? currentTab == .mypage ?

View File

@@ -18,7 +18,6 @@ struct HomeView: View {
@StateObject var contentPlayerPlayManager = ContentPlayerPlayManager.shared @StateObject var contentPlayerPlayManager = ContentPlayerPlayManager.shared
private let liveView = LiveView() private let liveView = LiveView()
private let audition = AuditionView()
private let contentView = ContentMainTabHomeView() private let contentView = ContentMainTabHomeView()
@State private var isShowPlayer = false @State private var isShowPlayer = false
@@ -30,17 +29,13 @@ struct HomeView: View {
VStack(spacing: 0) { VStack(spacing: 0) {
ZStack { ZStack {
contentView contentView
.frame(width: viewModel.currentTab == .content ? proxy.size.width : 0) .frame(width: viewModel.currentTab == .home ? proxy.size.width : 0)
.opacity(viewModel.currentTab == .content ? 1.0 : 0.01) .opacity(viewModel.currentTab == .home ? 1.0 : 0.01)
liveView liveView
.frame(width: viewModel.currentTab == .live ? proxy.size.width : 0) .frame(width: viewModel.currentTab == .live ? proxy.size.width : 0)
.opacity(viewModel.currentTab == .live ? 1.0 : 0.01) .opacity(viewModel.currentTab == .live ? 1.0 : 0.01)
audition
.frame(width: viewModel.currentTab == .audition ? proxy.size.width : 0)
.opacity(viewModel.currentTab == .audition ? 1.0 : 0.01)
if viewModel.currentTab == .mypage { if viewModel.currentTab == .mypage {
MyPageView() MyPageView()
} }

View File

@@ -18,24 +18,11 @@ final class HomeViewModel: ObservableObject {
private let playbackTrackingRepository = PlaybackTrackingRepository() private let playbackTrackingRepository = PlaybackTrackingRepository()
enum CurrentTab: String { enum CurrentTab: String {
case content, live, audition, mypage case home, live, mypage
} }
@Published var currentTab: CurrentTab = AppState.shared.startTab @Published var currentTab: CurrentTab = AppState.shared.startTab
init() {
NotificationCenter.default
.publisher(for: .didReceiveHomeTab)
.compactMap {
$0.object as? CurrentTab
}
.sink { [weak self] currentTab in
AppState.shared.setAppStep(step: .main)
self?.currentTab = currentTab
}
.store(in: &subscription)
}
func pushTokenUpdate(pushToken: String) { func pushTokenUpdate(pushToken: String) {
userRepository.updatePushToken(pushToken: pushToken) userRepository.updatePushToken(pushToken: pushToken)
.sink { result in .sink { result in