package com.dong.demo013.debug

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

@Composable
internal fun DebugStepOutDemo() {
    Column(
        modifier = Modifier.fillMaxSize().padding(16.dp),
        verticalArrangement = Arrangement.spacedBy(16.dp)
    ) {
        // 测试
        Button(
            onClick = {
                testOutDebug()
            }

        ) {
            Text("触发断点", color = Color.White)
        }
        Text( "调试步骤\n" +
                "测试包含3层方法\n" +
                "第一层：testOverGrandfather\n" +
                "第二层：testOverFather，被testOverGrandfather包含\n" +
                "第三层：testOverKid，被testOverFather包含\n" +
                "    //第一层内部\n" +
                "    fun testOverFather(){ //测试步出断点-结束 \n" +
                "    print(\"测试步出断点-开始\");//测试步出断点-开始\n" +
                "    //第二层内部\n" +
                "        fun testOverKid(){\n" +
                " 。  //第三层内部\n" +
                "        }\n" +
                "    }\n" +
                "}",
            fontSize = 12.sp)

    }

}

/****测试步出****/
fun testOutDebug(){
    testOutGrandfather();
}



/***通用测试方法**/
private fun testOutGrandfather(){
    testOutFather();//测试步出断点-结束

}

fun testOutFather(){
    print("测试步出断点-开始");//测试步出断点-开始
    testOutKid();
}

fun testOutKid(){
    print("进入testOutKid");
    print("离开testOutKid");
}


