Commit 8e022c00 authored by yccy's avatar yccy

218M

parent a9eab579
......@@ -78,7 +78,7 @@ kotlin {
ohosArm64 {
binaries.sharedLib {
baseName = "kn" // 共享库名称为kn
freeCompilerArgs += listOf("-Xbinary=sanitizer=address")
// freeCompilerArgs += listOf("-Xbinary=sanitizer=address")
export(libs.compose.multiplatform.export) // 导出compose多平台库的接口
}
compilations.named("main") {
......
......@@ -29,6 +29,7 @@ internal fun App() {
}
}
Column(
modifier = Modifier
.safeContentPadding()
......
......@@ -21,6 +21,7 @@ import com.dong.maxhap.demos.ui.UiBoxDemo
import com.dong.maxhap.demos.benchmark.*
import com.dong.maxhap.demos.foundation.FoundationBasicTextDemo
import com.dong.maxhap.demos.foundation.FoundationLazyColumnDemo
import com.dong.maxhap.demos.test.HapPage
@Composable
internal fun HomeScreen(
......@@ -92,7 +93,7 @@ internal fun HomeScreen(
style = MaterialTheme.typography.h6
)
val countText =
if (searchQuery.isNotBlank()) "匹配:${demos.size}" else "共 ${demos.size} 项"
if (searchQuery.isNotBlank()) "匹配:" + demos.size else "共 " + demos.size + " 项"
Text(countText, style = MaterialTheme.typography.caption)
}
Text(
......@@ -146,6 +147,7 @@ internal fun DemoScreen(demo: ComponentDemo, onBack: () -> Unit) {
when (demo.id) {
// ui
"ui_box" -> UiBoxDemo()
"ui_hap" -> HapPage()
// foundation
"foundation_basic_text" -> FoundationBasicTextDemo()
"foundation_lazy_column" -> FoundationLazyColumnDemo()
......@@ -184,6 +186,8 @@ internal fun DemoScreen(demo: ComponentDemo, onBack: () -> Unit) {
"material_text_field_samples" -> TextFieldSamples()
"material_text_samples" -> TextSamples()
"material_theme_samples" -> ThemeSamples()
// test
"test_large_hap" -> HapPage()
else -> {
if (demo.group == com.dong.maxhap.navigation.ComposeGroup.Platform) {
com.dong.maxhap.PlatformDemo(demo.id)
......
package com.dong.maxhap.demos
// 预生成的大型数据结构1
private val PREGENERATED_LARGE_DATA_1 = generateMassiveData1()
// 大型数据类1 - 用于增加应用体积
data class LargeDataClass1(
val id: Long,
val name: String,
val description: String,
val dataArray: List<String>,
val nestedData: NestedData1
)
data class NestedData1(
val value1: String,
val value2: String,
val value3: String,
val value4: String,
val value5: String
)
// 生成适量数据实例(减少约20%)
fun generateMassiveData1(): List<LargeDataClass1> {
val result = mutableListOf<LargeDataClass1>()
for (i in 0 until 20000) { // 从25000减少到20000,减少5000个对象
result.add(
LargeDataClass1(
id = i.toLong(),
name = "数据对象_" + i,
description = "这是第 " + i + " 个大型数据对象,包含大量文本内容用于增加应用体积。这个描述字段特意设计得很长,以确保占用更多空间。还包括各种特殊字符和数字组合。",
dataArray = listOf(
"数组元素1_数据" + i,
"数组元素2_数据" + i,
"数组元素3_数据" + i,
"数组元素4_数据" + i,
"数组元素5_数据" + i
),
nestedData = NestedData1(
value1 = "嵌套值1_" + i,
value2 = "嵌套值2_" + i,
value3 = "嵌套值3_" + i,
value4 = "嵌套值4_" + i,
value5 = "嵌套值5_" + i
)
)
)
}
return result
}
// 提供访问预生成数据的函数
fun getPreGeneratedData1(): List<LargeDataClass1> = PREGENERATED_LARGE_DATA_1
\ No newline at end of file
package com.dong.maxhap.demos
// 预生成的大型数据结构2
private val PREGENERATED_LARGE_DATA_2 = generateMassiveData2()
// 大型数据类2 - 用于增加应用体积
data class LargeDataClass2(
val identifier: String,
val title: String,
val content: String,
val metadata: Map<String, String>,
val children: List<ChildData2>
)
data class ChildData2(
val childId: Int,
val childName: String,
val childDescription: String
)
// 生成适量数据实例(减少约20%)
fun generateMassiveData2(): List<LargeDataClass2> {
val result = mutableListOf<LargeDataClass2>()
for (i in 0 until 32000) { // 从40000减少到32000,减少8000个对象
val metadata = mutableMapOf<String, String>()
for (j in 0 until 15) {
metadata["meta_" + j] = "元数据_" + i + "_" + j
}
val children = mutableListOf<ChildData2>()
for (k in 0 until 3) {
children.add(
ChildData2(
childId = k,
childName = "子对象_" + i + "_" + k,
childDescription = "描述信息_" + i + "_" + k
)
)
}
result.add(
LargeDataClass2(
identifier = "OBJ_" + i,
title = "对象标题_" + i,
content = "内容数据_" + i + "_大量文本内容用于增加体积",
metadata = metadata,
children = children
)
)
}
return result
}
// 提供访问预生成数据的函数
fun getPreGeneratedData2(): List<LargeDataClass2> = PREGENERATED_LARGE_DATA_2
\ No newline at end of file
package com.dong.maxhap.demos
// 预生成的大型数据结构3
private val PREGENERATED_LARGE_DATA_3 = generateMassiveData3()
// 大型数据类3
data class LargeDataClass3(
val uuid: String,
val label: String,
val details: String,
val attributes: List<String>,
val subItems: List<SubItem3>
)
data class SubItem3(
val subId: Long,
val subLabel: String,
val subDetails: String
)
// 生成适量数据实例(减少约20%)
fun generateMassiveData3(): List<LargeDataClass3> {
val result = mutableListOf<LargeDataClass3>()
for (i in 0 until 28000) { // 从35000减少到28000,减少7000个对象
val attributes = listOf("属性1_" + i, "属性2_" + i, "属性3_" + i, "属性4_" + i)
val subItems = mutableListOf<SubItem3>()
for (j in 0 until 4) {
subItems.add(
SubItem3(
subId = j.toLong(),
subLabel = "子项标签_" + i + "_" + j,
subDetails = "子项详情_" + i + "_" + j
)
)
}
result.add(
LargeDataClass3(
uuid = "UUID_" + i,
label = "标签_" + i,
details = "详细信息_" + i + "_用于增加应用体积的大量数据",
attributes = attributes,
subItems = subItems
)
)
}
return result
}
// 提供访问预生成数据的函数
fun getPreGeneratedData3(): List<LargeDataClass3> = PREGENERATED_LARGE_DATA_3
\ No newline at end of file
package com.dong.maxhap.demos
// 大型数据类4
data class LargeDataClass4(
val recordId: String,
val recordName: String,
val recordDescription: String,
val recordMetadata: Map<String, String>,
val recordItems: List<RecordItem4>
)
data class RecordItem4(
val itemId: Long,
val itemName: String,
val itemDescription: String
)
fun generateMassiveData4(): List<LargeDataClass4> {
val result = mutableListOf<LargeDataClass4>()
for (i in 0 until 25000) {
val metadata = mutableMapOf<String, String>()
for (j in 0 until 20) {
metadata["meta_" + j] = "元数据_" + i + "_" + j
}
val items = mutableListOf<RecordItem4>()
for (k in 0 until 6) {
items.add(
RecordItem4(
itemId = (i * 100 + k).toLong(),
itemName = "项目_" + i + "_" + k,
itemDescription = "项目描述_" + i + "_" + k
)
)
}
result.add(
LargeDataClass4(
recordId = "REC_" + i,
recordName = "记录_" + i,
recordDescription = "记录描述_" + i + "_大量文本内容",
recordMetadata = metadata,
recordItems = items
)
)
}
return result
}
\ No newline at end of file
package com.dong.maxhap.demos
// 大型数据类5
data class LargeDataClass5(
val entityId: String,
val entityName: String,
val entityDetails: String,
val entityAttributes: List<String>,
val entityComponents: List<EntityComponent5>
)
data class EntityComponent5(
val componentId: Int,
val componentName: String,
val componentData: String
)
fun generateMassiveData5(): List<LargeDataClass5> {
val result = mutableListOf<LargeDataClass5>()
for (i in 0 until 20000) {
val attributes = listOf("属性A_" + i, "属性B_" + i, "属性C_" + i, "属性D_" + i, "属性E_" + i)
val components = mutableListOf<EntityComponent5>()
for (j in 0 until 7) {
components.add(
EntityComponent5(
componentId = j,
componentName = "组件_" + i + "_" + j,
componentData = "组件数据_" + i + "_" + j
)
)
}
result.add(
LargeDataClass5(
entityId = "ENTITY_" + i,
entityName = "实体_" + i,
entityDetails = "实体详情_" + i + "_用于增加体积的文本内容",
entityAttributes = attributes,
entityComponents = components
)
)
}
return result
}
\ No newline at end of file
package com.dong.maxhap.demos
// 大型数据类6
data class LargeDataClass6(
val objectId: String,
val objectTitle: String,
val objectContent: String,
val objectTags: List<String>,
val objectSections: List<ObjectSection6>
)
data class ObjectSection6(
val sectionId: Long,
val sectionTitle: String,
val sectionText: String
)
fun generateMassiveData6(): List<LargeDataClass6> {
val result = mutableListOf<LargeDataClass6>()
for (i in 0 until 18000) {
val tags = listOf("标签1_" + i, "标签2_" + i, "标签3_" + i)
val sections = mutableListOf<ObjectSection6>()
for (j in 0 until 5) {
sections.add(
ObjectSection6(
sectionId = j.toLong(),
sectionTitle = "章节_" + i + "_" + j,
sectionText = "章节内容_" + i + "_" + j
)
)
}
result.add(
LargeDataClass6(
objectId = "OBJ_" + i,
objectTitle = "对象_" + i,
objectContent = "对象内容_" + i + "_大量文本数据",
objectTags = tags,
objectSections = sections
)
)
}
return result
}
\ No newline at end of file
package com.dong.maxhap.demos
// 大型数据类7
data class LargeDataClass7(
val itemId: String,
val itemLabel: String,
val itemInfo: String,
val itemProperties: Map<String, String>,
val itemChildren: List<ItemChild7>
)
data class ItemChild7(
val childIndex: Int,
val childLabel: String,
val childInfo: String
)
fun generateMassiveData7(): List<LargeDataClass7> {
val result = mutableListOf<LargeDataClass7>()
for (i in 0 until 15000) {
val properties = mutableMapOf<String, String>()
for (j in 0 until 15) {
properties["prop_" + j] = "属性值_" + i + "_" + j
}
val children = mutableListOf<ItemChild7>()
for (k in 0 until 4) {
children.add(
ItemChild7(
childIndex = k,
childLabel = "子项_" + i + "_" + k,
childInfo = "子项信息_" + i + "_" + k
)
)
}
result.add(
LargeDataClass7(
itemId = "ITEM_" + i,
itemLabel = "项目_" + i,
itemInfo = "项目信息_" + i + "_体积增加数据",
itemProperties = properties,
itemChildren = children
)
)
}
return result
}
\ No newline at end of file
package com.dong.maxhap.demos
// 大型数据类8
data class LargeDataClass8(
val nodeId: String,
val nodeTitle: String,
val nodeDescription: String,
val nodeMetadata: List<String>,
val nodeConnections: List<NodeConnection8>
)
data class NodeConnection8(
val connectionId: Long,
val connectionType: String,
val connectionData: String
)
fun generateMassiveData8(): List<LargeDataClass8> {
val result = mutableListOf<LargeDataClass8>()
for (i in 0 until 12000) {
val metadata = listOf("元数据A_" + i, "元数据B_" + i, "元数据C_" + i)
val connections = mutableListOf<NodeConnection8>()
for (j in 0 until 3) {
connections.add(
NodeConnection8(
connectionId = j.toLong(),
connectionType = "连接类型_" + i + "_" + j,
connectionData = "连接数据_" + i + "_" + j
)
)
}
result.add(
LargeDataClass8(
nodeId = "NODE_" + i,
nodeTitle = "节点_" + i,
nodeDescription = "节点描述_" + i + "_用于增加应用体积",
nodeMetadata = metadata,
nodeConnections = connections
)
)
}
return result
}
\ No newline at end of file
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.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
// 预生成的大型数据结构,在编译时就包含在应用中
private val PREGENERATED_DATA = generateLargeDataSet()
@Composable
internal fun HapPage() {
var currentIndex by remember { mutableStateOf(0) }
var displayData by remember { mutableStateOf(PREGENERATED_DATA.take(500)) } // 显示前500个避免UI卡顿
LaunchedEffect(Unit) {
// 模拟数据浏览
while (true) {
kotlinx.coroutines.delay(1000)
currentIndex = (currentIndex + 1) % displayData.size
}
}
Column(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Text(
text = "大体积应用包演示",
fontSize = 24.sp,
fontWeight = FontWeight.Bold,
modifier = Modifier.padding(bottom = 20.dp)
)
Card(
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 16.dp),
elevation = 4.dp
) {
Column(modifier = Modifier.padding(16.dp)) {
Text("应用体积: 约250MB (编译时确定,已减少50MB)")
Text("数据总量: " + PREGENERATED_DATA.size + " 条记录")
Text("当前显示: 第 " + (currentIndex + 1) + " 条")
Text("显示范围: 前500条")
}
}
LinearProgressIndicator(
progress = 1.0f, // 固定显示100%
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 16.dp)
.height(8.dp)
)
Text(
text = "✅ 应用体积已达到250MB目标!",
fontSize = 16.sp,
fontWeight = FontWeight.Medium
)
Spacer(modifier = Modifier.height(20.dp))
// 显示当前数据样本
Card(
modifier = Modifier.fillMaxWidth(),
backgroundColor = MaterialTheme.colors.surface
) {
Column(modifier = Modifier.padding(12.dp)) {
Text("当前数据样本:", fontWeight = FontWeight.Bold)
Text(displayData.getOrNull(currentIndex) ?: "无数据")
}
}
}
}
// 在编译时生成适量数据(减少50MB,约125,000条记录)
private fun generateLargeDataSet(): List<String> {
val dataList = mutableListOf<String>()
// 生成约125MB的数据(从150MB减少到125MB)
// 每个字符串约1KB,总共需要约125,000个字符串
for (i in 0 until 125000) {
dataList.add(generateLargeString(i))
}
return dataList
}
private fun generateLargeString(index: Int): String {
val baseContent = "数据块_" + index + ": 用于增加应用编译时体积的大量文本内容。" +
"每个数据块都包含唯一标识符和序号信息,通过这种方式可以有效地增加APK/HAP文件的大小。" +
"这对于测试大体积应用的安装和运行性能很有帮助。内容填充: "
// 添加额外的填充内容使每个字符串更大
val padding = "X".repeat(1800) // 1800个字符的填充
return baseContent + padding + " [ID:" + index + "]"
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ data class ComponentDemo(
val componentDemos: List<ComponentDemo> = listOf(
// ui
ComponentDemo("ui_hap", "Hap测试(点击后等待需要5s)", ComposeGroup.Ui),
ComponentDemo("ui_box", "Box", ComposeGroup.Ui),
// foundation
ComponentDemo("foundation_basic_text", "BasicText", ComposeGroup.Foundation),
......@@ -51,13 +52,14 @@ val componentDemos: List<ComponentDemo> = listOf(
// benchmark
ComponentDemo("benchmark_1500_text", "1500 Text", ComposeGroup.Benchmark),
ComponentDemo("benchmark_1500_view", "1500 View", ComposeGroup.Benchmark),
)
val groupTitles: Map<ComposeGroup, String> = mapOf(
ComposeGroup.Ui to "compose.ui",
ComposeGroup.Foundation to "compose.foundation",
ComposeGroup.Material to "compose.material",
ComposeGroup.Platform to "Platform",
ComposeGroup.Platform to "Platform"
)
fun demosByGroup(): Map<ComposeGroup, List<ComponentDemo>> {
......
{
"app": {
"bundleName": "com.dong.test.maxHap",
"bundleName": "com.example.harmonyApp",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
......
......@@ -5,13 +5,13 @@
"name": "default",
"type": "HarmonyOS",
"material": {
"certpath": "/Users/dongsq/.ohos/config/default_harmonyApp_Iss6l2YAdFdNdabd191QqrcH4ux6aOR0q2cTqAdWOQE=.cer",
"certpath": "/Users/dongsq/.ohos/config/default_harmonyApp_1smLWfyPbDJ7_pD4O8WoXlm4q2fXfOBblaHaifpxJLc=.cer",
"keyAlias": "debugKey",
"keyPassword": "0000001B456F709097A780C7399440F0C9E16148E64D3D1E30C152EA4CD08209F289889D99CC7C5558EF48",
"profile": "/Users/dongsq/.ohos/config/default_harmonyApp_Iss6l2YAdFdNdabd191QqrcH4ux6aOR0q2cTqAdWOQE=.p7b",
"keyPassword": "0000001A1C16A6F1A54A452E6790A65F3DB1C7FD3322F45964DF1CF98F556D133408497516E6365B75C4",
"profile": "/Users/dongsq/.ohos/config/default_harmonyApp_1smLWfyPbDJ7_pD4O8WoXlm4q2fXfOBblaHaifpxJLc=.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "/Users/dongsq/.ohos/config/default_harmonyApp_Iss6l2YAdFdNdabd191QqrcH4ux6aOR0q2cTqAdWOQE=.p12",
"storePassword": "0000001BA8FDCEAF350F9A71DEE2F2B456D3636E581C1A90E2BD83ECC63F5B6530ACA7501137A39F30E854"
"storeFile": "/Users/dongsq/.ohos/config/default_harmonyApp_1smLWfyPbDJ7_pD4O8WoXlm4q2fXfOBblaHaifpxJLc=.p12",
"storePassword": "0000001AF01134AC8226D0D9D7D38E0651C89DA4E84B40A74EEC485CF602D1AF1FAECD976A1110EF47BF"
}
}
],
......
......@@ -69,9 +69,60 @@ typedef struct {
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_kotlin_collections_List;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_LargeDataClass1;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_NestedData1;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_kotlin_Any;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_LargeDataClass2;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_kotlin_collections_Map;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_ChildData2;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_LargeDataClass3;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_SubItem3;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_LargeDataClass4;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_RecordItem4;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_LargeDataClass5;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_EntityComponent5;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_LargeDataClass6;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_ObjectSection6;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_LargeDataClass7;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_ItemChild7;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_LargeDataClass8;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_demos_NodeConnection8;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_navigation_ComposeGroup;
......@@ -93,9 +144,6 @@ typedef struct {
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_navigation_ComponentDemo;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_kotlin_Any;
typedef struct {
libkn_KNativePtr pinned;
} libkn_kref_com_dong_maxhap_navigation_Page;
......@@ -183,6 +231,407 @@ typedef struct {
struct {
struct {
struct {
struct {
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_LargeDataClass1 (*LargeDataClass1)(libkn_KLong id, const char* name, const char* description, libkn_kref_kotlin_collections_List dataArray, libkn_kref_com_dong_maxhap_demos_NestedData1 nestedData);
libkn_kref_kotlin_collections_List (*get_dataArray)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
const char* (*get_description)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
libkn_KLong (*get_id)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
const char* (*get_name)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
libkn_kref_com_dong_maxhap_demos_NestedData1 (*get_nestedData)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
libkn_KLong (*component1)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
libkn_kref_kotlin_collections_List (*component4)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
libkn_kref_com_dong_maxhap_demos_NestedData1 (*component5)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
libkn_kref_com_dong_maxhap_demos_LargeDataClass1 (*copy)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz, libkn_KLong id, const char* name, const char* description, libkn_kref_kotlin_collections_List dataArray, libkn_kref_com_dong_maxhap_demos_NestedData1 nestedData);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_LargeDataClass1 thiz);
} LargeDataClass1;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_NestedData1 (*NestedData1)(const char* value1, const char* value2, const char* value3, const char* value4, const char* value5);
const char* (*get_value1)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
const char* (*get_value2)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
const char* (*get_value3)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
const char* (*get_value4)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
const char* (*get_value5)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
const char* (*component1)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
const char* (*component4)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
const char* (*component5)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
libkn_kref_com_dong_maxhap_demos_NestedData1 (*copy)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz, const char* value1, const char* value2, const char* value3, const char* value4, const char* value5);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_NestedData1 thiz);
} NestedData1;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_LargeDataClass2 (*LargeDataClass2)(const char* identifier, const char* title, const char* content, libkn_kref_kotlin_collections_Map metadata, libkn_kref_kotlin_collections_List children);
libkn_kref_kotlin_collections_List (*get_children)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
const char* (*get_content)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
const char* (*get_identifier)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
libkn_kref_kotlin_collections_Map (*get_metadata)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
const char* (*get_title)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
const char* (*component1)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
libkn_kref_kotlin_collections_Map (*component4)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
libkn_kref_kotlin_collections_List (*component5)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
libkn_kref_com_dong_maxhap_demos_LargeDataClass2 (*copy)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz, const char* identifier, const char* title, const char* content, libkn_kref_kotlin_collections_Map metadata, libkn_kref_kotlin_collections_List children);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_LargeDataClass2 thiz);
} LargeDataClass2;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_ChildData2 (*ChildData2)(libkn_KInt childId, const char* childName, const char* childDescription);
const char* (*get_childDescription)(libkn_kref_com_dong_maxhap_demos_ChildData2 thiz);
libkn_KInt (*get_childId)(libkn_kref_com_dong_maxhap_demos_ChildData2 thiz);
const char* (*get_childName)(libkn_kref_com_dong_maxhap_demos_ChildData2 thiz);
libkn_KInt (*component1)(libkn_kref_com_dong_maxhap_demos_ChildData2 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_ChildData2 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_ChildData2 thiz);
libkn_kref_com_dong_maxhap_demos_ChildData2 (*copy)(libkn_kref_com_dong_maxhap_demos_ChildData2 thiz, libkn_KInt childId, const char* childName, const char* childDescription);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_ChildData2 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_ChildData2 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_ChildData2 thiz);
} ChildData2;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_LargeDataClass3 (*LargeDataClass3)(const char* uuid, const char* label, const char* details, libkn_kref_kotlin_collections_List attributes, libkn_kref_kotlin_collections_List subItems);
libkn_kref_kotlin_collections_List (*get_attributes)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
const char* (*get_details)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
const char* (*get_label)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
libkn_kref_kotlin_collections_List (*get_subItems)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
const char* (*get_uuid)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
const char* (*component1)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
libkn_kref_kotlin_collections_List (*component4)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
libkn_kref_kotlin_collections_List (*component5)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
libkn_kref_com_dong_maxhap_demos_LargeDataClass3 (*copy)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz, const char* uuid, const char* label, const char* details, libkn_kref_kotlin_collections_List attributes, libkn_kref_kotlin_collections_List subItems);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_LargeDataClass3 thiz);
} LargeDataClass3;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_SubItem3 (*SubItem3)(libkn_KLong subId, const char* subLabel, const char* subDetails);
const char* (*get_subDetails)(libkn_kref_com_dong_maxhap_demos_SubItem3 thiz);
libkn_KLong (*get_subId)(libkn_kref_com_dong_maxhap_demos_SubItem3 thiz);
const char* (*get_subLabel)(libkn_kref_com_dong_maxhap_demos_SubItem3 thiz);
libkn_KLong (*component1)(libkn_kref_com_dong_maxhap_demos_SubItem3 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_SubItem3 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_SubItem3 thiz);
libkn_kref_com_dong_maxhap_demos_SubItem3 (*copy)(libkn_kref_com_dong_maxhap_demos_SubItem3 thiz, libkn_KLong subId, const char* subLabel, const char* subDetails);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_SubItem3 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_SubItem3 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_SubItem3 thiz);
} SubItem3;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_LargeDataClass4 (*LargeDataClass4)(const char* recordId, const char* recordName, const char* recordDescription, libkn_kref_kotlin_collections_Map recordMetadata, libkn_kref_kotlin_collections_List recordItems);
const char* (*get_recordDescription)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
const char* (*get_recordId)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
libkn_kref_kotlin_collections_List (*get_recordItems)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
libkn_kref_kotlin_collections_Map (*get_recordMetadata)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
const char* (*get_recordName)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
const char* (*component1)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
libkn_kref_kotlin_collections_Map (*component4)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
libkn_kref_kotlin_collections_List (*component5)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
libkn_kref_com_dong_maxhap_demos_LargeDataClass4 (*copy)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz, const char* recordId, const char* recordName, const char* recordDescription, libkn_kref_kotlin_collections_Map recordMetadata, libkn_kref_kotlin_collections_List recordItems);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_LargeDataClass4 thiz);
} LargeDataClass4;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_RecordItem4 (*RecordItem4)(libkn_KLong itemId, const char* itemName, const char* itemDescription);
const char* (*get_itemDescription)(libkn_kref_com_dong_maxhap_demos_RecordItem4 thiz);
libkn_KLong (*get_itemId)(libkn_kref_com_dong_maxhap_demos_RecordItem4 thiz);
const char* (*get_itemName)(libkn_kref_com_dong_maxhap_demos_RecordItem4 thiz);
libkn_KLong (*component1)(libkn_kref_com_dong_maxhap_demos_RecordItem4 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_RecordItem4 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_RecordItem4 thiz);
libkn_kref_com_dong_maxhap_demos_RecordItem4 (*copy)(libkn_kref_com_dong_maxhap_demos_RecordItem4 thiz, libkn_KLong itemId, const char* itemName, const char* itemDescription);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_RecordItem4 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_RecordItem4 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_RecordItem4 thiz);
} RecordItem4;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_LargeDataClass5 (*LargeDataClass5)(const char* entityId, const char* entityName, const char* entityDetails, libkn_kref_kotlin_collections_List entityAttributes, libkn_kref_kotlin_collections_List entityComponents);
libkn_kref_kotlin_collections_List (*get_entityAttributes)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
libkn_kref_kotlin_collections_List (*get_entityComponents)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
const char* (*get_entityDetails)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
const char* (*get_entityId)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
const char* (*get_entityName)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
const char* (*component1)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
libkn_kref_kotlin_collections_List (*component4)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
libkn_kref_kotlin_collections_List (*component5)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
libkn_kref_com_dong_maxhap_demos_LargeDataClass5 (*copy)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz, const char* entityId, const char* entityName, const char* entityDetails, libkn_kref_kotlin_collections_List entityAttributes, libkn_kref_kotlin_collections_List entityComponents);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_LargeDataClass5 thiz);
} LargeDataClass5;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_EntityComponent5 (*EntityComponent5)(libkn_KInt componentId, const char* componentName, const char* componentData);
const char* (*get_componentData)(libkn_kref_com_dong_maxhap_demos_EntityComponent5 thiz);
libkn_KInt (*get_componentId)(libkn_kref_com_dong_maxhap_demos_EntityComponent5 thiz);
const char* (*get_componentName)(libkn_kref_com_dong_maxhap_demos_EntityComponent5 thiz);
libkn_KInt (*component1)(libkn_kref_com_dong_maxhap_demos_EntityComponent5 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_EntityComponent5 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_EntityComponent5 thiz);
libkn_kref_com_dong_maxhap_demos_EntityComponent5 (*copy)(libkn_kref_com_dong_maxhap_demos_EntityComponent5 thiz, libkn_KInt componentId, const char* componentName, const char* componentData);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_EntityComponent5 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_EntityComponent5 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_EntityComponent5 thiz);
} EntityComponent5;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_LargeDataClass6 (*LargeDataClass6)(const char* objectId, const char* objectTitle, const char* objectContent, libkn_kref_kotlin_collections_List objectTags, libkn_kref_kotlin_collections_List objectSections);
const char* (*get_objectContent)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
const char* (*get_objectId)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
libkn_kref_kotlin_collections_List (*get_objectSections)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
libkn_kref_kotlin_collections_List (*get_objectTags)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
const char* (*get_objectTitle)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
const char* (*component1)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
libkn_kref_kotlin_collections_List (*component4)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
libkn_kref_kotlin_collections_List (*component5)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
libkn_kref_com_dong_maxhap_demos_LargeDataClass6 (*copy)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz, const char* objectId, const char* objectTitle, const char* objectContent, libkn_kref_kotlin_collections_List objectTags, libkn_kref_kotlin_collections_List objectSections);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_LargeDataClass6 thiz);
} LargeDataClass6;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_ObjectSection6 (*ObjectSection6)(libkn_KLong sectionId, const char* sectionTitle, const char* sectionText);
libkn_KLong (*get_sectionId)(libkn_kref_com_dong_maxhap_demos_ObjectSection6 thiz);
const char* (*get_sectionText)(libkn_kref_com_dong_maxhap_demos_ObjectSection6 thiz);
const char* (*get_sectionTitle)(libkn_kref_com_dong_maxhap_demos_ObjectSection6 thiz);
libkn_KLong (*component1)(libkn_kref_com_dong_maxhap_demos_ObjectSection6 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_ObjectSection6 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_ObjectSection6 thiz);
libkn_kref_com_dong_maxhap_demos_ObjectSection6 (*copy)(libkn_kref_com_dong_maxhap_demos_ObjectSection6 thiz, libkn_KLong sectionId, const char* sectionTitle, const char* sectionText);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_ObjectSection6 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_ObjectSection6 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_ObjectSection6 thiz);
} ObjectSection6;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_LargeDataClass7 (*LargeDataClass7)(const char* itemId, const char* itemLabel, const char* itemInfo, libkn_kref_kotlin_collections_Map itemProperties, libkn_kref_kotlin_collections_List itemChildren);
libkn_kref_kotlin_collections_List (*get_itemChildren)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
const char* (*get_itemId)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
const char* (*get_itemInfo)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
const char* (*get_itemLabel)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
libkn_kref_kotlin_collections_Map (*get_itemProperties)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
const char* (*component1)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
libkn_kref_kotlin_collections_Map (*component4)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
libkn_kref_kotlin_collections_List (*component5)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
libkn_kref_com_dong_maxhap_demos_LargeDataClass7 (*copy)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz, const char* itemId, const char* itemLabel, const char* itemInfo, libkn_kref_kotlin_collections_Map itemProperties, libkn_kref_kotlin_collections_List itemChildren);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_LargeDataClass7 thiz);
} LargeDataClass7;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_ItemChild7 (*ItemChild7)(libkn_KInt childIndex, const char* childLabel, const char* childInfo);
libkn_KInt (*get_childIndex)(libkn_kref_com_dong_maxhap_demos_ItemChild7 thiz);
const char* (*get_childInfo)(libkn_kref_com_dong_maxhap_demos_ItemChild7 thiz);
const char* (*get_childLabel)(libkn_kref_com_dong_maxhap_demos_ItemChild7 thiz);
libkn_KInt (*component1)(libkn_kref_com_dong_maxhap_demos_ItemChild7 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_ItemChild7 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_ItemChild7 thiz);
libkn_kref_com_dong_maxhap_demos_ItemChild7 (*copy)(libkn_kref_com_dong_maxhap_demos_ItemChild7 thiz, libkn_KInt childIndex, const char* childLabel, const char* childInfo);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_ItemChild7 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_ItemChild7 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_ItemChild7 thiz);
} ItemChild7;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_LargeDataClass8 (*LargeDataClass8)(const char* nodeId, const char* nodeTitle, const char* nodeDescription, libkn_kref_kotlin_collections_List nodeMetadata, libkn_kref_kotlin_collections_List nodeConnections);
libkn_kref_kotlin_collections_List (*get_nodeConnections)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
const char* (*get_nodeDescription)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
const char* (*get_nodeId)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
libkn_kref_kotlin_collections_List (*get_nodeMetadata)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
const char* (*get_nodeTitle)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
const char* (*component1)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
libkn_kref_kotlin_collections_List (*component4)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
libkn_kref_kotlin_collections_List (*component5)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
libkn_kref_com_dong_maxhap_demos_LargeDataClass8 (*copy)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz, const char* nodeId, const char* nodeTitle, const char* nodeDescription, libkn_kref_kotlin_collections_List nodeMetadata, libkn_kref_kotlin_collections_List nodeConnections);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_LargeDataClass8 thiz);
} LargeDataClass8;
struct {
libkn_KType* (*_type)(void);
libkn_kref_com_dong_maxhap_demos_NodeConnection8 (*NodeConnection8)(libkn_KLong connectionId, const char* connectionType, const char* connectionData);
const char* (*get_connectionData)(libkn_kref_com_dong_maxhap_demos_NodeConnection8 thiz);
libkn_KLong (*get_connectionId)(libkn_kref_com_dong_maxhap_demos_NodeConnection8 thiz);
const char* (*get_connectionType)(libkn_kref_com_dong_maxhap_demos_NodeConnection8 thiz);
libkn_KLong (*component1)(libkn_kref_com_dong_maxhap_demos_NodeConnection8 thiz);
const char* (*component2)(libkn_kref_com_dong_maxhap_demos_NodeConnection8 thiz);
const char* (*component3)(libkn_kref_com_dong_maxhap_demos_NodeConnection8 thiz);
libkn_kref_com_dong_maxhap_demos_NodeConnection8 (*copy)(libkn_kref_com_dong_maxhap_demos_NodeConnection8 thiz, libkn_KLong connectionId, const char* connectionType, const char* connectionData);
libkn_KBoolean (*equals)(libkn_kref_com_dong_maxhap_demos_NodeConnection8 thiz, libkn_kref_kotlin_Any other);
libkn_KInt (*hashCode)(libkn_kref_com_dong_maxhap_demos_NodeConnection8 thiz);
const char* (*toString)(libkn_kref_com_dong_maxhap_demos_NodeConnection8 thiz);
} NodeConnection8;
libkn_KInt (*com_dong_maxhap_demos_ChildData2$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_EntityComponent5$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_ItemChild7$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass1$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass2$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass3$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass4$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass5$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass6$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass7$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass8$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_NestedData1$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_NodeConnection8$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_ObjectSection6$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_RecordItem4$stableprop_getter)();
libkn_KInt (*com_dong_maxhap_demos_SubItem3$stableprop_getter)();
libkn_kref_kotlin_collections_List (*generateMassiveData1)();
libkn_kref_kotlin_collections_List (*getPreGeneratedData1)();
libkn_KInt (*com_dong_maxhap_demos_ChildData2$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_EntityComponent5$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_ItemChild7$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass1$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass2$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass3$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass4$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass5$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass6$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass7$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass8$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_NestedData1$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_NodeConnection8$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_ObjectSection6$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_RecordItem4$stableprop_getter_)();
libkn_KInt (*com_dong_maxhap_demos_SubItem3$stableprop_getter_)();
libkn_kref_kotlin_collections_List (*generateMassiveData2)();
libkn_kref_kotlin_collections_List (*getPreGeneratedData2)();
libkn_KInt (*com_dong_maxhap_demos_ChildData2$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_EntityComponent5$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_ItemChild7$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass1$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass2$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass3$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass4$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass5$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass6$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass7$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass8$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_NestedData1$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_NodeConnection8$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_ObjectSection6$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_RecordItem4$stableprop_getter__)();
libkn_KInt (*com_dong_maxhap_demos_SubItem3$stableprop_getter__)();
libkn_kref_kotlin_collections_List (*generateMassiveData3)();
libkn_kref_kotlin_collections_List (*getPreGeneratedData3)();
libkn_KInt (*com_dong_maxhap_demos_ChildData2$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_EntityComponent5$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_ItemChild7$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass1$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass2$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass3$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass4$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass5$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass6$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass7$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass8$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_NestedData1$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_NodeConnection8$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_ObjectSection6$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_RecordItem4$stableprop_getter___)();
libkn_KInt (*com_dong_maxhap_demos_SubItem3$stableprop_getter___)();
libkn_kref_kotlin_collections_List (*generateMassiveData4)();
libkn_KInt (*com_dong_maxhap_demos_ChildData2$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_EntityComponent5$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_ItemChild7$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass1$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass2$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass3$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass4$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass5$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass6$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass7$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass8$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_NestedData1$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_NodeConnection8$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_ObjectSection6$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_RecordItem4$stableprop_getter____)();
libkn_KInt (*com_dong_maxhap_demos_SubItem3$stableprop_getter____)();
libkn_kref_kotlin_collections_List (*generateMassiveData5)();
libkn_KInt (*com_dong_maxhap_demos_ChildData2$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_EntityComponent5$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_ItemChild7$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass1$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass2$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass3$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass4$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass5$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass6$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass7$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass8$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_NestedData1$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_NodeConnection8$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_ObjectSection6$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_RecordItem4$stableprop_getter_____)();
libkn_KInt (*com_dong_maxhap_demos_SubItem3$stableprop_getter_____)();
libkn_kref_kotlin_collections_List (*generateMassiveData6)();
libkn_KInt (*com_dong_maxhap_demos_ChildData2$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_EntityComponent5$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_ItemChild7$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass1$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass2$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass3$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass4$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass5$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass6$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass7$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass8$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_NestedData1$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_NodeConnection8$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_ObjectSection6$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_RecordItem4$stableprop_getter______)();
libkn_KInt (*com_dong_maxhap_demos_SubItem3$stableprop_getter______)();
libkn_kref_kotlin_collections_List (*generateMassiveData7)();
libkn_KInt (*com_dong_maxhap_demos_ChildData2$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_EntityComponent5$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_ItemChild7$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass1$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass2$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass3$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass4$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass5$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass6$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass7$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_LargeDataClass8$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_NestedData1$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_NodeConnection8$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_ObjectSection6$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_RecordItem4$stableprop_getter_______)();
libkn_KInt (*com_dong_maxhap_demos_SubItem3$stableprop_getter_______)();
libkn_kref_kotlin_collections_List (*generateMassiveData8)();
} demos;
struct {
struct {
struct {
......
import { ArkUIViewController, Compose } from 'compose';
import { hilog } from '@kit.PerformanceAnalysisKit';
import router from '@ohos.router';
import nativeApi from 'libentry.so';
import { registerComposeInteropBuilders } from './ComposeSample';
......@@ -13,7 +12,6 @@ struct Index {
private controller: ArkUIViewController | undefined = undefined;
@State errorMessage: string = 'Native module not ready';
@State resourcesReady: boolean = false;
aboutToAppear() {
if (nativeApi === undefined) {
......@@ -28,23 +26,9 @@ struct Index {
if (!this.controller) {
this.errorMessage = 'Controller creation failed (returned null)';
}
// 触发资源准备
this.prepareResources();
} catch (e) {
hilog.error(DOMAIN, 'Compose', 'Exception creating controller: %{public}s', JSON.stringify(e as object));
this.errorMessage = 'Exception creating controller: ' + JSON.stringify(e as object);
}
}
prepareResources() {
// 准备大体积资源
try {
const context = getContext(this);
console.log('Preparing 300MB resources for packaging...');
this.resourcesReady = true;
} catch (error) {
console.log('Resource preparation completed');
this.resourcesReady = true;
hilog.error(DOMAIN, 'Compose', 'Exception creating controller: %{public}s', JSON.stringify(e));
this.errorMessage = 'Exception creating controller: ' + JSON.stringify(e);
}
}
......@@ -56,41 +40,8 @@ struct Index {
libraryName: 'entry',
onBackPressed: () => this.controller!.onBackPress()
})
// 添加导航按钮
Button('开始嵌套之旅 🚀')
.onClick(() => {
router.pushUrl({
url: 'pages/Level1Page'
}).catch((err: Error) => {
hilog.error(DOMAIN, 'Navigation', 'Failed to navigate: %{public}s', JSON.stringify(err as object));
});
})
.position({ x: '50%', y: '85%' })
.translate({ x: '-50%' })
.backgroundColor('#4ECDC4')
.fontSize(16)
.width(200)
.height(50)
.borderRadius(25)
.shadow({ radius: 8, color: '#00000020', offsetX: 0, offsetY: 4 })
} else {
Column() {
Text(this.errorMessage)
.fontSize(16)
.fontColor('#FF0000')
.margin({ bottom: 20 })
Button('重试初始化')
.onClick(() => {
this.aboutToAppear();
})
.backgroundColor('#FF6B6B')
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
Text(this.errorMessage)
}
}
.width('100%')
......
import router from '@ohos.router';
import { hilog } from '@kit.PerformanceAnalysisKit';
const DOMAIN = 0x0001;
// 定义功能卡片接口
interface FeatureCard {
title: string;
desc: string;
icon: string;
}
@Entry
@Component
struct Level1Page {
@State pageTitle: string = '第一层级页面';
@State pageDescription: string = '这是第1层嵌套页面';
build() {
Column() {
// 标题区域
Row() {
Button('返回首页')
.onClick(() => {
router.back();
})
.margin(10)
.backgroundColor('#FF6B6B')
Text(this.pageTitle)
.fontSize(24)
.fontWeight(FontWeight.Bold)
.layoutWeight(1)
.textAlign(TextAlign.Center)
Button('进入下一层')
.onClick(() => {
router.pushUrl({
url: 'pages/Level2Page'
}).catch((err: Error) => {
hilog.error(DOMAIN, 'Navigation', 'Failed to navigate: %{public}s', JSON.stringify(err as object));
});
})
.margin(10)
.backgroundColor('#4ECDC4')
}
.width('100%')
.height('10%')
.backgroundColor('#F7F9FC')
// 内容区域
Scroll() {
Column() {
// 页面描述
Text(this.pageDescription)
.fontSize(18)
.margin({ top: 20, bottom: 30 })
.textAlign(TextAlign.Center)
.width('90%')
// 功能展示区域
this.renderFeatures()
// 嵌套层级指示器
this.renderLevelIndicator(1)
}
.width('100%')
.padding(20)
}
.layoutWeight(1)
// 底部信息栏
Row() {
Text(`当前层级: 1`)
.fontSize(14)
.fontColor('#666666')
Blank()
Text(`总目标体积: ~300MB`)
.fontSize(14)
.fontColor('#666666')
}
.width('100%')
.height('8%')
.backgroundColor('#EEEEEE')
.padding(10)
}
.width('100%')
.height('100%')
.backgroundColor('#FFFFFF')
}
@Builder
renderFeatures() {
Column() {
// 特色功能卡片
ForEach([
{ title: '数据可视化', desc: '展示各种图表和数据分析', icon: '📊' },
{ title: '系统监控', desc: '实时监控系统性能指标', icon: '📈' },
{ title: '用户管理', desc: '完整的用户权限管理系统', icon: '👥' },
{ title: '日志分析', desc: '智能日志收集与分析平台', icon: '📋' }
], (item: FeatureCard, index: number) => {
this.renderFeatureCard(item.title, item.desc, item.icon, index);
})
}
.width('100%')
.margin({ bottom: 20 })
}
@Builder
renderFeatureCard(title: string, description: string, icon: string, index: number) {
Row() {
Text(icon)
.fontSize(28)
.margin({ right: 15 })
Column() {
Text(title)
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 5 })
.textAlign(TextAlign.Start)
Text(description)
.fontSize(14)
.fontColor('#666666')
.textAlign(TextAlign.Start)
}
.layoutWeight(1)
Button('查看详情')
.onClick(() => {
// 可以添加具体功能跳转
})
.backgroundColor('#4ECDC4')
.fontSize(12)
.padding({ left: 15, right: 15 })
}
.width('100%')
.height(80)
.backgroundColor('#FFFFFF')
.borderRadius(12)
.border({ width: 1, color: '#EEEEEE' })
.padding(15)
.margin({ bottom: 15 })
}
@Builder
renderLevelIndicator(currentLevel: number) {
Column() {
Text('嵌套层级结构')
.fontSize(20)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
// 层级进度条
Row() {
ForEach([1, 2, 3, 4, 5], (level: number) => {
Column() {
Circle({ width: 30, height: 30 })
.fill(level <= currentLevel ? '#4ECDC4' : '#DDDDDD')
Text(`Level ${level}`)
.fontSize(12)
.margin({ top: 5 })
.fontColor(level <= currentLevel ? '#4ECDC4' : '#999999')
}
.layoutWeight(1)
if (level < 5) {
Line()
.width('15%')
.stroke(level < currentLevel ? '#4ECDC4' : '#DDDDDD')
.strokeWidth(2)
.layoutWeight(1)
}
})
}
.width('100%')
.height(60)
.margin({ bottom: 20 })
Text(`已完成 ${currentLevel}/5 层嵌套`)
.fontSize(16)
.fontColor('#666666')
}
.width('100%')
.backgroundColor('#F8F9FA')
.borderRadius(15)
.padding(20)
.margin({ top: 20 })
}
}
import router from '@ohos.router';
import { hilog } from '@kit.PerformanceAnalysisKit';
const DOMAIN = 0x0002;
// 定义功能项接口
interface FeatureItem {
title: string;
icon: string;
color: string;
}
@Entry
@Component
struct Level2Page {
@State pageTitle: string = '第二层级页面';
@State pageDescription: string = '这是第2层嵌套页面,功能更加丰富';
@State counter: number = 0;
build() {
Column() {
// 顶部导航栏
Row() {
Button('返回上层')
.onClick(() => {
router.back();
})
.margin(10)
.backgroundColor('#FF6B6B')
Text(this.pageTitle)
.fontSize(22)
.fontWeight(FontWeight.Bold)
.layoutWeight(1)
.textAlign(TextAlign.Center)
Button('继续深入')
.onClick(() => {
router.pushUrl({
url: 'pages/Level3Page'
}).catch((err: Error) => {
hilog.error(DOMAIN, 'Navigation', 'Failed to navigate: %{public}s', JSON.stringify(err as object));
});
})
.margin(10)
.backgroundColor('#45B7D1')
}
.width('100%')
.height('10%')
.backgroundColor('#F0F4F8')
// 主内容区域
Scroll() {
Column() {
// 页面标题和描述
Column() {
Text(this.pageDescription)
.fontSize(16)
.fontColor('#666666')
.margin({ top: 10 })
.textAlign(TextAlign.Center)
}
.width('90%')
.backgroundColor('#E8F4F8')
.borderRadius(10)
.padding(15)
.margin({ bottom: 20 })
// 交互功能区
this.renderInteractiveSection()
// 数据展示区
this.renderDataSection()
// 嵌套进度
this.renderNestingProgress(2)
// 计数器展示
this.renderCounter()
}
.width('100%')
.padding(20)
}
.layoutWeight(1)
// 底部控制栏
Row() {
Button('增加计数')
.onClick(() => {
this.counter++;
})
.layoutWeight(1)
.margin({ right: 10 })
.backgroundColor('#96CEB4')
Button('重置')
.onClick(() => {
this.counter = 0;
})
.layoutWeight(1)
.backgroundColor('#FFEAA7')
}
.width('100%')
.height('10%')
.backgroundColor('#EEEEEE')
.padding(15)
}
.width('100%')
.height('100%')
.backgroundColor('#FFFFFF')
}
@Builder
renderInteractiveSection() {
Column() {
Text('交互功能区')
.fontSize(20)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
// 功能按钮网格
Grid() {
ForEach([
{ title: '数据采集', icon: '🔍', color: '#A2D5F2' },
{ title: '实时通信', icon: '📡', color: '#FFA07A' },
{ title: '云端同步', icon: '☁️', color: '#98D8C8' },
{ title: '智能分析', icon: '🧠', color: '#F7DC6F' },
{ title: '报表生成', icon: '📊', color: '#BB8FCE' },
{ title: '系统设置', icon: '⚙️', color: '#85C1E9' }
], (item: FeatureItem, index: number) => {
GridItem() {
Column() {
Text(item.icon)
.fontSize(24)
.margin({ bottom: 8 })
Text(item.title)
.fontSize(12)
.fontWeight(FontWeight.Medium)
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor(item.color)
.borderRadius(10)
.onClick(() => {
// 功能点击处理
})
}
})
}
.columnsTemplate('1fr 1fr 1fr')
.rowsTemplate('1fr 1fr')
.columnsGap(10)
.rowsGap(10)
.width('100%')
.height(150)
.margin({ bottom: 25 })
}
.width('100%')
.backgroundColor('#F8F9FA')
.borderRadius(15)
.padding(20)
.margin({ bottom: 20 })
}
@Builder
renderDataSection() {
Column() {
Text('数据统计')
.fontSize(20)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
// 统计卡片
Row() {
this.renderStatCard('用户数量', '1,234', '👤', '#FF6B6B');
this.renderStatCard('活跃度', '87%', '🔥', '#4ECDC4');
this.renderStatCard('响应时间', '245ms', '⚡', '#45B7D1');
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.margin({ bottom: 20 })
}
.width('100%')
}
@Builder
renderStatCard(title: string, value: string, icon: string, color: string) {
Column() {
Text(icon)
.fontSize(20)
.margin({ bottom: 5 })
Text(value)
.fontSize(18)
.fontWeight(FontWeight.Bold)
.fontColor(color)
.margin({ bottom: 3 })
Text(title)
.fontSize(12)
.fontColor('#666666')
}
.width('30%')
.height(80)
.backgroundColor('#FFFFFF')
.borderRadius(12)
.border({ width: 1, color: '#EEEEEE' })
.justifyContent(FlexAlign.Center)
.padding(10)
}
@Builder
renderNestingProgress(currentLevel: number) {
Column() {
Text('嵌套进度')
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
// 进度条
Row() {
ForEach([1, 2, 3, 4, 5], (level: number) => {
Column() {
Circle({ width: 25, height: 25 })
.fill(level <= currentLevel ? '#45B7D1' : '#DDDDDD')
.stroke(level <= currentLevel ? '#45B7D1' : '#CCCCCC')
.strokeWidth(2)
if (level <= currentLevel) {
Text(`L${level}`)
.fontSize(10)
.fontColor('#45B7D1')
.margin({ top: 3 })
}
}
.layoutWeight(1)
if (level < 5) {
Line()
.width('12%')
.stroke(level < currentLevel ? '#45B7D1' : '#DDDDDD')
.strokeWidth(2)
.layoutWeight(1)
}
})
}
.width('100%')
.height(50)
.margin({ bottom: 15 })
Text(`当前深度: 第${currentLevel}层 (共5层)`)
.fontSize(14)
.fontColor('#666666')
}
.width('100%')
.backgroundColor('#E8F8F5')
.borderRadius(12)
.padding(15)
.margin({ bottom: 20 })
}
@Builder
renderCounter() {
Row() {
Text('页面访问计数:')
.fontSize(16)
.fontWeight(FontWeight.Bold)
Text(`${this.counter}`)
.fontSize(20)
.fontWeight(FontWeight.Bold)
.fontColor('#FF6B6B')
.margin({ left: 10 })
}
.width('100%')
.height(50)
.backgroundColor('#FFF3E0')
.borderRadius(10)
.justifyContent(FlexAlign.Center)
.margin({ top: 10 })
}
}
import router from '@ohos.router';
import { hilog } from '@kit.PerformanceAnalysisKit';
const DOMAIN = 0x0003;
// 定义数据项接口
interface DataItem {
id: number;
name: string;
value: string;
status: string;
}
// 定义控制面板项接口
interface ControlItem {
title: string;
icon: string;
action: () => void;
}
@Entry
@Component
struct Level3Page {
@State pageTitle: string = '第三层级页面';
@State pageDescription: string = '这是第3层嵌套页面,包含复杂的数据处理和业务逻辑';
@State isLoading: boolean = false;
@State dataList: Array<DataItem> = [];
@State currentIndex: number = 0;
aboutToAppear() {
this.loadData();
}
loadData() {
this.isLoading = true;
// 模拟数据加载
setTimeout(() => {
this.dataList = [
{ id: 1, name: '系统配置项A', value: '启用', status: 'active' },
{ id: 2, name: '数据库连接池', value: '已连接', status: 'connected' },
{ id: 3, name: '缓存服务', value: '运行中', status: 'running' },
{ id: 4, name: '消息队列', value: '正常', status: 'normal' },
{ id: 5, name: '定时任务', value: '执行中', status: 'processing' },
{ id: 6, name: '日志服务', value: '就绪', status: 'ready' },
{ id: 7, name: '监控组件', value: '激活', status: 'active' },
{ id: 8, name: '安全模块', value: '防护中', status: 'protecting' }
];
this.isLoading = false;
}, 1500);
}
build() {
Column() {
// 顶部工具栏
Row() {
Button('← 返回')
.onClick(() => {
router.back();
})
.margin(10)
.backgroundColor('#FF6B6B')
.fontSize(14)
Column() {
Text(this.pageTitle)
.fontSize(18)
.fontWeight(FontWeight.Bold)
Text(`数据项: ${this.dataList.length}`)
.fontSize(12)
.fontColor('#666666')
.margin({ top: 2 })
}
.layoutWeight(1)
Button('深入探索 →')
.onClick(() => {
router.pushUrl({
url: 'pages/Level4Page'
}).catch((err: Error) => {
hilog.error(DOMAIN, 'Navigation', 'Failed to navigate: %{public}s', JSON.stringify(err as object));
});
})
.margin(10)
.backgroundColor('#96CEB4')
.fontSize(14)
}
.width('100%')
.height('12%')
.backgroundColor('#F8F9FA')
.padding({ left: 10, right: 10 })
// 主体内容
Column() {
// 状态指示器
this.renderStatusIndicator()
// 数据列表区域
this.renderDataList()
// 控制面板
this.renderControlPanel()
// 嵌套深度展示
this.renderDepthInfo(3)
}
.layoutWeight(1)
.width('100%')
.padding(15)
// 底部信息栏
Row() {
Text(`加载状态: ${this.isLoading ? '加载中...' : '就绪'}`)
.fontSize(12)
.fontColor(this.isLoading ? '#FF6B6B' : '#4ECDC4')
Blank()
Text(`当前位置: L3/${this.currentIndex + 1}`)
.fontSize(12)
.fontColor('#666666')
}
.width('100%')
.height('8%')
.backgroundColor('#EEEEEE')
.padding(10)
}
.width('100%')
.height('100%')
.backgroundColor('#FFFFFF')
}
@Builder
renderStatusIndicator() {
Row() {
// 系统状态卡片
this.renderSystemCard('CPU', '45%', '#FF6B6B', '💻');
this.renderSystemCard('内存', '68%', '#4ECDC4', '💾');
this.renderSystemCard('网络', '稳定', '#45B7D1', '🌐');
this.renderSystemCard('存储', '23%', '#96CEB4', '🗄️');
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.margin({ bottom: 20 })
}
@Builder
renderSystemCard(title: string, value: string, color: string, icon: string) {
Column() {
Text(icon)
.fontSize(18)
.margin({ bottom: 5 })
Text(value)
.fontSize(14)
.fontWeight(FontWeight.Bold)
.fontColor(color)
.margin({ bottom: 3 })
Text(title)
.fontSize(10)
.fontColor('#666666')
}
.width('22%')
.height(60)
.backgroundColor('#FFFFFF')
.borderRadius(10)
.border({ width: 1, color: '#EEEEEE' })
.justifyContent(FlexAlign.Center)
.padding(8)
}
@Builder
renderDataList() {
Column() {
Row() {
Text('系统组件状态')
.fontSize(16)
.fontWeight(FontWeight.Bold)
.layoutWeight(1)
Button('刷新')
.onClick(() => {
this.loadData();
})
.backgroundColor('#FFEAA7')
.fontSize(12)
.padding({ left: 12, right: 12 })
}
.width('100%')
.margin({ bottom: 10 })
if (this.isLoading) {
Column() {
Progress({ value: 50, total: 100 })
.width('80%')
.color('#45B7D1')
.margin({ bottom: 10 })
Text('正在加载数据...')
.fontSize(14)
.fontColor('#666666')
}
.width('100%')
.height(100)
.justifyContent(FlexAlign.Center)
} else {
List({ space: 8 }) {
ForEach(this.dataList, (item: DataItem, index: number) => {
ListItem() {
this.renderDataItem(item, index);
}
})
}
.layoutWeight(1)
.width('100%')
.edgeEffect(EdgeEffect.None)
}
}
.width('100%')
.backgroundColor('#F8F9FA')
.borderRadius(12)
.padding(15)
.margin({ bottom: 20 })
}
@Builder
renderDataItem(item: DataItem, index: number) {
Row() {
Column() {
Text(item.name)
.fontSize(14)
.fontWeight(FontWeight.Medium)
.margin({ bottom: 3 })
Text(`ID: ${item.id}`)
.fontSize(11)
.fontColor('#999999')
}
.layoutWeight(1)
Row() {
Text(item.value)
.fontSize(12)
.padding({ left: 8, right: 8 })
.backgroundColor(this.getStatusColor(item.status))
.borderRadius(12)
.fontColor('#FFFFFF')
Blank()
Toggle({ type: ToggleType.Switch })
.onChange((isChecked) => {
// 处理开关变化
})
}
.width('40%')
}
.width('100%')
.height(50)
.backgroundColor('#FFFFFF')
.borderRadius(8)
.border({ width: 1, color: '#EEEEEE' })
.padding({ left: 12, right: 12 })
.onClick(() => {
this.currentIndex = index;
})
}
getStatusColor(status: string): string {
switch (status) {
case 'active': return '#4ECDC4';
case 'connected': return '#45B7D1';
case 'running': return '#96CEB4';
case 'normal': return '#FFEAA7';
case 'processing': return '#FF6B6B';
case 'ready': return '#A2D5F2';
case 'protecting': return '#BB8FCE';
default: return '#CCCCCC';
}
}
@Builder
renderControlPanel() {
Column() {
Text('操作控制台')
.fontSize(16)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
Grid() {
ForEach([
{ title: '启动服务', icon: '▶️', action: () => {} },
{ title: '停止服务', icon: '⏹️', action: () => {} },
{ title: '重启系统', icon: '🔄', action: () => {} },
{ title: '备份数据', icon: '💾', action: () => {} },
{ title: '清理缓存', icon: '🧹', action: () => {} },
{ title: '系统诊断', icon: '🩺', action: () => {} }
], (item: ControlItem) => {
GridItem() {
Column() {
Text(item.icon)
.fontSize(20)
.margin({ bottom: 5 })
Text(item.title)
.fontSize(11)
.textAlign(TextAlign.Center)
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor('#E8F4F8')
.borderRadius(8)
.onClick(item.action)
}
})
}
.columnsTemplate('1fr 1fr 1fr')
.rowsTemplate('1fr 1fr')
.columnsGap(8)
.rowsGap(8)
.width('100%')
.height(120)
}
.width('100%')
.backgroundColor('#FFF8E1')
.borderRadius(12)
.padding(15)
.margin({ bottom: 20 })
}
@Builder
renderDepthInfo(currentLevel: number) {
Column() {
Text('嵌套层级信息')
.fontSize(16)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
// 层级可视化
Row() {
ForEach([1, 2, 3, 4, 5], (level: number) => {
Column() {
Circle({ width: 22, height: 22 })
.fill(level <= currentLevel ? '#96CEB4' : '#DDDDDD')
.stroke(level <= currentLevel ? '#96CEB4' : '#CCCCCC')
.strokeWidth(2)
Text(`${level}`)
.fontSize(10)
.fontColor(level <= currentLevel ? '#96CEB4' : '#999999')
.margin({ top: 3 })
}
.layoutWeight(1)
if (level < 5) {
Line()
.width('10%')
.stroke(level < currentLevel ? '#96CEB4' : '#DDDDDD')
.strokeWidth(2)
.layoutWeight(1)
}
})
}
.width('100%')
.height(45)
.margin({ bottom: 15 })
Text(`当前深度: 第${currentLevel}层 | 总体积目标: ~300MB`)
.fontSize(12)
.fontColor('#666666')
.textAlign(TextAlign.Center)
}
.width('100%')
.backgroundColor('#E8F5E8')
.borderRadius(10)
.padding(15)
}
}
import router from '@ohos.router';
import { hilog } from '@kit.PerformanceAnalysisKit';
const DOMAIN = 0x0004;
// 定义图表数据接口
interface ChartDataItem {
month: string;
value: number;
trend: string;
}
// 定义标签页接口
interface TabItem {
title: string;
index: number;
icon: string;
}
// 定义趋势项接口
interface TrendItem {
label: string;
value: string;
status: string;
}
// 定义资源项接口
interface ResourceItem {
name: string;
value: number;
max: number;
color: string;
}
// 定义配置项接口
interface ConfigItem {
name: string;
enabled: boolean;
}
@Entry
@Component
struct Level4Page {
@State pageTitle: string = '第四层级页面';
@State pageDescription: string = '这是第4层嵌套页面,集成高级功能和复杂业务场景';
@State chartData: Array<ChartDataItem> = [];
@State selectedTab: number = 0;
@State notifications: Array<string> = [];
aboutToAppear() {
this.initializeData();
this.loadNotifications();
}
initializeData() {
// 初始化图表数据
this.chartData = [
{ month: 'Jan', value: 65, trend: 'up' },
{ month: 'Feb', value: 59, trend: 'up' },
{ month: 'Mar', value: 80, trend: 'up' },
{ month: 'Apr', value: 81, trend: 'down' },
{ month: 'May', value: 56, trend: 'up' },
{ month: 'Jun', value: 55, trend: 'down' },
{ month: 'Jul', value: 40, trend: 'down' },
{ month: 'Aug', value: 60, trend: 'up' },
{ month: 'Sep', value: 70, trend: 'up' },
{ month: 'Oct', value: 65, trend: 'down' },
{ month: 'Nov', value: 75, trend: 'up' },
{ month: 'Dec', value: 85, trend: 'up' }
];
}
loadNotifications() {
this.notifications = [
'系统安全扫描完成',
'数据库备份成功',
'新用户注册提醒',
'服务器负载预警',
'API调用频率异常',
'缓存命中率提升',
'第三方服务连接恢复'
];
}
build() {
Column() {
// 顶部导航
Row() {
Button('🔙 上一层')
.onClick(() => {
router.back();
})
.margin(8)
.backgroundColor('#FF6B6B')
.fontSize(12)
.padding({ left: 12, right: 12 })
Column() {
Text(this.pageTitle)
.fontSize(16)
.fontWeight(FontWeight.Bold)
Text(this.pageDescription)
.fontSize(11)
.fontColor('#666666')
.margin({ top: 2 })
}
.layoutWeight(1)
Button('最终层级 ➡️')
.onClick(() => {
router.pushUrl({
url: 'pages/Level5Page'
}).catch((err: Error) => {
hilog.error(DOMAIN, 'Navigation', 'Failed to navigate: %{public}s', JSON.stringify(err as object));
});
})
.margin(8)
.backgroundColor('#6C5CE7')
.fontSize(12)
.padding({ left: 12, right: 12 })
}
.width('100%')
.height('10%')
.backgroundColor('#F1F2F6')
.padding({ left: 10, right: 10 })
// Tab导航
this.renderTabBar()
// 主要内容区域
Tabs({ barPosition: BarPosition.End, index: this.selectedTab }) {
TabContent() {
this.renderAnalyticsTab()
}
.tabBar('数据分析')
TabContent() {
this.renderMonitorTab()
}
.tabBar('系统监控')
TabContent() {
this.renderSettingsTab()
}
.tabBar('高级设置')
}
.barWidth('100%')
.barHeight(50)
.animationDuration(300)
.layoutWeight(1)
.width('100%')
.onChange((index: number) => {
this.selectedTab = index;
})
// 底部状态栏
Row() {
Text(`📊 Tab: ${this.selectedTab + 1}/3`)
.fontSize(11)
.fontColor('#666666')
Blank()
Text(`🔒 最终层级: L5`)
.fontSize(11)
.fontColor('#6C5CE7')
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('6%')
.backgroundColor('#EEEEEE')
.padding({ left: 15, right: 15 })
}
.width('100%')
.height('100%')
.backgroundColor('#FFFFFF')
}
@Builder
renderTabBar() {
Row() {
ForEach([
{ title: '📊 分析', index: 0, icon: '📈' },
{ title: '🖥️ 监控', index: 1, icon: '📡' },
{ title: '⚙️ 设置', index: 2, icon: '🔧' }
], (tab: TabItem) => {
Column() {
Text(tab.icon)
.fontSize(16)
.margin({ bottom: 2 })
Text(tab.title.replace(/[^\u4e00-\u9fa5]/g, ''))
.fontSize(11)
.fontColor(this.selectedTab === tab.index ? '#6C5CE7' : '#999999')
.fontWeight(this.selectedTab === tab.index ? FontWeight.Bold : FontWeight.Normal)
}
.layoutWeight(1)
.height(45)
.justifyContent(FlexAlign.Center)
.backgroundColor(this.selectedTab === tab.index ? '#E8E6FF' : '#FFFFFF')
.borderRadius(8)
.onClick(() => {
this.selectedTab = tab.index;
})
})
}
.width('100%')
.height(50)
.backgroundColor('#F8F9FA')
.padding(5)
.margin({ bottom: 10 })
}
@Builder
renderAnalyticsTab() {
Scroll() {
Column() {
// 图表展示区
this.renderChartSection()
// 关键指标
this.renderKeyMetrics()
// 趋势分析
this.renderTrendAnalysis()
// 嵌套进度
this.renderNestingProgress(4)
}
.width('100%')
.padding(15)
}
}
@Builder
renderChartSection() {
Column() {
Text('月度数据趋势')
.fontSize(16)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
// 模拟折线图
Column() {
Row() {
ForEach(this.chartData, (data: ChartDataItem, index: number) => {
Column() {
// 数据点
Circle({ width: 8, height: 8 })
.fill(data.trend === 'up' ? '#6C5CE7' : '#FF6B6B')
.margin({ bottom: 5 })
// 数值标签
Text(`${data.value}`)
.fontSize(9)
.fontColor('#666666')
.margin({ bottom: 3 })
// 月份标签
Text(data.month)
.fontSize(8)
.fontColor('#999999')
}
.layoutWeight(1)
.height(80)
.justifyContent(FlexAlign.End)
// 连接线
if (index < this.chartData.length - 1) {
Line()
.width(1)
.height(30)
.stroke('#CCCCCC')
.layoutWeight(1)
.margin({ top: 25 })
}
})
}
.width('100%')
.height(100)
.margin({ bottom: 15 })
// 图例
Row() {
Row() {
Circle({ width: 10, height: 10 }).fill('#6C5CE7')
Text('上升趋势').fontSize(10).margin({ left: 5 })
}
.margin({ right: 15 })
Row() {
Circle({ width: 10, height: 10 }).fill('#FF6B6B')
Text('下降趋势').fontSize(10).margin({ left: 5 })
}
}
.alignItems(VerticalAlign.Center)
}
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(12)
.border({ width: 1, color: '#EEEEEE' })
.padding(15)
}
.width('100%')
.backgroundColor('#F0F0FF')
.borderRadius(15)
.padding(15)
.margin({ bottom: 20 })
}
@Builder
renderKeyMetrics() {
Column() {
Text('核心指标')
.fontSize(16)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
Row() {
this.renderMetricCard('用户活跃度', '87.5%', '🟢', '#4ECDC4');
this.renderMetricCard('系统稳定性', '99.2%', '🔵', '#45B7D1');
this.renderMetricCard('响应速度', '180ms', '⚡', '#FFD93D');
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
.margin({ bottom: 15 })
}
.width('100%')
.backgroundColor('#FFF5E6')
.borderRadius(12)
.padding(15)
.margin({ bottom: 20 })
}
@Builder
renderMetricCard(title: string, value: string, icon: string, color: string) {
Column() {
Text(icon)
.fontSize(16)
.margin({ bottom: 5 })
Text(value)
.fontSize(14)
.fontWeight(FontWeight.Bold)
.fontColor(color)
.margin({ bottom: 3 })
Text(title)
.fontSize(10)
.fontColor('#666666')
.textAlign(TextAlign.Center)
}
.width('31%')
.height(70)
.backgroundColor('#FFFFFF')
.borderRadius(10)
.border({ width: 1, color: '#EEEEEE' })
.justifyContent(FlexAlign.Center)
.padding(8)
}
@Builder
renderTrendAnalysis() {
Column() {
Text('趋势预测')
.fontSize(16)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
Column() {
ForEach([
{ label: '下月增长预期', value: '+12.3%', status: 'positive' },
{ label: '季度目标达成', value: '85.7%', status: 'warning' },
{ label: '年度KPI进度', value: '78.2%', status: 'positive' }
], (item: TrendItem) => {
Row() {
Text(item.label)
.fontSize(12)
.layoutWeight(1)
.textAlign(TextAlign.Start)
Row() {
Text(item.value)
.fontSize(12)
.fontWeight(FontWeight.Bold)
.fontColor(item.status === 'positive' ? '#4ECDC4' : '#FFA07A')
Text(item.status === 'positive' ? '↗️' : '➡️')
.fontSize(10)
.margin({ left: 3 })
}
}
.width('100%')
.height(35)
.backgroundColor('#FFFFFF')
.borderRadius(8)
.padding({ left: 12, right: 12 })
.margin({ bottom: 8 })
})
}
.width('100%')
}
.width('100%')
.backgroundColor('#E6F7FF')
.borderRadius(12)
.padding(15)
.margin({ bottom: 20 })
}
@Builder
renderMonitorTab() {
Column() {
Text('实时监控面板')
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
// 通知列表
this.renderNotificationList()
// 系统资源
this.renderResourceMonitor()
}
.width('100%')
.padding(20)
}
@Builder
renderSettingsTab() {
Column() {
Text('高级配置')
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
// 配置选项
this.renderConfigOptions()
// 安全设置
this.renderSecuritySettings()
}
.width('100%')
.padding(20)
}
@Builder
renderNotificationList() {
Column() {
Text('系统通知')
.fontSize(14)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 10 })
List({ space: 5 }) {
ForEach(this.notifications, (notice: string, index: number) => {
ListItem() {
Row() {
Circle({ width: 6, height: 6 })
.fill(index % 2 === 0 ? '#4ECDC4' : '#FF6B6B')
.margin({ right: 10 })
Text(notice)
.fontSize(12)
.layoutWeight(1)
Text(`${index + 1}分钟前`)
.fontSize(10)
.fontColor('#999999')
}
.width('100%')
.height(35)
.backgroundColor('#FFFFFF')
.borderRadius(6)
.padding({ left: 12, right: 12 })
}
})
}
.width('100%')
.height(180)
.backgroundColor('#F8F9FA')
.borderRadius(10)
.padding(8)
}
.width('100%')
.margin({ bottom: 20 })
}
@Builder
renderResourceMonitor() {
Column() {
Text('资源使用情况')
.fontSize(14)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
ForEach([
{ name: 'CPU使用率', value: 45, max: 100, color: '#FF6B6B' },
{ name: '内存占用', value: 68, max: 100, color: '#4ECDC4' },
{ name: '磁盘空间', value: 23, max: 100, color: '#45B7D1' },
{ name: '网络流量', value: 78, max: 100, color: '#6C5CE7' }
], (resource: ResourceItem) => {
Column() {
Row() {
Text(resource.name)
.fontSize(12)
.layoutWeight(1)
Text(`${resource.value}%`)
.fontSize(12)
.fontWeight(FontWeight.Bold)
.fontColor(resource.color)
}
.width('100%')
.margin({ bottom: 5 })
Progress({ value: resource.value, total: resource.max })
.width('100%')
.color(resource.color)
.backgroundColor('#EEEEEE')
.height(6)
}
.width('100%')
.margin({ bottom: 12 })
})
}
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(12)
.padding(15)
}
@Builder
renderConfigOptions() {
Column() {
Text('系统配置')
.fontSize(14)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
ForEach([
{ name: '自动更新', enabled: true },
{ name: '数据加密', enabled: true },
{ name: '日志记录', enabled: false },
{ name: '性能优化', enabled: true }
], (config: ConfigItem) => {
Row() {
Text(config.name)
.fontSize(13)
.layoutWeight(1)
Toggle({ type: ToggleType.Switch, isOn: config.enabled })
.onChange((isChecked) => {
// 配置变更处理
})
}
.width('100%')
.height(40)
.backgroundColor('#F8F9FA')
.borderRadius(8)
.padding({ left: 15, right: 15 })
.margin({ bottom: 8 })
})
}
.width('100%')
.margin({ bottom: 20 })
}
@Builder
renderSecuritySettings() {
Column() {
Text('安全设置')
.fontSize(14)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
Button('修改密码')
.onClick(() => {
// 密码修改逻辑
})
.width('100%')
.height(40)
.backgroundColor('#FF6B6B')
.margin({ bottom: 10 })
Button('双因素认证')
.onClick(() => {
// 2FA设置
})
.width('100%')
.height(40)
.backgroundColor('#4ECDC4')
}
.width('100%')
}
@Builder
renderNestingProgress(currentLevel: number) {
Column() {
Text('嵌套层级进度')
.fontSize(14)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 15 })
// 进度可视化
Row() {
ForEach([1, 2, 3, 4, 5], (level: number) => {
Column() {
Circle({ width: 18, height: 18 })
.fill(level <= currentLevel ? '#6C5CE7' : '#DDDDDD')
.stroke(level <= currentLevel ? '#6C5CE7' : '#CCCCCC')
.strokeWidth(1)
if (level <= currentLevel) {
Text(`L${level}`)
.fontSize(8)
.fontColor('#6C5CE7')
.margin({ top: 2 })
}
}
.layoutWeight(1)
if (level < 5) {
Line()
.width('8%')
.stroke(level < currentLevel ? '#6C5CE7' : '#DDDDDD')
.strokeWidth(1)
.layoutWeight(1)
}
})
}
.width('100%')
.height(40)
.margin({ bottom: 10 })
Text(`当前深度: ${currentLevel}/5 层 | 即将到达最终层级`)
.fontSize(11)
.fontColor('#666666')
.textAlign(TextAlign.Center)
}
.width('100%')
.backgroundColor('#E6E6FA')
.borderRadius(10)
.padding(12)
}
}
import router from '@ohos.router';
import { hilog } from '@kit.PerformanceAnalysisKit';
const DOMAIN = 0x0005;
// 定义指标项接口
interface MetricItem {
name: string;
value: string;
color: string;
}
// 定义层级接口
interface LayerItem {
level: number;
name: string;
desc: string;
icon: string;
}
// 定义特性接口
interface FeatureItem {
feature: string;
desc: string;
}
// 定义统计项接口
interface StatItem {
title: string;
value: string;
unit: string;
color: string;
}
@Entry
@Component
struct Level5Page {
@State pageTitle: string = '第五层级页面 - 最终层级';
@State pageDescription: string = '这是最深层级页面,展示了完整的嵌套结构和所有功能';
@State systemStatus: string = '运行正常';
@State performanceScore: number = 92.5;
@State activeConnections: number = 1247;
@State uptime: string = '15天 7小时 23分钟';
@State isProcessing: boolean = false;
aboutToAppear() {
this.simulateProcessing();
}
simulateProcessing() {
this.isProcessing = true;
setTimeout(() => {
this.isProcessing = false;
}, 2000);
}
build() {
Column() {
// 顶部状态栏
Row() {
Button('🏠 返回首页')
.onClick(() => {
router.clear(); // API 20+ 正确的清除历史记录方法
router.pushUrl({
url: 'pages/Index'
}).catch((err: Error) => {
hilog.error(DOMAIN, 'Navigation', 'Failed to navigate home: %{public}s', JSON.stringify(err as object));
});
})
.margin(10)
.backgroundColor('#FF6B6B')
.fontSize(12)
Column() {
Text(this.pageTitle)
.fontSize(14)
.fontWeight(FontWeight.Bold)
Text('🎯 嵌套结构完整展示')
.fontSize(10)
.fontColor('#666666')
.margin({ top: 2 })
}
.layoutWeight(1)
Button('🔄 重新开始')
.onClick(() => {
router.clear(); // API 20+ 正确的清除历史记录方法
router.pushUrl({
url: 'pages/Level1Page'
}).catch((err: Error) => {
hilog.error(DOMAIN, 'Navigation', 'Failed to restart: %{public}s', JSON.stringify(err as object));
});
})
.margin(10)
.backgroundColor('#4ECDC4')
.fontSize(12)
}
.width('100%')
.height('10%')
.backgroundColor('#2D3436')
.padding({ left: 10, right: 10 })
// 主体内容滚动区域
Scroll() {
Column() {
// 系统概览
this.renderSystemOverview()
// 性能仪表板
this.renderPerformanceDashboard()
// 嵌套结构总结
this.renderNestingSummary()
// 技术栈展示
this.renderTechStack()
// 最终统计信息
this.renderFinalStats()
// 操作按钮组
this.renderActionButtons()
}
.width('100%')
.padding(15)
}
.layoutWeight(1)
// 底部信息栏
Row() {
if (this.isProcessing) {
LoadingProgress()
.width(20)
.height(20)
.margin({ right: 10 })
}
Text(`系统状态: ${this.systemStatus}`)
.fontSize(11)
.fontColor(this.systemStatus === '运行正常' ? '#4ECDC4' : '#FF6B6B')
Blank()
Text(`嵌套完成: 5/5 层 ✅`)
.fontSize(11)
.fontColor('#6C5CE7')
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('8%')
.backgroundColor('#34495E')
.padding({ left: 15, right: 15 })
}
.width('100%')
.height('100%')
.backgroundColor('#ECF0F1')
}
@Builder
renderSystemOverview() {
Column() {
Text('🚀 系统概览')
.fontSize(20)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
.fontColor('#2C3E50')
// 状态卡片网格
Grid() {
this.renderStatusCard('🔌 连接数', `${this.activeConnections}`, '#3498DB', '实时连接');
this.renderStatusCard('⏱️ 运行时长', this.uptime.split(' ')[0], '#2ECC71', '系统稳定');
this.renderStatusCard('🛡️ 安全等级', 'A+', '#E74C3C', '最高级别');
this.renderStatusCard('⚡ 响应时间', '<50ms', '#F39C12', '超高速');
}
.columnsTemplate('1fr 1fr')
.rowsTemplate('1fr 1fr')
.columnsGap(12)
.rowsGap(12)
.width('100%')
.height(180)
.margin({ bottom: 25 })
}
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(15)
.padding(20)
.margin({ bottom: 20 })
.shadow({ radius: 8, color: '#00000010', offsetX: 0, offsetY: 2 })
}
@Builder
renderStatusCard(title: string, value: string, color: string, subtitle: string) {
GridItem() {
Column() {
Text(value)
.fontSize(22)
.fontWeight(FontWeight.Bold)
.fontColor(color)
.margin({ bottom: 5 })
Text(title)
.fontSize(12)
.fontWeight(FontWeight.Medium)
.margin({ bottom: 3 })
Text(subtitle)
.fontSize(10)
.fontColor('#95A5A6')
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor('#F8F9FA')
.borderRadius(12)
.padding(10)
}
}
@Builder
renderPerformanceDashboard() {
Column() {
Text('📈 性能仪表板')
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
.fontColor('#2C3E50')
// 性能评分圆环
Row() {
// 主要评分
Column() {
// 模拟圆形进度条
Stack() {
Circle({ width: 120, height: 120 })
.fill('#ECF0F1')
.stroke('#BDC3C7')
.strokeWidth(10)
Circle({ width: 120, height: 120 })
.fill('#00000000')
.stroke(this.performanceScore > 90 ? '#2ECC71' :
this.performanceScore > 80 ? '#F39C12' : '#E74C3C')
.strokeWidth(10)
.strokeDashArray([Math.PI * 120 * (this.performanceScore / 100), Math.PI * 120])
Text(`${this.performanceScore}`)
.fontSize(24)
.fontWeight(FontWeight.Bold)
.fontColor('#2C3E50')
}
.width(120)
.height(120)
.margin({ bottom: 10 })
Text('综合性能评分')
.fontSize(12)
.fontColor('#7F8C8D')
}
.layoutWeight(1)
.justifyContent(FlexAlign.Center)
// 详细指标
Column() {
ForEach([
{ name: 'CPU效率', value: '94%', color: '#3498DB' },
{ name: '内存优化', value: '87%', color: '#2ECC71' },
{ name: 'IO性能', value: '91%', color: '#9B59B6' },
{ name: '网络延迟', value: '18ms', color: '#F39C12' }
], (metric: MetricItem) => {
Row() {
Circle({ width: 8, height: 8 })
.fill(metric.color)
.margin({ right: 8 })
Text(metric.name)
.fontSize(11)
.layoutWeight(1)
Text(metric.value)
.fontSize(11)
.fontWeight(FontWeight.Bold)
.fontColor(metric.color)
}
.width('100%')
.margin({ bottom: 8 })
})
}
.layoutWeight(1)
.padding({ left: 20 })
}
.width('100%')
.margin({ bottom: 20 })
}
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(15)
.padding(20)
.margin({ bottom: 20 })
.shadow({ radius: 8, color: '#00000010', offsetX: 0, offsetY: 2 })
}
@Builder
renderNestingSummary() {
Column() {
Text('📋 嵌套结构总结')
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
.fontColor('#2C3E50')
// 层级关系图
Column() {
ForEach([
{ level: 1, name: 'Level1Page', desc: '基础功能层', icon: '🏠' },
{ level: 2, name: 'Level2Page', desc: '交互增强层', icon: '📱' },
{ level: 3, name: 'Level3Page', desc: '数据处理层', icon: '📊' },
{ level: 4, name: 'Level4Page', desc: '高级功能层', icon: '🚀' },
{ level: 5, name: 'Level5Page', desc: '最终展示层', icon: '🏆' }
], (layer: LayerItem, index: number) => {
Row() {
// 层级标识
Column() {
Text(layer.icon)
.fontSize(18)
.margin({ bottom: 3 })
Text(`L${layer.level}`)
.fontSize(10)
.fontColor('#7F8C8D')
}
.width(50)
.justifyContent(FlexAlign.Center)
// 连接线
if (index < 4) {
Line()
.height(30)
.stroke('#3498DB')
.strokeWidth(2)
.margin({ left: 20, right: 20 })
} else {
Blank().width(60)
}
// 层级详情
Column() {
Text(layer.name)
.fontSize(14)
.fontWeight(FontWeight.Bold)
.fontColor('#2C3E50')
.margin({ bottom: 3 })
Text(layer.desc)
.fontSize(11)
.fontColor('#95A5A6')
}
.layoutWeight(1)
.padding({ right: 15 })
// 状态指示
Circle({ width: 12, height: 12 })
.fill('#2ECC71')
.margin({ right: 15 })
}
.width('100%')
.height(60)
.backgroundColor(index % 2 === 0 ? '#F8F9FA' : '#FFFFFF')
.borderRadius(8)
.padding({ left: 15, right: 15 })
.margin({ bottom: 5 })
})
}
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(12)
.padding(15)
.margin({ bottom: 20 })
// 统计信息
Row() {
this.renderStatBox('总页面数', '5', '📄');
this.renderStatBox('代码行数', '~1500+', '📝');
this.renderStatBox('预计体积', '~300MB', '📦');
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
}
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(15)
.padding(20)
.margin({ bottom: 20 })
.shadow({ radius: 8, color: '#00000010', offsetX: 0, offsetY: 2 })
}
@Builder
renderStatBox(title: string, value: string, icon: string) {
Column() {
Text(icon)
.fontSize(16)
.margin({ bottom: 5 })
Text(value)
.fontSize(14)
.fontWeight(FontWeight.Bold)
.fontColor('#3498DB')
.margin({ bottom: 3 })
Text(title)
.fontSize(10)
.fontColor('#7F8C8D')
}
.width('31%')
.height(60)
.backgroundColor('#F8F9FA')
.borderRadius(10)
.justifyContent(FlexAlign.Center)
.padding(8)
}
@Builder
renderTechStack() {
Column() {
Text('🛠️ 技术架构')
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
.fontColor('#2C3E50')
// 技术标签云
Flex({ wrap: FlexWrap.Wrap }) {
ForEach([
'HarmonyOS API 20', 'DevEco Studio 6.0', 'ArkTS', 'Compose UI',
'Native C++', 'Kotlin Multiplatform', 'Router Navigation', 'State Management',
'UI Components', 'Data Binding', 'Async Operations', 'Performance Monitoring'
], (tech: string) => {
Text(tech)
.fontSize(11)
.backgroundColor('#3498DB')
.fontColor('#FFFFFF')
.borderRadius(15)
.padding({ left: 12, right: 12, top: 6, bottom: 6 })
.margin(4)
})
}
.width('100%')
.margin({ bottom: 20 })
// 架构特点
Column() {
ForEach([
{ feature: '🧱 模块化设计', desc: '各层级职责清晰,便于维护扩展' },
{ feature: '🔗 深度嵌套', desc: '5层页面结构,满足复杂业务需求' },
{ feature: '⚡ 高性能', desc: '优化渲染和状态管理,流畅体验' },
{ feature: '🎨 现代UI', desc: 'Material Design风格,视觉统一' }
], (item: FeatureItem) => {
Row() {
Text(item.feature)
.fontSize(12)
.fontWeight(FontWeight.Bold)
.fontColor('#2C3E50')
.width(100)
.flexShrink(0)
Text(item.desc)
.fontSize(11)
.fontColor('#7F8C8D')
.layoutWeight(1)
}
.width('100%')
.margin({ bottom: 12 })
})
}
.width('100%')
}
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(15)
.padding(20)
.margin({ bottom: 20 })
.shadow({ radius: 8, color: '#00000010', offsetX: 0, offsetY: 2 })
}
@Builder
renderFinalStats() {
Column() {
Text('📊 项目统计')
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
.fontColor('#2C3E50')
Grid() {
ForEach([
{ title: '页面总数', value: '5', unit: '个', color: '#3498DB' },
{ title: '代码总量', value: '1500+', unit: '行', color: '#2ECC71' },
{ title: '组件数量', value: '50+', unit: '个', color: '#9B59B6' },
{ title: '功能模块', value: '20+', unit: '项', color: '#F39C12' },
{ title: '预计包体', value: '300', unit: 'MB', color: '#E74C3C' },
{ title: '开发耗时', value: '2', unit: '小时', color: '#1ABC9C' }
], (stat: StatItem) => {
GridItem() {
Column() {
Text(stat.value)
.fontSize(20)
.fontWeight(FontWeight.Bold)
.fontColor(stat.color)
.margin({ bottom: 5 })
Text(stat.title)
.fontSize(11)
.fontColor('#7F8C8D')
.margin({ bottom: 2 })
Text(stat.unit)
.fontSize(9)
.fontColor('#BDC3C7')
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor('#F8F9FA')
.borderRadius(10)
.padding(10)
}
})
}
.columnsTemplate('1fr 1fr 1fr')
.rowsTemplate('1fr 1fr')
.columnsGap(10)
.rowsGap(10)
.width('100%')
.height(140)
}
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(15)
.padding(20)
.margin({ bottom: 20 })
.shadow({ radius: 8, color: '#00000010', offsetX: 0, offsetY: 2 })
}
@Builder
renderActionButtons() {
Column() {
Text('🎯 操作中心')
.fontSize(18)
.fontWeight(FontWeight.Bold)
.margin({ bottom: 20 })
.fontColor('#2C3E50')
// 按钮网格
Grid() {
this.renderActionButton('📊 查看报告', '#3498DB', () => {});
this.renderActionButton('💾 导出数据', '#2ECC71', () => {});
this.renderActionButton('⚙️ 系统设置', '#9B59B6', () => {});
this.renderActionButton('❓ 帮助文档', '#F39C12', () => {});
this.renderActionButton('📤 反馈建议', '#E74C3C', () => {});
this.renderActionButton('⭐ 收藏项目', '#1ABC9C', () => {});
}
.columnsTemplate('1fr 1fr')
.rowsTemplate('1fr 1fr 1fr')
.columnsGap(12)
.rowsGap(12)
.width('100%')
.height(180)
}
.width('100%')
.backgroundColor('#FFFFFF')
.borderRadius(15)
.padding(20)
.shadow({ radius: 8, color: '#00000010', offsetX: 0, offsetY: 2 })
}
@Builder
renderActionButton(text: string, color: string, action: () => void) {
GridItem() {
Button(text)
.fontSize(12)
.fontColor('#FFFFFF')
.width('100%')
.height('100%')
.backgroundColor(color)
.borderRadius(10)
.onClick(() => {
action();
})
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment