diff --git a/feature/src/main/java/com/terning/feature/intern/component/InternTitle.kt b/feature/src/main/java/com/terning/feature/intern/component/InternTitle.kt index 0d6a34e7..9fa882d6 100644 --- a/feature/src/main/java/com/terning/feature/intern/component/InternTitle.kt +++ b/feature/src/main/java/com/terning/feature/intern/component/InternTitle.kt @@ -5,7 +5,9 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -38,7 +40,9 @@ fun InternTitle( .background( color = TerningSub3, shape = RoundedCornerShape(size = 5.dp) - ), + ) + .width(70.dp) + .height(25.dp), horizontalArrangement = Arrangement.Center, verticalAlignment = Alignment.CenterVertically ) { @@ -46,10 +50,6 @@ fun InternTitle( text = dDay, style = TerningTheme.typography.title3, color = TerningMain, - modifier = Modifier.padding( - horizontal = 19.5.dp, - vertical = 1.5.dp - ) ) } diff --git a/feature/src/main/java/com/terning/feature/search/search/component/ImageSlider.kt b/feature/src/main/java/com/terning/feature/search/search/component/ImageSlider.kt index 02473941..dac7391d 100644 --- a/feature/src/main/java/com/terning/feature/search/search/component/ImageSlider.kt +++ b/feature/src/main/java/com/terning/feature/search/search/component/ImageSlider.kt @@ -27,7 +27,12 @@ fun ImageSlider( images: List, onAdvertisementClick: () -> Unit, ) { - val pagerState = rememberPagerState(pageCount = { images.size }) + val infiniteImages = remember { images + images + images } + val pagerState = rememberPagerState( + initialPage = images.size, + initialPageOffsetFraction = 0f, + pageCount = { infiniteImages.size } + ) val autoScroll = remember { mutableStateOf(true) } LaunchedEffect(autoScroll.value) { @@ -35,13 +40,21 @@ fun ImageSlider( while (true) { delay(2000) if (!pagerState.isScrollInProgress) { - val nextPage = (pagerState.currentPage + 1) % pagerState.pageCount + val nextPage = pagerState.currentPage + 1 pagerState.animateScrollToPage(nextPage) } } } } + LaunchedEffect(pagerState.currentPage) { + if (pagerState.currentPage < images.size) { + pagerState.scrollToPage(pagerState.currentPage + images.size) + } else if (pagerState.currentPage >= 2 * images.size) { + pagerState.scrollToPage(pagerState.currentPage - images.size) + } + } + Column( modifier .fillMaxWidth() @@ -54,10 +67,11 @@ fun ImageSlider( ) { HorizontalPager( state = pagerState, - modifier = modifier + modifier = modifier, + beyondViewportPageCount = infiniteImages.size ) { currentPage -> Image( - painter = painterResource(id = images[currentPage]), + painter = painterResource(id = infiniteImages[currentPage % images.size]), contentDescription = null, modifier = modifier .fillMaxWidth() @@ -68,8 +82,8 @@ fun ImageSlider( } DotsIndicator( pageCount = images.size, - currentPage = pagerState.currentPage + currentPage = pagerState.currentPage % images.size ) } } -} \ No newline at end of file +} diff --git a/feature/src/main/java/com/terning/feature/search/search/component/SearchIntern.kt b/feature/src/main/java/com/terning/feature/search/search/component/SearchIntern.kt index 3d11ab37..cdc1f897 100644 --- a/feature/src/main/java/com/terning/feature/search/search/component/SearchIntern.kt +++ b/feature/src/main/java/com/terning/feature/search/search/component/SearchIntern.kt @@ -70,7 +70,7 @@ fun SearchIntern( .crossfade(true) .build(), contentDescription = stringResource(id = R.string.search_image), - contentScale = ContentScale.Crop, + contentScale = ContentScale.FillWidth, modifier = Modifier .height(76.dp) .wrapContentSize() diff --git a/feature/src/main/res/values/strings.xml b/feature/src/main/res/values/strings.xml index b555c106..61a377ab 100644 --- a/feature/src/main/res/values/strings.xml +++ b/feature/src/main/res/values/strings.xml @@ -130,7 +130,7 @@ 공유 아이콘 지원 사이트로 이동하기 - 공고 정보 + 공고 상세 정보 %s회 서류 마감 근무 기간