SmartToolFactory / SmartToolFactory/Jetpack-Compose-Tutorials
hi!i want ask your question about your reply in stackoverflow.com
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 3.7k
- Forks
- 420
- PR merge metrics
- No merged PRs in 30d
Description
how-to-put-a-lazyverticalgrid-inside-a-scrollable-column when item count = 500, maybe have some problems in scroll
@Preview(showBackground = true)
@Composable
private fun Test() {
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
) {
Box(modifier = Modifier
.fillMaxWidth()
.height(200.dp)
.background(Color.Red))
Stats(
modifier = Modifier.heightIn(max = 1000.dp),
stats = List(500) { it }
)
Box(modifier = Modifier
.fillMaxWidth()
.height(200.dp)
.background(Color.Yellow))
}
}
@Composable
fun Stats(
modifier: Modifier = Modifier,
stats: List<Int>
) {
LazyVerticalGrid(
modifier = modifier,
columns = GridCells.Fixed(2)
) {
itemsIndexed(stats) { index, item ->
Box(
modifier = Modifier.aspectRatio(1f),
contentAlignment = Alignment.Center
) {
Text("Item $index")
}
}
}
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked Stack Overflow question and the Test and Stats composables in the issue body. Reproduce the example with 500 items and inspect the nested vertical scrolling behavior. Done requires a clearly confirmed scrolling problem, an agreed expected behavior, and a documented resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100