Skip to content

Commit d366113

Browse files
committed
[refactor]: 최근 생성된 독서 모임방 첫번째, 캐러셀 무한으로 수정 (#138)
1 parent b2f48e5 commit d366113

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

app/src/main/java/com/texthip/thip/ui/group/myroom/component/GroupDeadlineRoomSection.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,11 @@ fun GroupRoomDeadlineSection(
8484
),
8585
)
8686

87+
val actualPageCount = roomSections.size
88+
8789
val effectivePagerState = rememberPagerState(
88-
initialPage = 0,
89-
pageCount = { roomSections.size }
90+
initialPage = 2,
91+
pageCount = { Int.MAX_VALUE }
9092
)
9193

9294
HorizontalPager(
@@ -95,7 +97,8 @@ fun GroupRoomDeadlineSection(
9597
pageSpacing = pageSpacing,
9698
modifier = Modifier.fillMaxWidth()
9799
) { page ->
98-
val (sectionTitle, rooms) = roomSections[page]
100+
val actualPage = page % actualPageCount
101+
val (sectionTitle, rooms) = roomSections[actualPage]
99102

100103
val isCurrent = effectivePagerState.currentPage == page
101104
val scale = if (isCurrent) 1f else 0.94f

0 commit comments

Comments
 (0)