# ReportDrawnWhen

## Functions summary

|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/activity/compose/ReportDrawnWhen.composable#ReportDrawnWhen(kotlin.Function0)(predicate: () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Adds `https://developer.android.com/reference/kotlin/androidx/activity/compose/package-summary#ReportDrawnWhen(kotlin.Function0)` to the conditions that must be met prior to `https://developer.android.com/reference/android/app/Activity.html#reportFullyDrawn()` being called. |

## Functions

### ReportDrawnWhen

Artifact: [androidx.activity:activity-compose](https://developer.android.com/jetpack/androidx/releases/activity) [View Source](https://cs.android.com/search?q=file:androidx/activity/compose/ReportDrawn.kt+function:ReportDrawnWhen) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/activity#1.7.0)

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

Adds `https://developer.android.com/reference/kotlin/androidx/activity/compose/package-summary#ReportDrawnWhen(kotlin.Function0)` to the conditions that must be met prior to `https://developer.android.com/reference/android/app/Activity.html#reportFullyDrawn()` being called.

The `https://developer.android.com/reference/android/app/Activity.html` used is extracted from the `https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#LocalView()`'s context.

```kotlin
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 }
```