I'm building a registration page with jetpack compose and I have implemented it in a horizontal pager linked with TabRow to display signup and login page respectively
but when I swipe to the other page (login or signup), the next page will build only after the swipe offset exceeds apporximately 50% of the screen width, and the pervious page will be rendered in the other page as shown in the video below
@OptIn(ExperimentalPagerApi::class)
@Composable
fun RegistrationHorizontalPageView() {
val tabRowState = viewModel<TabRowViewModel>()
HorizontalPager(
count = 2,
state = tabRowState.pagerState,
modifier = Modifier.fillMaxSize(),
verticalAlignment = Alignment.Top
) {
if(currentPage == 0){
RegistrationPage()
}else{
LoginPage()
}
}
}