I have a basic exam in my app which is user should give some answer. After user answered the question than I want to allow swipe to right of horizontal pager. My pager is like down below.
pagerState = rememberPagerState()
HorizontalPager(
modifier = Modifier.fillMaxSize(),
count = questionList.size,
state = pagerState) {
QuestionComponent(questionList[it], onUserAnswered = onUserAnswered) //Full Size Question
}
at the top, user can swipe both direction. But if user didn't answered the question user shouldn't swipe page to right. How can I prevent this?
You can pass only the available questions count to the pager, and increase this value when next question is answered.