package com.dong.maxhap.demos.test

import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

@Composable
internal fun NestedPage1() {
    var showNextPage by remember { mutableStateOf(false) }

    if (showNextPage) {
        NestedPage2()
        return
    }

    Column(
        modifier = Modifier
            .fillMaxSize()
            .padding(16.dp),
        horizontalAlignment = Alignment.CenterHorizontally,
        verticalArrangement = Arrangement.Center
    ) {
        Text(
            text = "第1层页面",
            fontSize = 24.sp,
            fontWeight = FontWeight.Bold,
            color = Color(0xFF10000),
            modifier = Modifier.padding(bottom = 20.dp)
        )
        Text(
            text = "这是第1行内容",
            fontSize = 16.sp,
            color = Color(17, 31, 47),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第2行内容",
            fontSize = 16.sp,
            color = Color(34, 62, 94),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第3行内容",
            fontSize = 16.sp,
            color = Color(51, 93, 141),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第4行内容",
            fontSize = 16.sp,
            color = Color(68, 124, 188),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第5行内容",
            fontSize = 16.sp,
            color = Color(85, 155, 235),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第6行内容",
            fontSize = 16.sp,
            color = Color(102, 186, 26),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第7行内容",
            fontSize = 16.sp,
            color = Color(119, 217, 73),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第8行内容",
            fontSize = 16.sp,
            color = Color(136, 248, 120),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第9行内容",
            fontSize = 16.sp,
            color = Color(153, 23, 167),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第10行内容",
            fontSize = 16.sp,
            color = Color(170, 54, 214),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第11行内容",
            fontSize = 16.sp,
            color = Color(187, 85, 5),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第12行内容",
            fontSize = 16.sp,
            color = Color(204, 116, 52),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第13行内容",
            fontSize = 16.sp,
            color = Color(221, 147, 99),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第14行内容",
            fontSize = 16.sp,
            color = Color(238, 178, 146),
            modifier = Modifier.padding(vertical = 4.dp)
        )
        Text(
            text = "这是第15行内容",
            fontSize = 16.sp,
            color = Color(255, 209, 193),
            modifier = Modifier.padding(vertical = 4.dp)
        )

        Spacer(modifier = Modifier.height(30.dp))

        Button(
            onClick = { showNextPage = true },
            modifier = Modifier
                .fillMaxWidth()
                .height(50.dp),
            colors = ButtonDefaults.buttonColors(
                backgroundColor = Color(0xFF2196F3)
            )
        ) {
            Text(
                text = "进入第2层",
                fontSize = 18.sp,
                fontWeight = FontWeight.Medium,
                color = Color.White
            )
        }
    }
}
