bohregard
08/25/2021, 4:18 PMandroidx.compose.ui.platform.ComposeView
XML file.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="<http://schemas.android.com/apk/res/android>"
android:id="@+id/user_list_fragment_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:orientation="vertical">
<androidx.compose.ui.platform.ComposeView
android:id="@+id/composeView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
// Composable
Column(
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight()
.background(Color.White)
) {
Row(
modifier = Modifier.fillMaxWidth()
) {
...
}
LazyColumn(
modifier = Modifier.fillMaxWidth(),
state = listState
) {
...
}
}
If I set the height to a manual number, the last item shows. It’s like the Lazy column is being drawn off screen.
This is in a ViewPager fwiwbohregard
08/25/2021, 4:31 PMLazyColumn(
modifier = Modifier
.fillMaxWidth()
.weight(1f),
state = listState
) {
itemsIndexed(
shapes.filter {
"${it.id}".contains(searchQuery) ||
it.name.contains(searchQuery) ||
searchQuery.isEmpty()
}.sortedBy { it.id }
) { index, shape ->
Log.d("TAG", "Index: $index ${shape.id}")
ShapesListItemUi(shape, awarenessViewModel)
if (index != shapes.size - 1) {
Divider(modifier = Modifier.fillMaxWidth(), color = Color.Black)
}
}
item {
Spacer(modifier = Modifier.size(64.dp))
}
}