Skip to content

Commit

Permalink
Add simple test for LazyColumn screen, due to potential issues with C…
Browse files Browse the repository at this point in the history
…ompose 1.6.0
  • Loading branch information
isaac-udy committed Nov 22, 2023
1 parent 54d6a7f commit 896daca
Showing 1 changed file with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package dev.enro.tests.application.compose

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.Card
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import dev.enro.annotations.NavigationDestination
import dev.enro.core.NavigationKey
import kotlinx.parcelize.Parcelize

@Parcelize
object LazyColumn : NavigationKey.SupportsPush

@Composable
@NavigationDestination(LazyColumn::class)
fun LazyColumnScreen() {
LazyColumn(
modifier = Modifier
.fillMaxSize()
.background(MaterialTheme.colors.background)
.padding(16.dp)
) {
item {
Text(
text = "Lazy Column",
style = MaterialTheme.typography.h6
)
}
items(1000) { number ->
Card(
modifier = Modifier.fillMaxWidth().padding(vertical = 2.dp)
) {
Text(
text = "$number",
modifier = Modifier.padding(horizontal = 4.dp, vertical = 8.dp)
)
}
}
}
}

0 comments on commit 896daca

Please sign in to comment.