Skip to content

Commit

Permalink
Merge pull request #286 from ooni/result-summary-scroll
Browse files Browse the repository at this point in the history
Make result summary scrollable
  • Loading branch information
sdsantos authored Nov 19, 2024
2 parents 4fdfc1f + 7fa2baf commit 94236d9
Showing 1 changed file with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,23 +121,28 @@ fun ResultScreen(
)

if (state.result == null) return@Column

if (!isHeightCompact()) {
Surface(
color = descriptorColor,
contentColor = onDescriptorColor,
) {
Summary(state.result)
}
}

if (state.result.anyMeasurementMissingUpload) {
UploadResults(onUploadClick = { onEvent(ResultViewModel.Event.UploadClicked) })
}
val showSummary = !isHeightCompact()

LazyColumn(
contentPadding = WindowInsets.navigationBars.asPaddingValues(),
) {
if (showSummary) {
item("summary") {
Surface(
color = descriptorColor,
contentColor = onDescriptorColor,
) {
Summary(state.result)
}
}
}

if (state.result.anyMeasurementMissingUpload) {
stickyHeader("upload_results") {
UploadResults(onUploadClick = { onEvent(ResultViewModel.Event.UploadClicked) })
}
}

items(state.result.measurements, key = { it.measurement.idOrThrow.value }) { item ->
ResultMeasurementCell(
item = item,
Expand Down

0 comments on commit 94236d9

Please sign in to comment.