라이브 탭 새로고침 방법 변경 - 당겨서 새로고침 -> 지금 라이브 중 옆 새로고침 버튼으로 변경
This commit is contained in:
parent
ceef432695
commit
15421ca4d5
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "ic_refresh.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 886 B |
|
@ -19,12 +19,7 @@ struct LiveView: View {
|
||||||
|
|
||||||
GeometryReader { geo in
|
GeometryReader { geo in
|
||||||
ZStack(alignment: .bottomTrailing) {
|
ZStack(alignment: .bottomTrailing) {
|
||||||
RefreshableScrollView(
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
refreshing: $viewModel.isRefresh,
|
|
||||||
action: {
|
|
||||||
viewModel.getSummary()
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
LazyVStack(spacing: 40) {
|
LazyVStack(spacing: 40) {
|
||||||
if viewModel.recommendLiveItems.count > 0 {
|
if viewModel.recommendLiveItems.count > 0 {
|
||||||
SectionRecommendLiveView(items: viewModel.recommendLiveItems)
|
SectionRecommendLiveView(items: viewModel.recommendLiveItems)
|
||||||
|
@ -47,6 +42,9 @@ struct LiveView: View {
|
||||||
},
|
},
|
||||||
onTapCreateLive: {
|
onTapCreateLive: {
|
||||||
AppState.shared.setAppStep(step: .createLive(timeSettingMode: .NOW, onSuccess: onCreateSuccess))
|
AppState.shared.setAppStep(step: .createLive(timeSettingMode: .NOW, onSuccess: onCreateSuccess))
|
||||||
|
},
|
||||||
|
onClickRefresh: {
|
||||||
|
viewModel.refreshLiveNow()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -457,6 +457,14 @@ final class LiveViewModel: ObservableObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func refreshLiveNow() {
|
||||||
|
page = 1
|
||||||
|
isLast = false
|
||||||
|
|
||||||
|
self.liveNowItems.removeAll()
|
||||||
|
getLiveNowList()
|
||||||
|
}
|
||||||
|
|
||||||
private func getRoomDetail(roomId: Int, onSuccess: @escaping (GetRoomDetailResponse) -> Void) {
|
private func getRoomDetail(roomId: Int, onSuccess: @escaping (GetRoomDetailResponse) -> Void) {
|
||||||
isLoading = true
|
isLoading = true
|
||||||
repository.getRoomDetail(roomId: roomId)
|
repository.getRoomDetail(roomId: roomId)
|
||||||
|
|
|
@ -13,6 +13,7 @@ struct SectionLiveNowView: View {
|
||||||
|
|
||||||
let onClickParticipant: (Int) -> Void
|
let onClickParticipant: (Int) -> Void
|
||||||
let onTapCreateLive: () -> Void
|
let onTapCreateLive: () -> Void
|
||||||
|
let onClickRefresh: () -> Void
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
LazyVStack(spacing: 13.3) {
|
LazyVStack(spacing: 13.3) {
|
||||||
|
@ -25,6 +26,12 @@ struct SectionLiveNowView: View {
|
||||||
.font(.custom(Font.bold.rawValue, size: 18.3))
|
.font(.custom(Font.bold.rawValue, size: 18.3))
|
||||||
.foregroundColor(Color(hex: "ff5c49"))
|
.foregroundColor(Color(hex: "ff5c49"))
|
||||||
|
|
||||||
|
Image("ic_refresh")
|
||||||
|
.padding(.leading, 10)
|
||||||
|
.onTapGesture {
|
||||||
|
onClickRefresh()
|
||||||
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
if items.count > 0 {
|
if items.count > 0 {
|
||||||
|
@ -63,7 +70,6 @@ struct SectionLiveNowView: View {
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 13.3)
|
.padding(.horizontal, 13.3)
|
||||||
}
|
}
|
||||||
.padding(.top, 28.3)
|
|
||||||
} else {
|
} else {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
Image("ic_no_item")
|
Image("ic_no_item")
|
||||||
|
@ -81,7 +87,6 @@ struct SectionLiveNowView: View {
|
||||||
.frame(width: screenSize().width - 26.7)
|
.frame(width: screenSize().width - 26.7)
|
||||||
.background(Color(hex: "13181b"))
|
.background(Color(hex: "13181b"))
|
||||||
.cornerRadius(4.7)
|
.cornerRadius(4.7)
|
||||||
.padding(.top, 28.3)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +97,8 @@ struct SectionLiveNowView_Previews: PreviewProvider {
|
||||||
SectionLiveNowView(
|
SectionLiveNowView(
|
||||||
items: [],
|
items: [],
|
||||||
onClickParticipant: { _ in },
|
onClickParticipant: { _ in },
|
||||||
onTapCreateLive: {}
|
onTapCreateLive: {},
|
||||||
|
onClickRefresh: {}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@ struct SectionLiveReservationView: View {
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 13.3)
|
.padding(.horizontal, 13.3)
|
||||||
.frame(width: screenSize().width)
|
.frame(width: screenSize().width)
|
||||||
.padding(.top, 13.3)
|
|
||||||
} else {
|
} else {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
Image("ic_no_item")
|
Image("ic_no_item")
|
||||||
|
@ -104,7 +103,6 @@ struct SectionLiveReservationView: View {
|
||||||
.frame(width: screenSize().width - 26.7)
|
.frame(width: screenSize().width - 26.7)
|
||||||
.background(Color(hex: "13181b"))
|
.background(Color(hex: "13181b"))
|
||||||
.cornerRadius(4.7)
|
.cornerRadius(4.7)
|
||||||
.padding(.top, 28.3)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue