Skip to content

Instantly share code, notes, and snippets.

@aritra-tech
Created May 9, 2024 20:21
Show Gist options
  • Save aritra-tech/d4c43f353e39cc18e29a88e05e257ed6 to your computer and use it in GitHub Desktop.
Save aritra-tech/d4c43f353e39cc18e29a88e05e257ed6 to your computer and use it in GitHub Desktop.
val listState = rememberScalingLazyListState()
val list: List<String> =
listOf("Kotlin", "Jetpack Compose", "Android", "Kotlin Notebook", "KMP", "CMP", "Koin")
Column(Modifier.fillMaxSize()) {
ScalingLazyColumn(
state = listState,
scalingParams = ScalingLazyColumnDefaults.scalingParams(
edgeScale = 0.5f,
minTransitionArea = 0.6f,
maxTransitionArea = 0.7f
)
) {
itemsIndexed(items = list) { index, item ->
Card(
onClick = {},
modifier = Modifier.fillMaxWidth(),
contentColor = Color.Black,
) {
Column(
Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Text(item, textAlign = TextAlign.Center)
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment