Repository: android/compose-samples
File: Jetcaster/app/src/main/java/com/example/jetcaster/ui/player/PlayerScreen.kt (Kotlin)

Code before:
            Spacer(modifier = Modifier.height(32.dp))
            PodcastDescription(uiState.title, uiState.podcastName)
            Spacer(modifier = Modifier.height(32.dp))
            Column(
                horizontalAlignment = Alignment.CenterHorizontally,
                modifier = Modifier.weight(10f)
            ) {
                PlayerSlider(uiState.duration)
                PlayerButtons(Modifier.padding(vertical = 8.dp))
            }
            Spacer(modifier = Modifier.weight(1f))
        }
    }
}

@Composable
private fun PlayerContentTableTop(
    uiState: PlayerUiState,
    windowInfo: WindowInfo,
    onBackPress: () -> Unit
) {
    val hingeRect: Rect = windowInfo.hingePosition
        ?: throw IllegalStateException("Bounds should never be null in tabletop mode")

    val hingePosition = with(LocalDensity.current) { hingeRect.top.toDp() }
    val hingeHeight = with(LocalDensity.current) { (hingeRect.bottom - hingeRect.top).toDp() }

    Column(modifier = Modifier.fillMaxSize()) {
        // Content for the top part of the screen
        Column(
            modifier = Modifier
                .height(hingePosition)
                .fillMaxWidth()
                .verticalGradientScrim(
                    color = MaterialTheme.colors.primary.copy(alpha = 0.50f),
                    startYPercentage = 1f,
                    endYPercentage = 0f
                )
                .systemBarsPadding(bottom = false)
                .padding(32.dp),
            horizontalAlignment = Alignment.CenterHorizontally
        ) {
            PlayerImage(uiState.podcastImageUrl)
        }
        // Space for the hinge
        Spacer(modifier = Modifier.height(hingeHeight))
        // Content for the table part of the screen
        Column(
            modifier = Modifier
                .systemBarsPadding(top = false)
                .padding(horizontal = 32.dp, vertical = 8.dp),

Review comment (suggestion):
```suggestion
    val hingeHeight = with(LocalDensity.current) { hingeRect.height().toDp() }
```

Code after:
            PodcastDescription(uiState.title, uiState.podcastName)
            Spacer(modifier = Modifier.height(32.dp))
            Column(
                horizontalAlignment = Alignment.CenterHorizontally,
                modifier = Modifier.weight(10f)
            ) {
                PlayerSlider(uiState.duration)
                PlayerButtons(Modifier.padding(vertical = 8.dp))
            }
            Spacer(modifier = Modifier.weight(1f))
        }
    }
}

@Composable
private fun PlayerContentTableTop(
    uiState: PlayerUiState,
    tableTopPosture: DevicePosture.TableTopPosture,
    onBackPress: () -> Unit
) {
    val hingePosition = with(LocalDensity.current) { tableTopPosture.hingePosition.top.toDp() }
    val hingeHeight = with(LocalDensity.current) { tableTopPosture.hingePosition.height().toDp() }

    Column(modifier = Modifier.fillMaxSize()) {
        // Content for the top part of the screen
        Column(
            modifier = Modifier
                .height(hingePosition)
                .fillMaxWidth()
                .verticalGradientScrim(
                    color = MaterialTheme.colors.primary.copy(alpha = 0.50f),
                    startYPercentage = 1f,
                    endYPercentage = 0f
                )
                .systemBarsPadding(bottom = false)
                .padding(32.dp),
            horizontalAlignment = Alignment.CenterHorizontally
        ) {
            PlayerImage(uiState.podcastImageUrl)
        }
        // Space for the hinge
        Spacer(modifier = Modifier.height(hingeHeight))
        // Content for the table part of the screen
        Column(
            modifier = Modifier
                .systemBarsPadding(top = false)
                .padding(horizontal = 32.dp, vertical = 8.dp),
            horizontalAlignment = Alignment.CenterHorizontally
        ) {
            TopAppBar(onBackPress = onBackPress)
            PodcastDescription(