Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KMPMaxHap
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
dsq
KMPMaxHap
Commits
3bb6faef
Commit
3bb6faef
authored
Feb 12, 2026
by
dsq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
4d5ab609
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
226 additions
and
199 deletions
+226
-199
README.md
README.md
+11
-14
cleanup_hap_test_files.sh
cleanup_hap_test_files.sh
+7
-7
ComponentDemos.kt
...p/src/commonMain/kotlin/com.dong.maxhap/ComponentDemos.kt
+2
-4
HapPage.kt
...c/commonMain/kotlin/com.dong.maxhap/demos/test/HapPage.kt
+0
-106
Navigation.kt
...ommonMain/kotlin/com.dong.maxhap/navigation/Navigation.kt
+1
-1
generate_hap_test_files.sh
generate_hap_test_files.sh
+162
-24
libkn.so
harmonyApp/entry/libs/arm64-v8a/libkn.so
+0
-0
libkn_api.h
harmonyApp/entry/src/main/cpp/include/libkn_api.h
+43
-43
No files found.
README.md
View file @
3bb6faef
...
...
@@ -17,21 +17,17 @@ MaxHap/
项目提供了几个实用的脚本工具来帮助开发和测试:
### 1.
批量生成测试文件
脚本
### 1.
单文件批量生成Composable函数
脚本
#### generate_hap_test_files.sh
生成1000个Kotlin测试文件,每个文件包含1000个Text组件
。
在单个文件中生成1000个@Composable函数
。
**功能特性:**
-
生成1000个.kt文件(MaxFile0001.kt 到 MaxFile1000.kt)
-
每个文件以
`@Composable`
开头
-
包含
`internal fun Max{数字}()`
函数定义
-
使用指定的导入语句:
-
`import androidx.compose.foundation.layout.Column`
-
`import androidx.compose.material.Text`
-
`import androidx.compose.runtime.Composable`
-
每个函数包含1000个Text组件,被Column包裹
-
每个Text都有不同的颜色和字体大小(12sp-36sp)
-
生成1个大型.kt文件(BatchComposables.kt)
-
包含1000个独立的@Composable函数
-
每个函数都有独特的彩色文本内容
-
函数命名规范:BatchComposable1, BatchComposable2, ..., BatchComposable1000
-
文件大小约4.2MB,包含约138,000行代码
**使用方法:**
```
bash
...
...
@@ -122,6 +118,7 @@ hvigorw assembleHap
## 注意事项
1.
批量生成的测试文件主要用于应用体积测试
2.
清理脚本只会删除特定格式的文件(MaxFile
*
.kt)
3.
建议在使用清理脚本前备份重要数据
\ No newline at end of file
1.
嵌套页面结构可用于深度导航和递归调用测试
2.
1000层嵌套可能会对调用栈造成压力,请注意性能监控
3.
清理脚本会删除NestedPage
*
.kt和NestedPagesMain.kt文件
4.
建议在使用清理脚本前备份重要数据
\ No newline at end of file
cleanup_hap_test_files.sh
View file @
3bb6faef
#!/bin/bash
# 设置目标目录
TARGET_DIR
=
"composeApp/src/commonMain/kotlin/com/dong/maxhap/
HapTestPage
"
TARGET_DIR
=
"composeApp/src/commonMain/kotlin/com/dong/maxhap/
demos/test
"
# 检查目录是否存在
if
[
!
-d
"
$TARGET_DIR
"
]
;
then
...
...
@@ -10,17 +10,17 @@ if [ ! -d "$TARGET_DIR" ]; then
fi
# 统计要删除的文件数量
FILE_COUNT
=
$(
find
"
$TARGET_DIR
"
-name
"
MaxFil
e*.kt"
-type
f |
wc
-l
)
FILE_COUNT
=
$(
find
"
$TARGET_DIR
"
-name
"
NestedPag
e*.kt"
-type
f |
wc
-l
)
if
[
"
$FILE_COUNT
"
-eq
0
]
;
then
echo
"没有找到需要删除的
MaxFil
e*.kt文件"
echo
"没有找到需要删除的
NestedPag
e*.kt文件"
exit
0
fi
echo
"找到
$FILE_COUNT
个文件需要删除"
# 确认删除
echo
"警告:这将删除
$TARGET_DIR
目录下的所有
MaxFil
e*.kt 文件"
echo
"警告:这将删除
$TARGET_DIR
目录下的所有
NestedPag
e*.kt 文件"
read
-p
"是否继续?(y/N): "
-n
1
-r
echo
...
...
@@ -31,13 +31,13 @@ fi
# 删除文件
echo
"正在删除文件..."
find
"
$TARGET_DIR
"
-name
"
MaxFil
e*.kt"
-type
f
-delete
find
"
$TARGET_DIR
"
-name
"
NestedPag
e*.kt"
-type
f
-delete
# 检查删除结果
REMAINING_COUNT
=
$(
find
"
$TARGET_DIR
"
-name
"
MaxFil
e*.kt"
-type
f |
wc
-l
)
REMAINING_COUNT
=
$(
find
"
$TARGET_DIR
"
-name
"
NestedPag
e*.kt"
-type
f |
wc
-l
)
if
[
"
$REMAINING_COUNT
"
-eq
0
]
;
then
echo
"删除成功!所有
MaxFil
e*.kt文件已删除"
echo
"删除成功!所有
NestedPag
e*.kt文件已删除"
# 询问是否删除空目录
if
[
-z
"
$(
ls
-A
"
$TARGET_DIR
"
)
"
]
;
then
...
...
composeApp/src/commonMain/kotlin/com.dong.maxhap/ComponentDemos.kt
View file @
3bb6faef
...
...
@@ -21,7 +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
import
com.dong.maxhap.demos.test.
NestedPagesMain
@Composable
internal
fun
HomeScreen
(
...
...
@@ -147,7 +147,7 @@ internal fun DemoScreen(demo: ComponentDemo, onBack: () -> Unit) {
when
(
demo
.
id
)
{
// ui
"ui_box"
->
UiBoxDemo
()
"ui_hap"
->
HapPage
()
"ui_hap"
->
NestedPagesMain
()
// foundation
"foundation_basic_text"
->
FoundationBasicTextDemo
()
"foundation_lazy_column"
->
FoundationLazyColumnDemo
()
...
...
@@ -186,8 +186,6 @@ 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
)
...
...
composeApp/src/commonMain/kotlin/com.dong.maxhap/demos/test/HapPage.kt
deleted
100644 → 0
View file @
4d5ab609
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
import
com.dong.maxhap.demos.game.Game2048Screen
import
com.dong.maxhap.demos.game.SnakeGameScreen
import
com.dong.maxhap.demos.game.XiangqiScreen
@Composable
internal
fun
HapPage
()
{
var
showGame2048
by
remember
{
mutableStateOf
(
false
)
}
var
showSnakeGame
by
remember
{
mutableStateOf
(
false
)
}
var
showXiangqiGame
by
remember
{
mutableStateOf
(
false
)
}
// 如果要显示2048游戏,则渲染游戏界面
if
(
showGame2048
)
{
Game2048Screen
(
onBack
=
{
showGame2048
=
false
})
return
}
// 如果要显示贪吃蛇游戏,则渲染游戏界面
if
(
showSnakeGame
)
{
SnakeGameScreen
(
onBack
=
{
showSnakeGame
=
false
})
return
}
// 如果要显示象棋游戏,则渲染游戏界面
if
(
showXiangqiGame
)
{
XiangqiScreen
(
onBack
=
{
showXiangqiGame
=
false
})
return
}
Column
(
modifier
=
Modifier
.
fillMaxSize
()
.
padding
(
16
.
dp
),
horizontalAlignment
=
Alignment
.
CenterHorizontally
,
verticalArrangement
=
Arrangement
.
Top
)
{
Text
(
text
=
"🎮 小游戏中心"
,
fontSize
=
24
.
sp
,
fontWeight
=
FontWeight
.
Bold
,
modifier
=
Modifier
.
padding
(
bottom
=
20
.
dp
)
)
// 游戏按钮网格
Column
(
modifier
=
Modifier
.
fillMaxWidth
(),
verticalArrangement
=
Arrangement
.
spacedBy
(
12
.
dp
)
)
{
GameButton
(
text
=
"🧩 2048游戏"
,
color
=
Color
(
0
xFF4CAF50
),
onClick
=
{
showGame2048
=
true
}
)
GameButton
(
text
=
"🐍 贪吃蛇"
,
color
=
Color
(
0
xFF4CAF50
),
onClick
=
{
showSnakeGame
=
true
}
)
GameButton
(
text
=
"🔵🔴 五子棋"
,
color
=
Color
(
0
xFFFF9800
),
onClick
=
{
/* TODO: 跳转到五子棋游戏 */
}
)
GameButton
(
text
=
"🐘🐎 象棋"
,
color
=
Color
(
0
xFFF44336
),
onClick
=
{
showXiangqiGame
=
true
}
)
}
}
}
@Composable
private
fun
GameButton
(
text
:
String
,
color
:
Color
,
onClick
:
()
->
Unit
)
{
Button
(
onClick
=
onClick
,
modifier
=
Modifier
.
fillMaxWidth
()
.
height
(
60
.
dp
),
colors
=
ButtonDefaults
.
buttonColors
(
backgroundColor
=
color
)
)
{
Text
(
text
=
text
,
fontSize
=
18
.
sp
,
fontWeight
=
FontWeight
.
Medium
,
color
=
Color
.
White
)
}
}
\ No newline at end of file
composeApp/src/commonMain/kotlin/com.dong.maxhap/navigation/Navigation.kt
View file @
3bb6faef
...
...
@@ -12,7 +12,7 @@ data class ComponentDemo(
val
componentDemos
:
List
<
ComponentDemo
>
=
listOf
(
// ui
ComponentDemo
(
"ui_hap"
,
"
Hap测试
"
,
ComposeGroup
.
Ui
),
ComponentDemo
(
"ui_hap"
,
"
测试大批量页面
"
,
ComposeGroup
.
Ui
),
ComponentDemo
(
"ui_box"
,
"Box"
,
ComposeGroup
.
Ui
),
// foundation
ComponentDemo
(
"foundation_basic_text"
,
"BasicText"
,
ComposeGroup
.
Foundation
),
...
...
generate_hap_test_files.sh
View file @
3bb6faef
#!/bin/bash
# 设置目标目录
TARGET_DIR
=
"composeApp/src/commonMain/kotlin/com/dong/maxhap/
HapTestPage
"
TARGET_DIR
=
"composeApp/src/commonMain/kotlin/com/dong/maxhap/
demos/test
"
# 创建目录
mkdir
-p
"
$TARGET_DIR
"
# 生成1000个文件
for
i
in
$(
seq
1 1200
)
;
do
# 格式化文件名,确保4位数字
FILENAME
=
$(
printf
"MaxFile%04d.kt"
$i
)
# 设置总文件数量
TOTAL_FILES
=
200
# 从最后一个文件开始生成,实现嵌套结构
for
i
in
$(
seq
$TOTAL_FILES
-1
1
)
;
do
FILENAME
=
"NestedPage
${
i
}
.kt"
FILEPATH
=
"
$TARGET_DIR
/
$FILENAME
"
# 生成函数名
FUNCTION_NAME
=
"
Max
$i
"
FUNCTION_NAME
=
"
NestedPage
${
i
}
"
# 开始写入文件
echo
"import androidx.compose.foundation.layout.Column"
>
"
$FILEPATH
"
echo
"import androidx.compose.material.Text"
>>
"
$FILEPATH
"
echo
"import androidx.compose.runtime.Composable"
>>
"
$FILEPATH
"
echo
"package com.dong.maxhap.demos.test"
>
"
$FILEPATH
"
echo
""
>>
"
$FILEPATH
"
echo
"import androidx.compose.foundation.layout.*"
>>
"
$FILEPATH
"
echo
"import androidx.compose.material.*"
>>
"
$FILEPATH
"
echo
"import androidx.compose.runtime.*"
>>
"
$FILEPATH
"
echo
"import androidx.compose.ui.Alignment"
>>
"
$FILEPATH
"
echo
"import androidx.compose.ui.Modifier"
>>
"
$FILEPATH
"
echo
"import androidx.compose.ui.graphics.Color"
>>
"
$FILEPATH
"
echo
"import androidx.compose.ui.text.font.FontWeight"
>>
"
$FILEPATH
"
echo
"import androidx.compose.ui.unit.dp"
>>
"
$FILEPATH
"
echo
"import androidx.compose.ui.unit.sp"
>>
"
$FILEPATH
"
echo
""
>>
"
$FILEPATH
"
echo
"@Composable"
>>
"
$FILEPATH
"
echo
"internal fun
$FUNCTION_NAME
() {"
>>
"
$FILEPATH
"
echo
" Column {"
>>
"
$FILEPATH
"
# 生成1000个Text组件,每个有不同的颜色和大小
for
j
in
$(
seq
1 300
)
;
do
# 计算颜色值(基于索引生成不同颜色)
RED
=
$((
(
j
*
17
)
%
256
))
GREEN
=
$((
(
j
*
31
)
%
256
))
BLUE
=
$((
(
j
*
47
)
%
256
))
echo
" Text(
\"
这是测试
$j
\"
, color = androidx.compose.ui.graphics.Color(
$RED
,
$GREEN
,
$BLUE
))"
>>
"
$FILEPATH
"
# 添加状态管理(除了最后一个页面)
if
[
$i
-lt
$TOTAL_FILES
]
;
then
NEXT_PAGE_VAR
=
"showNextPage"
echo
" var
$NEXT_PAGE_VAR
by remember { mutableStateOf(false) }"
>>
"
$FILEPATH
"
echo
""
>>
"
$FILEPATH
"
echo
" if (
$NEXT_PAGE_VAR
) {"
>>
"
$FILEPATH
"
echo
" NestedPage
$((
i+1
))
()"
>>
"
$FILEPATH
"
echo
" return"
>>
"
$FILEPATH
"
echo
" }"
>>
"
$FILEPATH
"
echo
""
>>
"
$FILEPATH
"
fi
# 主要内容布局
echo
" Column("
>>
"
$FILEPATH
"
echo
" modifier = Modifier"
>>
"
$FILEPATH
"
echo
" .fillMaxSize()"
>>
"
$FILEPATH
"
echo
" .padding(16.dp),"
>>
"
$FILEPATH
"
echo
" horizontalAlignment = Alignment.CenterHorizontally,"
>>
"
$FILEPATH
"
echo
" verticalArrangement = Arrangement.Center"
>>
"
$FILEPATH
"
echo
" ) {"
>>
"
$FILEPATH
"
echo
" Text("
>>
"
$FILEPATH
"
echo
" text =
\"
第
${
i
}
层页面
\"
,"
>>
"
$FILEPATH
"
echo
" fontSize = 24.sp,"
>>
"
$FILEPATH
"
echo
" fontWeight = FontWeight.Bold,"
>>
"
$FILEPATH
"
echo
" color = Color(0xFF
${
i
}
0000),"
>>
"
$FILEPATH
"
echo
" modifier = Modifier.padding(bottom = 20.dp)"
>>
"
$FILEPATH
"
echo
" )"
>>
"
$FILEPATH
"
# 生成一些文本内容
for
j
in
$(
seq
1 15
)
;
do
LINE_NUM
=
$((
(
i
-
1
)
*
15
+
j
))
RED
=
$((
(
LINE_NUM
*
17
)
%
256
))
GREEN
=
$((
(
LINE_NUM
*
31
)
%
256
))
BLUE
=
$((
(
LINE_NUM
*
47
)
%
256
))
echo
" Text("
>>
"
$FILEPATH
"
echo
" text =
\"
这是第
${
LINE_NUM
}
行内容
\"
,"
>>
"
$FILEPATH
"
echo
" fontSize = 16.sp,"
>>
"
$FILEPATH
"
echo
" color = Color(
$RED
,
$GREEN
,
$BLUE
),"
>>
"
$FILEPATH
"
echo
" modifier = Modifier.padding(vertical = 4.dp)"
>>
"
$FILEPATH
"
echo
" )"
>>
"
$FILEPATH
"
done
# 结束Column
# 添加导航按钮(除了最后一个页面)
if
[
$i
-lt
$TOTAL_FILES
]
;
then
echo
""
>>
"
$FILEPATH
"
echo
" Spacer(modifier = Modifier.height(30.dp))"
>>
"
$FILEPATH
"
echo
""
>>
"
$FILEPATH
"
echo
" Button("
>>
"
$FILEPATH
"
echo
" onClick = {
$NEXT_PAGE_VAR
= true },"
>>
"
$FILEPATH
"
echo
" modifier = Modifier"
>>
"
$FILEPATH
"
echo
" .fillMaxWidth()"
>>
"
$FILEPATH
"
echo
" .height(50.dp),"
>>
"
$FILEPATH
"
echo
" colors = ButtonDefaults.buttonColors("
>>
"
$FILEPATH
"
echo
" backgroundColor = Color(0xFF2196F3)"
>>
"
$FILEPATH
"
echo
" )"
>>
"
$FILEPATH
"
echo
" ) {"
>>
"
$FILEPATH
"
echo
" Text("
>>
"
$FILEPATH
"
echo
" text =
\"
进入第
$((
i+1
))
层
\"
,"
>>
"
$FILEPATH
"
echo
" fontSize = 18.sp,"
>>
"
$FILEPATH
"
echo
" fontWeight = FontWeight.Medium,"
>>
"
$FILEPATH
"
echo
" color = Color.White"
>>
"
$FILEPATH
"
echo
" )"
>>
"
$FILEPATH
"
echo
" }"
>>
"
$FILEPATH
"
else
# 最后一层显示结束信息
echo
""
>>
"
$FILEPATH
"
echo
" Spacer(modifier = Modifier.height(30.dp))"
>>
"
$FILEPATH
"
echo
" Text("
>>
"
$FILEPATH
"
echo
" text =
\"
已到达最深层(第
${
TOTAL_FILES
}
层)
\"
,"
>>
"
$FILEPATH
"
echo
" fontSize = 16.sp,"
>>
"
$FILEPATH
"
echo
" color = Color.Gray,"
>>
"
$FILEPATH
"
echo
" modifier = Modifier.padding(20.dp)"
>>
"
$FILEPATH
"
echo
" )"
>>
"
$FILEPATH
"
fi
# 结束函数
# 结束Column和函数
echo
" }"
>>
"
$FILEPATH
"
echo
"}"
>>
"
$FILEPATH
"
# 显示进度
if
[
$((
i
%
100
))
-eq
0
]
;
then
echo
"已生成
$
i
个文件"
if
[
$((
TOTAL_FILES
-
i
+
1
%
100
))
-eq
0
]
;
then
echo
"已生成
$
((
TOTAL_FILES
-
i
+
1
))
个文件"
fi
done
echo
"成功生成 1000 个 Kotlin 文件到
$TARGET_DIR
目录"
\ No newline at end of file
# 创建主入口文件
MAIN_FILE
=
"
$TARGET_DIR
/NestedPagesMain.kt"
echo
"package com.dong.maxhap.demos.test"
>
"
$MAIN_FILE
"
echo
""
>>
"
$MAIN_FILE
"
echo
"import androidx.compose.foundation.layout.*"
>>
"
$MAIN_FILE
"
echo
"import androidx.compose.material.*"
>>
"
$MAIN_FILE
"
echo
"import androidx.compose.runtime.*"
>>
"
$MAIN_FILE
"
echo
"import androidx.compose.ui.Alignment"
>>
"
$MAIN_FILE
"
echo
"import androidx.compose.ui.Modifier"
>>
"
$MAIN_FILE
"
echo
"import androidx.compose.ui.graphics.Color"
>>
"
$MAIN_FILE
"
echo
"import androidx.compose.ui.text.font.FontWeight"
>>
"
$MAIN_FILE
"
echo
"import androidx.compose.ui.unit.dp"
>>
"
$MAIN_FILE
"
echo
"import androidx.compose.ui.unit.sp"
>>
"
$MAIN_FILE
"
echo
""
>>
"
$MAIN_FILE
"
echo
"@Composable"
>>
"
$MAIN_FILE
"
echo
"internal fun NestedPagesMain() {"
>>
"
$MAIN_FILE
"
echo
" var showFirstPage by remember { mutableStateOf(false) }"
>>
"
$MAIN_FILE
"
echo
""
>>
"
$MAIN_FILE
"
echo
" if (showFirstPage) {"
>>
"
$MAIN_FILE
"
echo
" NestedPage1()"
>>
"
$MAIN_FILE
"
echo
" return"
>>
"
$MAIN_FILE
"
echo
" }"
>>
"
$MAIN_FILE
"
echo
""
>>
"
$MAIN_FILE
"
echo
" Column("
>>
"
$MAIN_FILE
"
echo
" modifier = Modifier"
>>
"
$MAIN_FILE
"
echo
" .fillMaxSize()"
>>
"
$MAIN_FILE
"
echo
" .padding(16.dp),"
>>
"
$MAIN_FILE
"
echo
" horizontalAlignment = Alignment.CenterHorizontally,"
>>
"
$MAIN_FILE
"
echo
" verticalArrangement = Arrangement.Center"
>>
"
$MAIN_FILE
"
echo
" ) {"
>>
"
$MAIN_FILE
"
echo
" Text("
>>
"
$MAIN_FILE
"
echo
" text =
\"
嵌套页面演示
\"
,"
>>
"
$MAIN_FILE
"
echo
" fontSize = 28.sp,"
>>
"
$MAIN_FILE
"
echo
" fontWeight = FontWeight.Bold,"
>>
"
$MAIN_FILE
"
echo
" color = Color(0xFF2196F3),"
>>
"
$MAIN_FILE
"
echo
" modifier = Modifier.padding(bottom = 30.dp)"
>>
"
$MAIN_FILE
"
echo
" )"
>>
"
$MAIN_FILE
"
echo
""
>>
"
$MAIN_FILE
"
echo
" Text("
>>
"
$MAIN_FILE
"
echo
" text =
\"
共包含
$TOTAL_FILES
层嵌套页面
\"
,"
>>
"
$MAIN_FILE
"
echo
" fontSize = 16.sp,"
>>
"
$MAIN_FILE
"
echo
" modifier = Modifier.padding(bottom = 20.dp)"
>>
"
$MAIN_FILE
"
echo
" )"
>>
"
$MAIN_FILE
"
echo
""
>>
"
$MAIN_FILE
"
echo
" Button("
>>
"
$MAIN_FILE
"
echo
" onClick = { showFirstPage = true },"
>>
"
$MAIN_FILE
"
echo
" modifier = Modifier"
>>
"
$MAIN_FILE
"
echo
" .fillMaxWidth()"
>>
"
$MAIN_FILE
"
echo
" .height(50.dp),"
>>
"
$MAIN_FILE
"
echo
" colors = ButtonDefaults.buttonColors("
>>
"
$MAIN_FILE
"
echo
" backgroundColor = Color(0xFF4CAF50)"
>>
"
$MAIN_FILE
"
echo
" )"
>>
"
$MAIN_FILE
"
echo
" ) {"
>>
"
$MAIN_FILE
"
echo
" Text("
>>
"
$MAIN_FILE
"
echo
" text =
\"
开始嵌套之旅
\"
,"
>>
"
$MAIN_FILE
"
echo
" fontSize = 18.sp,"
>>
"
$MAIN_FILE
"
echo
" fontWeight = FontWeight.Medium,"
>>
"
$MAIN_FILE
"
echo
" color = Color.White"
>>
"
$MAIN_FILE
"
echo
" )"
>>
"
$MAIN_FILE
"
echo
" }"
>>
"
$MAIN_FILE
"
echo
" }"
>>
"
$MAIN_FILE
"
echo
"}"
>>
"
$MAIN_FILE
"
echo
"成功生成
$TOTAL_FILES
个嵌套页面文件到
$TARGET_DIR
目录"
echo
"主入口函数: NestedPagesMain()"
\ No newline at end of file
harmonyApp/entry/libs/arm64-v8a/libkn.so
View file @
3bb6faef
No preview for this file type
harmonyApp/entry/src/main/cpp/include/libkn_api.h
View file @
3bb6faef
...
...
@@ -181,6 +181,7 @@ typedef struct {
libkn_KNativePtr
pinned
;
}
libkn_kref_com_dong_maxhap_OhosPlatform
;
extern
void
*
MainArkUIViewController
(
void
*
env
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_aboutToAppear
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_aboutToDisappear
(
void
*
controllerRef
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_cancelSyncRefresh
(
void
*
controllerRef
,
libkn_KInt
refreshId
);
...
...
@@ -213,7 +214,6 @@ extern void androidx_compose_ui_arkui_ArkUIViewController_setRootView(void* cont
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setUIContext
(
void
*
controllerRef
,
void
*
uiContext
);
extern
void
androidx_compose_ui_arkui_ArkUIViewController_setXComponentRender
(
void
*
controllerRef
,
void
*
render
);
extern
void
androidx_compose_ui_arkui_init
(
void
*
env
,
void
*
exports
);
extern
void
*
MainArkUIViewController
(
void
*
env
);
typedef
struct
{
/* Service functions. */
...
...
@@ -249,48 +249,6 @@ typedef struct {
/* User functions. */
struct
{
struct
{
struct
{
struct
{
struct
{
struct
{
struct
{
void
(
*
_Export_ArkUIViewController_aboutToAppear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_aboutToDisappear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_cancelSyncRefresh
)(
void
*
controllerRef
,
libkn_KInt
refreshId
);
void
(
*
_Export_ArkUIViewController_dispatchHoverEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_dispatchMouseEvent
)(
void
*
controllerRef
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_dispatchTouchEvent
)(
void
*
controllerRef
,
void
*
nativeTouchEvent
,
libkn_KBoolean
ignoreInteropView
);
const
char
*
(
*
_Export_ArkUIViewController_getId
)(
void
*
controllerRef
);
void
*
(
*
_Export_ArkUIViewController_getXComponentRender
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_keyboardWillHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_keyboardWillShow
)(
void
*
controllerRef
,
libkn_KFloat
keyboardHeight
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_onBackPress
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFinalize
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFocusEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFrame
)(
void
*
controllerRef
,
libkn_KLong
timestamp
,
libkn_KLong
targetTimestamp
);
void
(
*
_Export_ArkUIViewController_onKeyEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageShow
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceChanged
)(
void
*
controllerRef
,
libkn_KInt
width
,
libkn_KInt
height
);
void
(
*
_Export_ArkUIViewController_onSurfaceCreated
)(
void
*
controllerRef
,
void
*
xcomponentPtr
,
libkn_KInt
width
,
libkn_KInt
height
);
void
(
*
_Export_ArkUIViewController_onSurfaceDestroyed
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceShow
)(
void
*
controllerRef
);
libkn_KInt
(
*
_Export_ArkUIViewController_requestSyncRefresh
)(
void
*
controllerRef
);
const
char
*
(
*
_Export_ArkUIViewController_sendMessage
)(
void
*
controllerRef
,
const
char
*
type
,
const
char
*
message
);
void
(
*
_Export_ArkUIViewController_setContext
)(
void
*
controllerRef
,
void
*
context
);
void
(
*
_Export_ArkUIViewController_setEnv
)(
void
*
controllerRef
,
void
*
env
);
void
(
*
_Export_ArkUIViewController_setId
)(
void
*
controllerRef
,
const
char
*
id
);
void
(
*
_Export_ArkUIViewController_setMessenger
)(
void
*
controllerRef
,
void
*
messenger
);
void
(
*
_Export_ArkUIViewController_setRootView
)(
void
*
controllerRef
,
void
*
backRootView
,
void
*
foreRootView
,
void
*
touchableRootView
);
void
(
*
_Export_ArkUIViewController_setUIContext
)(
void
*
controllerRef
,
void
*
uiContext
);
void
(
*
_Export_ArkUIViewController_setXComponentRender
)(
void
*
controllerRef
,
void
*
render
);
void
(
*
_Export_ArkUIViewInitializer_init
)(
void
*
env
,
void
*
exports
);
}
arkui
;
}
ui
;
}
export_
;
}
compose
;
}
androidx
;
struct
{
struct
{
struct
{
...
...
@@ -592,6 +550,48 @@ typedef struct {
}
maxhap
;
}
dong
;
}
com
;
struct
{
struct
{
struct
{
struct
{
struct
{
void
(
*
_Export_ArkUIViewController_aboutToAppear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_aboutToDisappear
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_cancelSyncRefresh
)(
void
*
controllerRef
,
libkn_KInt
refreshId
);
void
(
*
_Export_ArkUIViewController_dispatchHoverEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_dispatchMouseEvent
)(
void
*
controllerRef
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_dispatchTouchEvent
)(
void
*
controllerRef
,
void
*
nativeTouchEvent
,
libkn_KBoolean
ignoreInteropView
);
const
char
*
(
*
_Export_ArkUIViewController_getId
)(
void
*
controllerRef
);
void
*
(
*
_Export_ArkUIViewController_getXComponentRender
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_keyboardWillHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_keyboardWillShow
)(
void
*
controllerRef
,
libkn_KFloat
keyboardHeight
);
libkn_KBoolean
(
*
_Export_ArkUIViewController_onBackPress
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFinalize
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFocusEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onFrame
)(
void
*
controllerRef
,
libkn_KLong
timestamp
,
libkn_KLong
targetTimestamp
);
void
(
*
_Export_ArkUIViewController_onKeyEvent
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onPageShow
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceChanged
)(
void
*
controllerRef
,
libkn_KInt
width
,
libkn_KInt
height
);
void
(
*
_Export_ArkUIViewController_onSurfaceCreated
)(
void
*
controllerRef
,
void
*
xcomponentPtr
,
libkn_KInt
width
,
libkn_KInt
height
);
void
(
*
_Export_ArkUIViewController_onSurfaceDestroyed
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceHide
)(
void
*
controllerRef
);
void
(
*
_Export_ArkUIViewController_onSurfaceShow
)(
void
*
controllerRef
);
libkn_KInt
(
*
_Export_ArkUIViewController_requestSyncRefresh
)(
void
*
controllerRef
);
const
char
*
(
*
_Export_ArkUIViewController_sendMessage
)(
void
*
controllerRef
,
const
char
*
type
,
const
char
*
message
);
void
(
*
_Export_ArkUIViewController_setContext
)(
void
*
controllerRef
,
void
*
context
);
void
(
*
_Export_ArkUIViewController_setEnv
)(
void
*
controllerRef
,
void
*
env
);
void
(
*
_Export_ArkUIViewController_setId
)(
void
*
controllerRef
,
const
char
*
id
);
void
(
*
_Export_ArkUIViewController_setMessenger
)(
void
*
controllerRef
,
void
*
messenger
);
void
(
*
_Export_ArkUIViewController_setRootView
)(
void
*
controllerRef
,
void
*
backRootView
,
void
*
foreRootView
,
void
*
touchableRootView
);
void
(
*
_Export_ArkUIViewController_setUIContext
)(
void
*
controllerRef
,
void
*
uiContext
);
void
(
*
_Export_ArkUIViewController_setXComponentRender
)(
void
*
controllerRef
,
void
*
render
);
void
(
*
_Export_ArkUIViewInitializer_init
)(
void
*
env
,
void
*
exports
);
}
arkui
;
}
ui
;
}
export_
;
}
compose
;
}
androidx
;
struct
{
struct
{
struct
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment