ReportDrawnWhen

Functions summary

Unit

Adds predicate to the conditions that must be met prior to Activity.reportFullyDrawn being called.

Functions

ReportDrawnWhen

@Composable
fun ReportDrawnWhen(predicate: () -> Boolean): Unit

Adds predicate to the conditions that must be met prior to Activity.reportFullyDrawn being called.

The Activity used is extracted from the LocalView's context.

import androidx.activity.compose.ReportDrawn
import androidx.activity.compose.ReportDrawnWhen
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.Text
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier

var contentComposed by remember { mutableStateOf(false) }
LazyColumn(modifier = Modifier.fillMaxSize()) {
    items(100) {
        contentComposed = true
        Text("Hello World $it")
    }
}
ReportDrawnWhen { contentComposed }