https://kotlinlang.org logo
j

Jan Wilmans

12/30/2022, 11:10 AM
image.png
n

Nilesh Rathod

12/30/2022, 11:16 AM
have you tried to import like this??
import com.google.accompanist.pager.HorizontalPager
j

Jan Wilmans

12/30/2022, 11:17 AM
hey thanks, that seems to work
👍 1
however my UI does NOT agree
image.png
but despite of that it compiles
n

Nilesh Rathod

12/30/2022, 11:17 AM
Copy code
HorizontalPager(
  count = 3,
  state = pagerState,
  modifier = Modifier
    .fillMaxWidth()
    .weight(1f)
) {
  // IntroPageItem()
}
j

Jan Wilmans

12/30/2022, 11:26 AM
image.png
n

Nilesh Rathod

12/30/2022, 11:35 AM
HorizontalPager
is an ExperimentalApi in material 3
Copy code
@OptIn(ExperimentalPagerApi::class)
@Composable
fun FrontPage() {
    NowindCompanionTheme {
        HorizontalPager(count = 3)
        { page ->
            Text(
                text = "Page: $page",
                modifier = Modifier.fillMaxWidth()
            )
        }
    }
}
14 Views