Skip to content

Commit

Permalink
build-error-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
l2hyunwoo committed Jul 21, 2023
1 parent 0b2d0d6 commit 151d245
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -52,9 +53,9 @@ fun ImageContent(
onChangeImage(ImageModel.Local(it))
}
}
val pageCount = remember(imageModel) { imageModel.size }
val pagerState = rememberPagerState { imageModel.size }

HorizontalPager(pageCount) { page ->
HorizontalPager(pagerState) { page ->
Box(
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ private enum class OnBoardingPageUiModel(
fun OnboardingScreen(
navigator: DestinationsNavigator
) {
val pageState = rememberPagerState()
val onboardingPages = OnBoardingPageUiModel.values()
val pageState = rememberPagerState { onboardingPages.size }
SoptTheme {
SoptColumn(
modifier = Modifier
Expand All @@ -93,7 +93,6 @@ fun OnboardingScreen(
)
HorizontalPager(
modifier = Modifier.fillMaxWidth(),
pageCount = onboardingPages.size,
state = pageState
) {
OnboardingPage(
Expand Down
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ truth = "1.1.5"
robolectric = "4.10.3"
androidx-uiautomator = "2.3.0-alpha03"
androidx-test = "1.5.2"
androidx-test-rules = "1.5.0"

gradleplugin = "8.0.2"
kspplugin = "1.9.0-1.0.11"
Expand All @@ -46,7 +47,7 @@ soloader = "0.10.5"
okhttp = "4.11.0"
retrofit = "2.9.0"
timber = "5.0.1"
compose-destination = "1.9.50"
compose-destination = "1.9.42-beta"
mavericks = "3.0.5"
coil = "2.4.0"
lottie = "6.1.0"
Expand Down Expand Up @@ -120,7 +121,7 @@ robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectr

androidx-uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "androidx-uiautomator" }
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test" }
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" }
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidx-test-rules" }

flipper = { module = "com.facebook.flipper:flipper", version.ref = "flipper" }
flipper-noop = { module = "com.facebook.flipper:flipper-noop", version.ref = "flipper" }
Expand Down

0 comments on commit 151d245

Please sign in to comment.