package com.example.kmptpc_compose_sample.demos.foundation

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp

/**
 * 平台实现：OHOS 上显示当前界面方向（LocalInterfaceOrientation）与系统安全区（LocalSafeArea），
 * 其他平台显示占位。
 */
@Composable
internal expect fun OrientationAndSafeAreaDemoContent()

@Composable
internal fun OrientationAndSafeAreaDemo() {
    Column(
        modifier = Modifier
            .fillMaxSize()
            .verticalScroll(rememberScrollState())
            .padding(16.dp),
        verticalArrangement = Arrangement.spacedBy(16.dp)
    ) {
        Text(
            text = "界面方向与系统栏",
            style = MaterialTheme.typography.h5
        )
        Text(
            text = "显示当前界面方向（竖屏/横屏）与系统安全区 insets（状态栏、刘海等占位），OHOS 平台。",
            style = MaterialTheme.typography.body2,
            color = MaterialTheme.colors.onSurface.copy(alpha = 0.7f)
        )
        OrientationAndSafeAreaDemoContent()
    }
}
