Skip to content

Instantly share code, notes, and snippets.

@hongbeomi
Created Jun 13, 2021
Embed
What would you like to do?
@ExperimentalPagerApi
@Composable
fun MainScreen(onItemSelected: (HouseType) -> Unit) {
val itemList = remember {
listOf(
HouseType.Gryffindor,
HouseType.Slytherin,
HouseType.Ravenclaw,
HouseType.Hufflepuff
)
}
Box(
modifier = Modifier
.background(colorResource(id = R.color.background))
.fillMaxSize()
) {
LoopLottieAnimation(rawId = R.raw.lightning)
Column(Modifier.fillMaxSize()) {
Spacer(modifier = Modifier.height(128.dp))
Image(
painterResource(id = R.drawable.logo),
contentDescription = "",
contentScale = ContentScale.Fit,
modifier = Modifier
.width(288.dp)
.height(120.dp)
.align(Alignment.CenterHorizontally)
)
Spacer(modifier = Modifier.height(24.dp))
MainPager(
list = itemList,
onItemSelected = onItemSelected,
modifier = Modifier
.fillMaxSize()
.padding(horizontal = 16.dp)
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment