From 15421ca4d51f85976e583a3b7bd1a2c4d313e098 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Fri, 22 Dec 2023 03:34:38 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=ED=83=AD=20?= =?UTF-8?q?=EC=83=88=EB=A1=9C=EA=B3=A0=EC=B9=A8=20=EB=B0=A9=EB=B2=95=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20-=20=EB=8B=B9=EA=B2=A8=EC=84=9C=20?= =?UTF-8?q?=EC=83=88=EB=A1=9C=EA=B3=A0=EC=B9=A8=20->=20=EC=A7=80=EA=B8=88?= =?UTF-8?q?=20=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=EC=A4=91=20=EC=98=86=20?= =?UTF-8?q?=EC=83=88=EB=A1=9C=EA=B3=A0=EC=B9=A8=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ic_refresh.imageset/Contents.json | 21 ++++++++++++++++++ .../ic_refresh.imageset/ic_refresh.png | Bin 0 -> 886 bytes SodaLive/Sources/Live/LiveView.swift | 10 ++++----- SodaLive/Sources/Live/LiveViewModel.swift | 8 +++++++ .../Sources/Live/Now/SectionLiveNowView.swift | 12 +++++++--- .../SectionLiveReservationView.swift | 2 -- 6 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 SodaLive/Resources/Assets.xcassets/ic_refresh.imageset/Contents.json create mode 100644 SodaLive/Resources/Assets.xcassets/ic_refresh.imageset/ic_refresh.png diff --git a/SodaLive/Resources/Assets.xcassets/ic_refresh.imageset/Contents.json b/SodaLive/Resources/Assets.xcassets/ic_refresh.imageset/Contents.json new file mode 100644 index 0000000..5c4a262 --- /dev/null +++ b/SodaLive/Resources/Assets.xcassets/ic_refresh.imageset/Contents.json @@ -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 + } +} diff --git a/SodaLive/Resources/Assets.xcassets/ic_refresh.imageset/ic_refresh.png b/SodaLive/Resources/Assets.xcassets/ic_refresh.imageset/ic_refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..116c9c5eb5e2aefab98b3c42a676811b2004f4cf GIT binary patch literal 886 zcmV-+1Bv{JP)`q{3fjS+b6Oc^MY#?_6XM+5NLf&%_0_4DvM11ev z^OJ=I_Ztp$K-6e78jVI{t}KWd0890uO*pq67mLLMF;iRs>+qGb3uPS*9d~)KcBkxK ziE^O#h;qDBCh>aq`dL&H>x^#5RYKWIWj*rKEBi{^s7i&?kWHYRO!MWxGt#j>@waovmvR!3)I#kdVTe@&$c z31A)cA(640!VIsziU?x@!2i$dVQ@`_fEh--BKQOtalTh}L4|>tWqk1_IzydXp(}tK zab6G;T4;|5$0BX;2mqFff~=@u_(;QeC1St(FalWao$JpuC-8E4+@r!0y*hSbv_j_9 z;L<)+(A>Z<8`IGTA|(jwB!@V;E|Yku#5qghj^@O<3yk+dvf|HoqYKS`15Zp!(gQDRJz#nlX`#}26tq(t4}GG|Idhs6`1la@Y}i8`+WCTmv%xF^_$t=d#rFlB zHuN5cK~s8sjHXHunDQ)E@BK291f( zBmV&jIa1g5q#UmRw$d>XG<%diBC~PI^9x`rjvbBD_jX7>B(+BP#M#m3Tr~k~ zCdU}!K<3R;Ct-fsgiJBmkIQRd7Bg-zJdimuU)147qtR$I8jWZE0m-~3KryIV?*IS* M07*qoM6N<$f_QI{Q2+n{ literal 0 HcmV?d00001 diff --git a/SodaLive/Sources/Live/LiveView.swift b/SodaLive/Sources/Live/LiveView.swift index 0767e95..acbbdfb 100644 --- a/SodaLive/Sources/Live/LiveView.swift +++ b/SodaLive/Sources/Live/LiveView.swift @@ -19,12 +19,7 @@ struct LiveView: View { GeometryReader { geo in ZStack(alignment: .bottomTrailing) { - RefreshableScrollView( - refreshing: $viewModel.isRefresh, - action: { - viewModel.getSummary() - } - ) { + ScrollView(.vertical, showsIndicators: false) { LazyVStack(spacing: 40) { if viewModel.recommendLiveItems.count > 0 { SectionRecommendLiveView(items: viewModel.recommendLiveItems) @@ -47,6 +42,9 @@ struct LiveView: View { }, onTapCreateLive: { AppState.shared.setAppStep(step: .createLive(timeSettingMode: .NOW, onSuccess: onCreateSuccess)) + }, + onClickRefresh: { + viewModel.refreshLiveNow() } ) diff --git a/SodaLive/Sources/Live/LiveViewModel.swift b/SodaLive/Sources/Live/LiveViewModel.swift index 3688c31..6a42667 100644 --- a/SodaLive/Sources/Live/LiveViewModel.swift +++ b/SodaLive/Sources/Live/LiveViewModel.swift @@ -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) { isLoading = true repository.getRoomDetail(roomId: roomId) diff --git a/SodaLive/Sources/Live/Now/SectionLiveNowView.swift b/SodaLive/Sources/Live/Now/SectionLiveNowView.swift index 1937f18..291bb74 100644 --- a/SodaLive/Sources/Live/Now/SectionLiveNowView.swift +++ b/SodaLive/Sources/Live/Now/SectionLiveNowView.swift @@ -13,6 +13,7 @@ struct SectionLiveNowView: View { let onClickParticipant: (Int) -> Void let onTapCreateLive: () -> Void + let onClickRefresh: () -> Void var body: some View { LazyVStack(spacing: 13.3) { @@ -25,6 +26,12 @@ struct SectionLiveNowView: View { .font(.custom(Font.bold.rawValue, size: 18.3)) .foregroundColor(Color(hex: "ff5c49")) + Image("ic_refresh") + .padding(.leading, 10) + .onTapGesture { + onClickRefresh() + } + Spacer() if items.count > 0 { @@ -63,7 +70,6 @@ struct SectionLiveNowView: View { } .padding(.horizontal, 13.3) } - .padding(.top, 28.3) } else { VStack(spacing: 0) { Image("ic_no_item") @@ -81,7 +87,6 @@ struct SectionLiveNowView: View { .frame(width: screenSize().width - 26.7) .background(Color(hex: "13181b")) .cornerRadius(4.7) - .padding(.top, 28.3) } } } @@ -92,7 +97,8 @@ struct SectionLiveNowView_Previews: PreviewProvider { SectionLiveNowView( items: [], onClickParticipant: { _ in }, - onTapCreateLive: {} + onTapCreateLive: {}, + onClickRefresh: {} ) } } diff --git a/SodaLive/Sources/Live/Reservation/SectionLiveReservationView.swift b/SodaLive/Sources/Live/Reservation/SectionLiveReservationView.swift index 90e10ac..3ff06d3 100644 --- a/SodaLive/Sources/Live/Reservation/SectionLiveReservationView.swift +++ b/SodaLive/Sources/Live/Reservation/SectionLiveReservationView.swift @@ -86,7 +86,6 @@ struct SectionLiveReservationView: View { } .padding(.horizontal, 13.3) .frame(width: screenSize().width) - .padding(.top, 13.3) } else { VStack(spacing: 0) { Image("ic_no_item") @@ -104,7 +103,6 @@ struct SectionLiveReservationView: View { .frame(width: screenSize().width - 26.7) .background(Color(hex: "13181b")) .cornerRadius(4.7) - .padding(.top, 28.3) } } }