Created
June 13, 2021 02:46
-
-
Save hongbeomi/4b67eadabd7b57613a641383e3643811 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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