콘텐츠 상세 미리듣기 버튼 변경
This commit is contained in:
21
SodaLive/Resources/Assets.xcassets/ic_no_preview.imageset/Contents.json
vendored
Normal file
21
SodaLive/Resources/Assets.xcassets/ic_no_preview.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "ic_no_preview.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
SodaLive/Resources/Assets.xcassets/ic_no_preview.imageset/ic_no_preview.png
vendored
Normal file
BIN
SodaLive/Resources/Assets.xcassets/ic_no_preview.imageset/ic_no_preview.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 677 B |
File diff suppressed because it is too large
Load Diff
@@ -82,13 +82,29 @@ struct ContentDetailPlayView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Image(isPlaying() ? "btn_audio_content_pause" : isAlertPreview ? "btn_audio_content_preview_play" : "btn_audio_content_play")
|
if isPlaying() {
|
||||||
|
Image("btn_audio_content_pause")
|
||||||
.onTapGesture {
|
.onTapGesture {
|
||||||
ContentPlayerPlayManager.shared.resetPlayer()
|
ContentPlayerPlayManager.shared.resetPlayer()
|
||||||
|
|
||||||
if isPlaying() {
|
|
||||||
contentPlayManager.pauseAudio()
|
contentPlayManager.pauseAudio()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if isAlertPreview {
|
||||||
|
HStack(spacing: 4) {
|
||||||
|
Image("ic_noti_play")
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 24, height: 24)
|
||||||
|
|
||||||
|
Text(I18n.ContentDetail.preview)
|
||||||
|
.font(.custom(Font.medium.rawValue, size: 16.7))
|
||||||
|
.foregroundColor(Color.white)
|
||||||
|
}
|
||||||
|
.padding(.vertical, 13.3)
|
||||||
|
.frame(minWidth: 212)
|
||||||
|
.background(Color.black.opacity(0.4))
|
||||||
|
.cornerRadius(46.7)
|
||||||
|
.onTapGesture {
|
||||||
|
ContentPlayerPlayManager.shared.resetPlayer()
|
||||||
contentPlayManager.startTimer = startTimer
|
contentPlayManager.startTimer = startTimer
|
||||||
contentPlayManager.stopTimer = stopTimer
|
contentPlayManager.stopTimer = stopTimer
|
||||||
|
|
||||||
@@ -110,6 +126,31 @@ struct ContentDetailPlayView: View {
|
|||||||
creatorNickname: audioContent.creator.nickname
|
creatorNickname: audioContent.creator.nickname
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Image("btn_audio_content_play")
|
||||||
|
.onTapGesture {
|
||||||
|
ContentPlayerPlayManager.shared.resetPlayer()
|
||||||
|
contentPlayManager.startTimer = startTimer
|
||||||
|
contentPlayManager.stopTimer = stopTimer
|
||||||
|
|
||||||
|
contentPlayManager.playAudio(
|
||||||
|
contentId: audioContent.contentId,
|
||||||
|
title: audioContent.title,
|
||||||
|
nickname: audioContent.creator.nickname,
|
||||||
|
coverImage: audioContent.coverImageUrl,
|
||||||
|
contentUrl: audioContent.contentUrl,
|
||||||
|
isFree: audioContent.price <= 0,
|
||||||
|
isPreview: !audioContent.existOrdered && audioContent.price > 0
|
||||||
|
)
|
||||||
|
|
||||||
|
recentContentViewModel.insertRecentContent(
|
||||||
|
contentId: Int64(audioContent.contentId),
|
||||||
|
coverImageUrl: audioContent.coverImageUrl,
|
||||||
|
title: audioContent.title,
|
||||||
|
creatorNickname: audioContent.creator.nickname
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !isAlertPreview {
|
if !isAlertPreview {
|
||||||
@@ -122,11 +163,18 @@ struct ContentDetailPlayView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if audioContent.releaseDate == nil {
|
} else if audioContent.releaseDate == nil {
|
||||||
Text("해당 콘텐츠는 크리에이터의 요청으로\n미리듣기를 제공하지 않습니다.")
|
HStack(spacing: 4) {
|
||||||
|
Image("ic_no_preview")
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 24, height: 24)
|
||||||
|
|
||||||
|
Text(I18n.ContentDetail.noPreview)
|
||||||
.font(.custom(Font.medium.rawValue, size: 16.7))
|
.font(.custom(Font.medium.rawValue, size: 16.7))
|
||||||
.foregroundColor(Color.grayee)
|
.foregroundColor(Color(hex: "444446"))
|
||||||
.padding(13.3)
|
}
|
||||||
.background(Color.gray33.opacity(0.5))
|
.padding(.vertical, 13.3)
|
||||||
|
.frame(minWidth: 212)
|
||||||
|
.background(Color.white.opacity(0.5))
|
||||||
.cornerRadius(46.7)
|
.cornerRadius(46.7)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,22 @@ enum I18n {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static var preview: String {
|
||||||
|
pick(
|
||||||
|
ko: "미리듣기",
|
||||||
|
en: "Preview",
|
||||||
|
ja: "試聴"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
static var noPreview: String {
|
||||||
|
pick(
|
||||||
|
ko: "미리듣기 미지원",
|
||||||
|
en: "No Preview",
|
||||||
|
ja: "試聴非対応"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
static var pinLimitDesc: String {
|
static var pinLimitDesc: String {
|
||||||
pick(
|
pick(
|
||||||
ko: "이 콘텐츠를 고정하시겠어요? 채널에 콘텐츠를 최대 3개까지 고정할 수 있습니다. 이 콘텐츠를 고정하면 가장 오래된 콘텐츠가 대체됩니다.",
|
ko: "이 콘텐츠를 고정하시겠어요? 채널에 콘텐츠를 최대 3개까지 고정할 수 있습니다. 이 콘텐츠를 고정하면 가장 오래된 콘텐츠가 대체됩니다.",
|
||||||
|
|||||||
Reference in New Issue
Block a user