From 33a703987da4d1676025b1f8e806ce559b3a1348 Mon Sep 17 00:00:00 2001 From: Linkxu Date: Tue, 14 Oct 2025 20:54:17 +0800 Subject: [PATCH] Modify NativeDialogSample Signed-off-by: Linkxu --- .../entry/src/main/ets/pages/Index.ets | 4 +- .../entry/src/main/ets/pages/Index_API.ets | 216 +++++++++-------- .../entry/src/main/ets/pages/Index_func.ets | 218 ++++++++++-------- .../entry/src/main/module.json5 | 1 + ArkUIKit/NativeDialogSample/ohTest.md | 22 +- 5 files changed, 250 insertions(+), 211 deletions(-) diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets index c77c30176..fcd866845 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets +++ b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index.ets @@ -27,7 +27,7 @@ struct Index { Column() { Button('CustomDialogController_CAPI对接示例') .height(50) - .width('50%') + .width('85%') .margin({ top: 20, bottom: 10 }) .onClick(() => { router.push({ @@ -36,7 +36,7 @@ struct Index { }) Button('OpenCustomDialog_CAPI对接示例') .height(50) - .width('50%') + .width('85%') .margin({ top: 20, bottom: 10 }) .onClick(() => { router.push({ diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index_API.ets b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index_API.ets index eb3d489cc..d59acf147 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index_API.ets +++ b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index_API.ets @@ -13,8 +13,6 @@ * limitations under the License. */ import testNapi2 from 'libnativerender.so'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { common } from '@kit.AbilityKit'; enum ControllerAttributeType { Native_Background_Color = 1, // 背景颜色 @@ -63,12 +61,22 @@ struct Index { MenuItem({ content: '背景颜色:白色' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Background_Color; this.nodeValue = 0xFFFFFFFF; - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + const result : number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'Set the background color to white\n'; + }else{ + this.totalInfo += 'Failed to set background color\n'; + } }) MenuItem({ content: '圆角半径: 15' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Corner_Radius; this.nodeValue = 15; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'Set the corner radius: 15\n'; + }else{ + this.totalInfo += 'Failed to set border radius\n'; + } }) // 设置自定义弹窗对齐方式 MenuItem({ content: '设置弹窗对齐方式' }).width('50%').onChange(() => { @@ -76,7 +84,7 @@ struct Index { this.nodeType = ControllerAttributeType.Native_Content_Alignment; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'ARKUI_ALIGNMENT_TOP\n'; + this.totalInfo += 'Top center\n'; } else { this.totalInfo += 'Failed to set contentAlignment\n'; } @@ -89,7 +97,7 @@ struct Index { if (result === 0) { this.totalInfo += 'ARKUI_ALIGNMENT_CENTER\n'; } else { - this.totalInfo += 'Failed to ResetContentAlignment\n'; + this.totalInfo += 'Failed to reset content alignment\n'; } }) // 设置自定义弹窗是否开启模态样式的弹窗 @@ -104,18 +112,18 @@ struct Index { if (result === 0) { this.totalInfo += 'Set the overlay color to red\n'; } else { - this.totalInfo += 'Failed to setMask\n'; + this.totalInfo += 'Failed to set mask\n'; } }) // 设置弹窗宽度占栅格宽度的个数 MenuItem({ content: '设置弹窗宽度占栅格宽度的个数' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Column_Count; - this.nodeValue = 100; + this.nodeValue = 20; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { this.totalInfo += 'Set the number of grid widths that the popup occupies to 20\n'; } else { - this.totalInfo += 'Failed to setGridColumnCount\n'; + this.totalInfo += 'Failed to set grid column count\n'; } }) // 弹窗容器样式是否可以自定义 @@ -127,25 +135,35 @@ struct Index { this.nodeType = ControllerAttributeType.Native_Custom_Animation; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Apply custom transition effects to the modal\n'; + this.totalInfo += 'Not actually displayed\n'; } else { - this.totalInfo += 'Failed to enableCustomAnimation\n'; + this.totalInfo += 'Failed to enable custom animation\n'; } }) - // 当触发系统定义的返回操作、键盘ESC关闭交互操作时,如果注册了该回调函数,弹窗不会立即关闭,而是由用户决定是否关闭。 未涉及 - MenuItem({ content: '触发系统定义的返回操作失效' }).width('50%').onChange(() => { + // 当触发系统定义的返回操作、键盘ESC关闭交互操作时,如果注册了该回调函数,弹窗不会立即关闭,而是由用户决定是否关闭。 + MenuItem({ content: '系统返回操作关闭弹窗' }).width('50%').onChange(() => { this.nodeValue = 1; this.nodeType = ControllerAttributeType.Native_Register_OnWill_Dismiss; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'System-defined back navigation trigger fails to work\n'; + this.totalInfo += 'The system-defined back operation closes the dialog\n'; } else { this.totalInfo += 'Failed to registerOnWillDismiss\n'; } }) // 注册系统关闭自定义弹窗的监听事件 - MenuItem({ content: '注册系统关闭自定义弹窗的监听事件', builder: (): void => this.SubMenu_Register_OnWill_Dismiss_With_User_Data() }).width('50%') + MenuItem({ content: '注册系统关闭自定义弹窗的监听事件' }).width('50%').onChange(() => { + this.nodeValue = 1; + this.nodeType = ControllerAttributeType.Native_Register_OnWill_Dismiss_With_User_Data; + this.totalInfo += 'true\n'; + const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + if (result === 0) { + this.totalInfo += 'The system-defined back operation does not close the dialog\n'; + } else { + this.totalInfo += 'Failed to registerOnWillDismiss\n'; + } + }) // 设置弹窗的显示层级。 MenuItem({ content: '设置弹窗的显示层级', builder: (): void => this.SubMenu_Native_Level_Mode() }).width('50%') // 设置弹窗显示层级页面下的节点id @@ -156,7 +174,7 @@ struct Index { if (result === 0) { this.totalInfo += 'Sets the level uniqueId to 0 for a custom dialog box\n'; } else { - this.totalInfo += 'Failed to setLevelUniqueId\n'; + this.totalInfo += 'Failed to set level unique id\n'; } }) // 设置嵌入式弹窗蒙层的显示区域 @@ -167,7 +185,7 @@ struct Index { if (result === 0) { this.totalInfo += 'ARKUI_IMMERSIVE_MODE_DEFAULT\n'; } else { - this.totalInfo += 'Failed to setImmersiveMode\n'; + this.totalInfo += 'Failed to set immersive mode\n'; } }) //设置自定义弹窗显示的顺序 @@ -178,55 +196,85 @@ struct Index { if (result === 0) { this.totalInfo += 'Set the display order of the custom dialog box to 0\n'; } else { - this.totalInfo += 'Failed to setLevelOrder\n'; + this.totalInfo += 'Failed to set level order\n'; } }) // 设置自定义弹窗的边框颜色 MenuItem({ content: '边框颜色:黄色' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Border_Colors; this.nodeValue = 0xFFFFFF00; - testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + const result : number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'Set border color to yellow\n'; + }else{ + this.totalInfo += 'Failed to set border color\n'; + } }) // 设置自定义弹窗的边框样式 MenuItem({ content: '边框样式:点状' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Border_Style; this.nodeValue = 2; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set the border style to dotted\n'; - } else { - this.totalInfo += 'Failed to setBorderStyle\n'; + if (result === 0){ + this.totalInfo += 'Set border style to dotted\n'; + }else{ + this.totalInfo += 'Failed to set border style\n'; } }) // 设置自定义弹窗的背板阴影 MenuItem({ content: '背板阴影' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Backboard_Shadow; this.nodeValue = 0; - testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG\n'; + }else{ + this.totalInfo += 'Failed to set shadow\n'; + } }) // 设置自定义弹窗的背板阴影 MenuItem({ content: '自定义背板阴影' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Backboard_CustomShadow; this.nodeValue = 0; - testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'Set custom backboard shadow\n'; + }else{ + this.totalInfo += 'Failed to set custom backboard shadow\n'; + } }) // 设置自定义弹窗的背板模糊材质 MenuItem({ content: '背板模糊材质' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Background_Blur_Style; this.nodeValue = 0; - testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK\n'; + }else{ + this.totalInfo += 'Failed to set background blur style\n'; + } }) // 设置自定义弹窗避让键盘模式 - MenuItem({ content: '弹窗避让键盘模式', builder: (): void => this.SubMenu_Keyboard_Avoid_Mode() }).width('50%') + MenuItem({ content: '弹窗避让键盘模式' }).width('50%').onChange(() => { + this.nodeType = ControllerAttributeType.Native_Keyboard_Avoid_Mode; + this.nodeValue = 1; + this.isCreateKey = true; + const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); + if (result === 0) { + this.totalInfo += 'Do not avoid keyboard mode\n'; + } else { + this.totalInfo += 'Failed to set avoid keyboard mode\n'; + } + }) // 设置自定义弹窗是否响应悬停态 - MenuItem({ content: '是否响应悬停态' }).width('50%').onChange(() => { + MenuItem({ content: '响应悬停' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Hover_Mode_Enabled; this.nodeValue = 1; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { this.totalInfo += 'Effective only on foldable screens\n'; } else { - this.totalInfo += 'Failed to SetHoverModeEnabled\n'; + this.totalInfo += 'Failed to apply hover effect\n'; } }) // 设置悬停态下自定义弹窗默认展示区域 @@ -239,9 +287,9 @@ struct Index { this.nodeValue = 1; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Sets the background blur effect for a custom dialog box\n'; + this.totalInfo += 'Set background blur effect for the dialog\n'; } else { - this.totalInfo += 'Failed to SetBackgroundBlurStyleOptions\n'; + this.totalInfo += 'Failed to background blur effect\n'; } }) // 设置自定义弹窗的背景效果参数 @@ -250,9 +298,9 @@ struct Index { this.nodeValue = 1; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Sets the background effect parameters for a custom dialog box\n'; + this.totalInfo += 'Set background effect for the dialog\n'; } else { - this.totalInfo += 'Failed to SetBackgroundEffect\n'; + this.totalInfo += 'Failed to background effect\n'; } }) } @@ -264,23 +312,23 @@ struct Index { MenuItem({ content: '上半屏' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Hover_Mode_Area; this.nodeValue = 0; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Effective only on foldable screens\n'; + this.totalInfo += 'Popup defaults to upper screen area in hover state\n'; } else { - this.totalInfo += 'Failed to SetHoverModeEnabled\n'; + this.totalInfo += 'Failed to set hover mode\n'; } }) } Menu() { - MenuItem({ content: '上半屏' }).width('50%').onChange(() => { + MenuItem({ content: '下半屏' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Hover_Mode_Area; this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Effective only on foldable screens\n'; + this.totalInfo += 'Popup defaults to lower screen area in hover state\n'; } else { - this.totalInfo += 'Failed to SetHoverModeEnabled\n'; + this.totalInfo += 'Failed to set hover mode\n'; } }) } @@ -296,7 +344,7 @@ struct Index { if (result === 0) { this.totalInfo += 'Focus acquisition succeeded\n'; } else { - this.totalInfo += 'Failed to SetFocusable\n'; + this.totalInfo += 'Failed to set focusable\n'; } }) } @@ -306,9 +354,9 @@ struct Index { this.nodeValue = 0; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Failed to acquire focus\n'; + this.totalInfo += 'Disable focus acquisition\n'; } else { - this.totalInfo += 'Failed to SetFocusable\n'; + this.totalInfo += 'Failed to set focusable\n'; } }) } @@ -322,9 +370,9 @@ struct Index { this.nodeType = ControllerAttributeType.Native_Modal_Mode; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Open Modal\n'; + this.totalInfo += 'Set the dialog to modal mode\n'; } else { - this.totalInfo += 'Failed to Open Modal\n'; + this.totalInfo += 'Failed to set the dialog to modal mode\n'; } }) } @@ -334,9 +382,9 @@ struct Index { this.nodeType = ControllerAttributeType.Native_Modal_Mode; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Close Modal\n'; + this.totalInfo += 'Set the dialog to non-modal mode\n'; } else { - this.totalInfo += 'Failed to Close Modal\n'; + this.totalInfo += 'Failed to set the dialog to non-modal mode failed\n'; } }) } @@ -348,16 +396,12 @@ struct Index { MenuItem({ content: '是' }).width('50%').onChange(() => { this.nodeValue = 1; this.nodeType = ControllerAttributeType.Native_Auto_Cancel; - this.totalInfo += 'true\n'; - testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { this.totalInfo += 'Enable closing the modal via overlay click\n'; } else { - this.totalInfo += 'Failed to setAutoCancel\n'; + this.totalInfo += 'Failed to set auto cancel\n'; } - }) } Menu() { @@ -368,7 +412,7 @@ struct Index { if (result === 0) { this.totalInfo += 'Disable closing the modal via overlay click\n'; } else { - this.totalInfo += 'Failed to setAutoCancel\n'; + this.totalInfo += 'Failed to set auto cancel\n'; } }) } @@ -382,9 +426,9 @@ struct Index { this.nodeType = ControllerAttributeType.Native_Custom_Style; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Modal container style customization\n'; + this.totalInfo += 'Customize the pop-up container style to have no border\n'; } else { - this.totalInfo += 'Failed to setCustomStyle\n'; + this.totalInfo += 'Failed to set custom style\n'; } }) } @@ -394,39 +438,25 @@ struct Index { this.nodeType = ControllerAttributeType.Native_Custom_Style; const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'No customization of the modal container styles\n'; + this.totalInfo += 'Customize the pop-up container style to have border\n'; } else { - this.totalInfo += 'Failed to setCustomStyle\n'; + this.totalInfo += 'Failed to set custom style\n'; } }) } } - @Builder - SubMenu_Keyboard_Avoid_Mode() { - Menu() { - MenuItem({ content: '不避让' }).width('50%').onChange(() => { - this.nodeType = ControllerAttributeType.Native_Keyboard_Avoid_Mode; - this.nodeValue = 1; - testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - this.isCreateKey = true; - }) - } - } - @Builder SubMenu_Native_Level_Mode() { Menu() { MenuItem({ content: 'ARKUI_LEVEL_MODE_OVERLAY' }).width('50%').onChange(() => { this.nodeType = ControllerAttributeType.Native_Level_Mode; this.nodeValue = 0; - this.totalInfo += 'ARKUI_LEVEL_MODE_OVERLAY\n'; - testNapi2.setNativeDialog(this.nodeType, this.nodeValue); const result: number = testNapi2.setNativeDialog(this.nodeType, this.nodeValue); if (result === 0) { this.totalInfo += 'ARKUI_LEVEL_MODE_OVERLAY\n'; } else { - this.totalInfo += 'Failed to setLevelMode\n'; + this.totalInfo += 'Failed to set level mode\n'; } }) MenuItem({ content: 'ARKUI_LEVEL_MODE_EMBEDDED' }).width('50%').onChange(() => { @@ -436,24 +466,12 @@ struct Index { if (result === 0) { this.totalInfo += 'ARKUI_LEVEL_MODE_EMBEDDED\n'; } else { - this.totalInfo += 'Failed to setLevelMode\n'; + this.totalInfo += 'Failed to set level mode\n'; } }) } } - @Builder - SubMenu_Register_OnWill_Dismiss_With_User_Data() { - Menu() { - MenuItem({ content: '是' }).width('50%').onChange(() => { - this.nodeValue = 1; - this.nodeType = ControllerAttributeType.Native_Register_OnWill_Dismiss_With_User_Data; - this.totalInfo += 'true\n'; - testNapi2.setNativeDialog(this.nodeType, this.nodeValue); - }) - } - } - onPageShow(): void { testNapi2.setNapiCallback({ fromNapiCallWithStringParam: (value: string): void => { @@ -467,7 +485,7 @@ struct Index { Text('CustomDialogController_CAPI对接示例') .fontColor(0x0000FF) .height('10%') - .fontSize(24) + .fontSize(15) .margin(10) .fontWeight(FontWeight.Bold) Column({ space: 10 }) { @@ -496,29 +514,31 @@ struct Index { .onClick(() => { testNapi2.resetDialogController(); this.totalInfo = ' '; + this.isCreateKey = false; this.printDefaultText = false; }) .margin({ left: 70 }) } - Text('属性设置结果: \n' + this.totalInfo) + TextInput({ placeholder: 'Close modal → Set keyboard avoidance' }) + .placeholderColor(Color.Red) + .width('100%') + .height(40) + .margin(10) + .type(InputType.Password) + .maxLength(15) + .showPasswordIcon(true) + .visibility(this.isCreateKey?Visibility.Visible:Visibility.Hidden) + Text('弹框状态: \n' + this.stateInfos) .fontSize(15) .fontColor(0xCCCCCC) - .height(40) .width('100%') .margin({ left: 10 }) - Text('弹框状态: \n' + this.stateInfos) - .fontSize(20) + Text('属性设置结果: \n' + this.totalInfo) + .fontSize(15) .fontColor(0xCCCCCC) - .width('100%') - .margin({ left: 400 }) - TextInput({ placeholder: 'input your password...' }) - .width('95%') .height(40) - .margin(20) - .type(InputType.Password) - .maxLength(9) - .showPasswordIcon(true) - .visibility(this.isCreateKey ? Visibility.Visible : Visibility.Hidden) + .width('100%') + .margin({ left: 10 }) Button('点此打开弹窗') .width('40%') .height('10%') diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index_func.ets b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index_func.ets index 0e5b77085..3ad6edf96 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index_func.ets +++ b/ArkUIKit/NativeDialogSample/entry/src/main/ets/pages/Index_func.ets @@ -13,8 +13,6 @@ * limitations under the License. */ import testNapi2 from 'libnativerender.so'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { common } from '@kit.AbilityKit'; enum CustomDialogAttributeType { Background_Color = 1, // 背景颜色 @@ -56,22 +54,41 @@ struct Index { this.nodeType = CustomDialogAttributeType.Background_Color; this.nodeValue = 0xFFFF0000; const result : number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'Set the background color to red\n'; + }else{ + this.totalInfo += 'Failed to set background color\n'; + } }) MenuItem({ content: '圆角半径: 15' }).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Corner_Radius; this.nodeValue = 15; const result : number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'Set the corner radius: 15\n'; + }else{ + this.totalInfo += 'Failed to set border radius\n'; + } }) MenuItem({ content: '边框颜色:黄色' }).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Border_Colors; this.nodeValue = 0xFFFFFF00; const result : number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - + if (result === 0){ + this.totalInfo += 'Set border color to yellow\n'; + }else{ + this.totalInfo += 'Failed to set border color\n'; + } }) MenuItem({ content: '边框样式:点状' }).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Border_Style; this.nodeValue = 2; const result : number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'Set border style to dotted\n'; + }else{ + this.totalInfo += 'Failed to set border style\n'; + } }) MenuItem({ content: '背板阴影' }).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Backboard_shadow; @@ -80,7 +97,7 @@ struct Index { if (result === 0){ this.totalInfo += 'ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG\n'; }else{ - this.totalInfo += 'Failed to SetShadow\n'; + this.totalInfo += 'Failed to set shadow\n'; } }) // 设置自定义弹窗的背板阴影 @@ -91,7 +108,7 @@ struct Index { if (result === 0){ this.totalInfo += 'Set custom backboard shadow\n'; }else{ - this.totalInfo += 'Failed to SetCustomShadow\n'; + this.totalInfo += 'Failed to set custom backboard shadow\n'; } }) MenuItem({ content: '轻薄材质模糊' }).width('50%').onChange(()=> { @@ -101,36 +118,75 @@ struct Index { if (result === 0){ this.totalInfo += 'ARKUI_BLUR_STYLE_BACKGROUND_REGULAR\n'; }else{ - this.totalInfo += 'Failed to SetBackgroundBlurStyle\n'; + this.totalInfo += 'Failed to set background blur style\n'; } }) - MenuItem({ content: '对齐模式:垂直居中开始'}).width('50%').onChange(()=> { + MenuItem({ content: '对齐模式:底部开始'}).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Align_mode; this.nodeValue = 3; - testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0) { + this.totalInfo += 'Align content from the bottom\n'; + } else { + this.totalInfo += 'Failed to set alignment\n'; + } }) MenuItem({ content: '是否开启模态样式', builder: ():void=>this.SubMenu_Modal_Mode() }).width('50%') MenuItem({ content: '遮罩层退出', builder: ():void=>this.SubMenu_Auto_Cancel() }).width('50%') MenuItem({ content: '弹窗是否在子窗口显示此弹窗', builder: ():void=>this.SubMenu_Subwindow_Mode() }).width('50%') - MenuItem({ content: '自定义弹窗遮罩属性', builder: ():void=>this.SubMenu_Mask() }).width('50%') + MenuItem({ content: '自定义弹窗遮罩属性' }).width('50%').onChange(()=> { + this.nodeType = CustomDialogAttributeType.Mask; + this.nodeValue = 1; + const result : number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'Set mask property to red\n'; + }else{ + this.totalInfo += 'Failed to set mask property\n'; + } + }) MenuItem({ content: '避让键盘的模式', builder: ():void=>this.SubMenu_Keyboard_Avoid_Mode() }).width('50%') - MenuItem({ content: '是否响应悬停态' }).width('50%').onChange(()=> { + MenuItem({ content: '响应悬停' }).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Hover_Mode_Enabled; this.nodeValue = 1; const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); if (result === 0) { this.totalInfo += 'Effective only on foldable screens\n'; } else { - this.totalInfo += 'Failed to SetHoverModeEnabled\n'; + this.totalInfo += 'Failed to apply hover effect\n'; } }) MenuItem({ content: '悬停态下弹窗默认展示区域', builder: ():void=>this.SubMenu_Hover_Mode_Area() }).width('50%') - - MenuItem({ content: '背景模糊效果', builder: ():void=>this.SubMenu_Background_Blur_Style_Options() }).width('50%') - MenuItem({ content: '背景效果参数', builder: ():void=>this.SubMenu_Background_Effect() }).width('50%') - + MenuItem({ content: '背景模糊效果' }).width('50%').onChange(()=> { + this.nodeType = CustomDialogAttributeType.Background_Blur_Style_Options; + this.nodeValue = 1; + const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0) { + this.totalInfo += 'Set background blur effect for the dialog\n'; + } else { + this.totalInfo += 'Failed to background blur effect\n'; + } + }) + MenuItem({ content: '背景效果参数' }).width('50%').onChange(()=> { + this.nodeType = CustomDialogAttributeType.Background_Effect; + this.nodeValue = 1; + const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0) { + this.totalInfo += 'Set background effect for the dialog\n'; + } else { + this.totalInfo += 'Failed to background effect\n'; + } + }) MenuItem({ content: '设置弹窗的显示层级', builder: ():void=>this.SubMenu_Level_Mode() }).width('50%') - MenuItem({ content: '设置弹窗显示层级页面下的节点id', builder: ():void=>this.SubMenu_Level_Unique_Id() }).width('50%') + MenuItem({ content: '设置弹窗显示层级页面下的节点id:0' }).width('50%').onChange(()=> { + this.nodeType = CustomDialogAttributeType.Level_Unique_Id; + this.nodeValue = 0; + const result : number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'Set the level unique id to 0\n'; + }else{ + this.totalInfo += 'Failed to set level unique id\n'; + } + }) MenuItem({ content: '设置嵌入式弹窗蒙层的显示区域', builder: ():void=>this.SubMenu_Immersive_Mode() }).width('50%') MenuItem({ content: '注册系统关闭自定义弹窗的监听事件', builder: ():void=>this.SubMenu_Register_OnWill_Dismiss_Callback() }).width('50%') } @@ -194,27 +250,21 @@ struct Index { MenuItem({ content: '开启' }).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Subwindow_Mode; this.nodeValue = 1; - testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + const result : number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0){ + this.totalInfo += 'Set the pop-up window to display this pop-up window in a child window\n'; + }else{ + this.totalInfo += 'Failed to set subwindow mode\n'; + } }) MenuItem({ content: '关闭' }).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Subwindow_Mode; this.nodeValue = 0; - testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - }) - } - } - - @Builder - SubMenu_Mask() { - Menu() { - MenuItem({ content: '遮罩属性' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Mask; - this.nodeValue = 1; const result : number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); if (result === 0){ - this.totalInfo += 'Set mask property to red\n'; + this.totalInfo += 'Do not set up a pop-up window to display this pop-up window in a child window\n'; }else{ - this.totalInfo += 'Failed to set mask property\n'; + this.totalInfo += 'Failed to set subwindow mode\n'; } }) } @@ -226,14 +276,24 @@ struct Index { MenuItem({ content: '避让' }).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Keyboard_Avoid_Mode; this.nodeValue = 0; - testNapi2.setCustomDialog(this.nodeType, this.nodeValue); this.isCreateKey = true; + const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0) { + this.totalInfo += 'Avoid keyboard mode\n'; + } else { + this.totalInfo += 'Failed to set avoid keyboard mode\n'; + } }) MenuItem({ content: '不避让' }).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Keyboard_Avoid_Mode; this.nodeValue = 1; - testNapi2.setCustomDialog(this.nodeType, this.nodeValue); this.isCreateKey = true; + const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); + if (result === 0) { + this.totalInfo += 'Do not avoid keyboard mode\n'; + } else { + this.totalInfo += 'Failed to set avoid keyboard mode\n'; + } }) } } @@ -246,53 +306,26 @@ struct Index { this.nodeValue = 0; const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Effective only on foldable screens\n'; + this.totalInfo += 'Popup defaults to upper screen area in hover state\n'; } else { - this.totalInfo += 'Failed to SetHoverModeEnabled\n'; + this.totalInfo += 'Failed to set hover mode\n'; } }) } Menu() { - MenuItem({ content: '上半屏' }).width('50%').onChange(()=> { + MenuItem({ content: '下半屏' }).width('50%').onChange(()=> { this.nodeType = CustomDialogAttributeType.Hover_Mode_Area; this.nodeValue = 1; const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); if (result === 0) { - this.totalInfo += 'Effective only on foldable screens\n'; - } else { - this.totalInfo += 'Failed to SetHoverModeEnabled\n'; - } - }) - } - } - - @Builder - SubMenu_Background_Blur_Style_Options() { - Menu() { - MenuItem({ content: '是' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Background_Blur_Style_Options; - this.nodeValue = 1; - const result: number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0) { - this.totalInfo += 'Set background blur effect for the dialog\n'; + this.totalInfo += 'Popup defaults to lower screen area in hover state\n'; } else { - this.totalInfo += 'Failed to SetBackgroundBlurStyleOptions\n'; + this.totalInfo += 'Failed to set hover mode\n'; } }) } } - @Builder - SubMenu_Background_Effect() { - Menu() { - MenuItem({ content: '是' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Background_Effect; - this.nodeValue = 1; - testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - }) - } - } - @Builder SubMenu_Level_Mode() { Menu() { @@ -303,7 +336,7 @@ struct Index { if (result === 0){ this.totalInfo += 'ARKUI_LEVEL_MODE_OVERLAY\n'; }else{ - this.totalInfo += 'Failed to SetLevelMode\n'; + this.totalInfo += 'Failed to set level mode\n'; } }) MenuItem({ content: 'ARKUI_LEVEL_MODE_EMBEDDED' }).width('50%').onChange(()=> { @@ -313,23 +346,7 @@ struct Index { if (result === 0){ this.totalInfo += 'ARKUI_LEVEL_MODE_EMBEDDED\n'; }else{ - this.totalInfo += 'Failed to SetLevelMode\n'; - } - }) - } - } - - @Builder - SubMenu_Level_Unique_Id() { - Menu() { - MenuItem({ content: '0' }).width('50%').onChange(()=> { - this.nodeType = CustomDialogAttributeType.Level_Unique_Id; - this.nodeValue = 0; - const result : number = testNapi2.setCustomDialog(this.nodeType, this.nodeValue); - if (result === 0){ - this.totalInfo += 'SetLevelUniqueId succeeded\n'; - }else{ - this.totalInfo += 'ailed to SetLevelUniqueId\n'; + this.totalInfo += 'Failed to set level mode\n'; } }) } @@ -345,7 +362,7 @@ struct Index { if (result === 0){ this.totalInfo += 'ARKUI_IMMERSIVE_MODE_DEFAULT\n'; }else{ - this.totalInfo += 'Failed to SetImmersiveMode\n'; + this.totalInfo += 'Failed to set immersive mode\n'; } }) MenuItem({ content: 'ARKUI_IMMERSIVE_MODE_EXTEND' }).width('50%').onChange(()=> { @@ -355,7 +372,7 @@ struct Index { if (result === 0){ this.totalInfo += 'ARKUI_IMMERSIVE_MODE_EXTEND\n'; }else{ - this.totalInfo += 'Failed to SetImmersiveMode\n'; + this.totalInfo += 'Failed to set immersive mode\n'; } }) } @@ -371,7 +388,7 @@ struct Index { if (result === 0){ this.totalInfo += 'Registered already\n'; }else{ - this.totalInfo += 'Failed to RegisterOnWillDismissCallback\n'; + this.totalInfo += 'Failed to register OnWillDismissCallback\n'; } }) MenuItem({ content: '否' }).width('50%').onChange(()=> { @@ -382,7 +399,7 @@ struct Index { if (result === 0){ this.totalInfo += 'Not registered\n' }else{ - this.totalInfo += 'Failed to RegisterOnWillDismissCallback\n'; + this.totalInfo += 'Failed to register OnWillDismissCallback\n'; } }) } @@ -401,7 +418,7 @@ struct Index { Text('OpenCustomDialog_CAPI对接示例') .fontColor(0x0000FF) .height('10%') - .fontSize(24) + .fontSize(15) .margin(10) .fontWeight(FontWeight.Bold) Column({ space: 10 }) { @@ -435,25 +452,26 @@ struct Index { }) .margin({ left: 70 }) } - Text('属性设置结果: \n' + this.totalInfo) + TextInput({ placeholder: 'Close modal → Set keyboard avoidance' }) + .placeholderColor(Color.Red) + .width('100%') + .height(40) + .margin(10) + .type(InputType.Password) + .maxLength(15) + .showPasswordIcon(true) + .visibility(this.isCreateKey?Visibility.Visible:Visibility.Hidden) + Text('弹框状态: \n' + this.stateInfos) .fontSize(15) .fontColor(0xCCCCCC) - .height(40) .width('100%') .margin({ left: 10 }) - Text('弹框状态: \n' + this.stateInfos) - .fontSize(20) + Text('属性设置结果: \n' + this.totalInfo) + .fontSize(15) .fontColor(0xCCCCCC) - .width('100%') - .margin({ left: 400 }) - TextInput({ placeholder: 'input your password...' }) - .width('95%') .height(40) - .margin(20) - .type(InputType.Password) - .maxLength(9) - .showPasswordIcon(true) - .visibility(this.isCreateKey?Visibility.Visible:Visibility.Hidden) + .width('100%') + .margin({ left: 10 }) Button('点此打开弹窗') .width('40%') .height('10%') diff --git a/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 b/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 index 776ce0147..4854c6e60 100644 --- a/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 +++ b/ArkUIKit/NativeDialogSample/entry/src/main/module.json5 @@ -36,6 +36,7 @@ "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", "exported": true, + "orientation": "auto_rotation", "skills": [ { "entities": [ diff --git a/ArkUIKit/NativeDialogSample/ohTest.md b/ArkUIKit/NativeDialogSample/ohTest.md index 53b5d3c41..aeeceee91 100644 --- a/ArkUIKit/NativeDialogSample/ohTest.md +++ b/ArkUIKit/NativeDialogSample/ohTest.md @@ -16,17 +16,17 @@ | 设置弹窗背板圆角半径示例验证 | 应用位于首页 | 2.点击 .CustomDialogController_CAPI对接示例按钮
3.点击 设置属性按钮
4.点击 设置弹窗背板圆角半径。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击重置属性按钮 | 弹窗中的圆角比不设置任何属性点击打开弹窗是四边圆角值小 | 是 | Pass | | 设置弹窗宽度占栅格宽度的个数示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置弹窗宽度占栅格宽度的个数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the number of grid widths that the popup occupies to 20 | 是 | Pass | | 弹窗容器样式是否可以自定义示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗容器样式是否可以自定义。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 选择 是 点击弹框无边框
选择 否 点击弹框有边框 | 是 | Pass | -| 弹窗容器是否使用自定义弹窗动画示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗容器是否使用自定义弹窗动画。
4.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 属性设置结果显示
Apply custom transition effects to the modal | 是 | Pass | -| 触发系统定义的返回操作失效示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 触发系统定义的返回操作失效。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 屏幕下最下方的三角形返回按钮失效 | 是 | Pass | +| 弹窗容器是否使用自定义弹窗动画示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗容器是否使用自定义弹窗动画。
4.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 属性设置结果显示
Not actually displayed | 是 | Pass | +| 系统返回操作关闭弹窗示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 系统返回操作关闭弹窗。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
The system-defined back operation closes the dialog | 是 | Pass | | 显示弹框示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 显示弹框成功 | 是 | Pass | | 弹框关闭示例验证 | 应用位于首页 | 1.点击 .CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮
3.点击 弹框中Close Dialog 按钮 查看验证结果
4.点击 重置属性 按钮 | 显示弹框关闭成功 | 是 | Pass | | 弹窗避让键盘模式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式的弹窗 选择 否
4.点击 弹窗避让键盘模式
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 输出框最右边 显示出键盘
7.点击 弹框中Close Dialog 按钮
8.点击 重置属性按钮 | 键盘覆盖了弹窗 | 是 | Pass | | 设置弹窗的显示层级示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 选择 ARKUI_LEVEL_MODE_OVERLAY 。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示ARKUI_LEVEL_MODE_OVERLAY | 是 | Pass | | 设置弹窗的显示层级示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的显示层级 选择 ARKUI_LEVEL_MODE_EMBEDDED。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示ARKUI_LEVEL_MODE_EMBEDDED | 是 | Pass | -| 设置弹窗显示层级页面下的节点id示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击设置弹窗显示层级页面下的节点id。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Sets the level uniqueId to 0 for a custom dialog box | 是 | Pass | -| 设置嵌入式弹窗蒙层的显示区域示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置嵌入式弹窗蒙层的显示区域。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
ARKUI_IMMERSIVE_MODE_DEFAULT / ARKUI_IMMERSIVE_MODE_EXTEND | 是 | Pass | +| 设置弹窗显示层级页面下的节点id示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击设置弹窗显示层级页面下的节点id。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the level uniqueId to 0 for a custom dialog box | 是 | Pass | +| 设置嵌入式弹窗蒙层的显示区域示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置嵌入式弹窗蒙层的显示区域。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
ARKUI_IMMERSIVE_MODE_DEFAULT | 是 | Pass | | 设置自定义弹窗显示的顺序示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性
3.点击 设置自定义弹窗显示的顺序。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性 | 属性设置结果显示
Set the display order of the custom dialog box to 0 | 是 | Pass | -| 弹框状态变化示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮 | 显示弹框成功
弹框状态变化 (回调函数 实质不绘制) | 是 | Pass | +| 弹框状态变化示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框状态显示
DIALOG_UNINITIALIZED
DIALOG_INITIALIZED
DIALOG_APPEARING
DIALOG_DISAPPEARED | 是 | Pass | | 边框颜色示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框颜色:黄色。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框颜色为黄色 | 是 | Pass | | 边框样式示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 边框样式:点状。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框样式为点状 | 是 | Pass | | 默认边宽示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击点此打开弹窗按钮 查看验证结果
3.点击 重置属性按钮 | 显示弹窗有边宽
属性设置结果中 显示 width: 300vp | 是 | Pass | @@ -34,8 +34,8 @@ | 背板阴影示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板阴影。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 边框周围有阴影 | 是 | Pass | | 自定义弹窗的背板阴影示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义弹窗的背板阴影。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内为红色 边框周围有阴影 | 是 | Pass | | 背板模糊材质示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板模糊材质。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内为灰色 | 是 | Pass | -| 悬停态下自定义弹窗默认展示区域示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 悬停态下自定义弹窗默认展示区域 选择 上半屏 或 下半屏。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
Effective only on foldable screens | 是 | Pass | -| 是否响应悬停态示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否响应悬停态。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
Effective only on foldable screens | 是 | Pass | +| 悬停态下自定义弹窗默认展示区域示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 悬停态下自定义弹窗默认展示区域 选择 上半屏 或 下半屏。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
上半屏:Popup defaults to upper screen area in hover state 下半屏:Popup defaults to lower screen area in hover state | 是 | Pass | +| 响应悬停示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 响应悬停。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
Effective only on foldable screens | 是 | Pass | | 是否获取焦点示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式弹窗 选择否
4.点击 是否获取焦点 选择 是。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 点击输入框 打开键盘 点击弹框内区域 键盘自动回收 | 是 | Pass | | 是否获取焦点示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式弹窗 选择否
4.点击 是否获取焦点 选择 否。
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 点击输入框 打开键盘 点击弹框内区域 键盘不回收 | 是 | Pass | | 设置弹窗的背景模糊效果示例验证 | 应用位于首页 | 1.点击 CustomDialogController_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 设置弹窗的背景模糊效果。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 设置自定义弹窗的背景效果参数 | 是 | Pass | @@ -51,14 +51,14 @@ | 背板阴影示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背板阴影
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框有阴影 | 是 | Pass | | 自定义背板阴影示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义背板阴影
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框边框有阴影 弹框后有黑色边框 | 是 | Pass | | 背板材质示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 轻薄材质模糊
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变灰色 | 是 | Pass | -| 对齐模式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 对齐模式:垂直居中开始
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框垂直居中开始 | 是 | Pass | +| 对齐模式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 对齐模式:底部开始
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框底部开始 | 是 | Pass | | 是否开启模态样式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态样式 是/否
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 是 弹框边框外颜色无变化 否 弹框边框外颜色无变化 | 是 | Pass | | 弹窗是否在子窗口显示此弹窗示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 弹窗是否在子窗口显示此弹窗 开启/ 关闭
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 开启 再点设置属性栏 属性栏 在弹框页面下 关闭 再点设置属性栏 属性栏 在弹框页面下 | 是 | Pass | | 自定义弹窗遮罩属性 示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 自定义弹窗遮罩属性
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内外显示红色 | 是 | Pass | | 避让键盘的模式示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 是否开启模态 选择 否
4.点击 避让键盘的模式 避让 / 不避让
5.点击 点此打开弹窗按钮 查看验证结果
6.点击 弹框中Close Dialog 按钮
7.点击 重置属性按钮 | 不避让 弹框在 点击输入框打开显示键盘后 弹框不避让 避让 弹框在 点击输入框打开显示键盘后 弹框向上移动 进行避让键盘 | 是 | Pass | -| 是否响应悬停态示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮(仅折叠屏显示)
2.点击 设置属性按钮
3.点击 是否响应悬停态
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
Effective only on foldable screens | 是 | Pass | -| 悬停态下弹窗默认展示区域示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮(仅折叠屏显示)
2.点击 设置属性按钮
3点击 悬停态下弹窗默认展示区域 选择 上半屏 / 下半屏
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 上半屏 属性设置结果显示 ARKUI_LEVEL_MODE_OVERLAY 下半屏 属性设置结果显示 ARKUI_LEVEL_MODE_EMBEDDED | 是 | Pass | -| 注册系统关闭自定义弹窗的监听事件示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 注册系统关闭自定义弹窗的监听事件。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 屏幕最下方三角形系统返回 按键失效 | 是 | Pass | +| 响应悬停示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮(仅折叠屏显示)
2.点击 设置属性按钮
3.点击 响应悬停
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
Effective only on foldable screens | 是 | Pass | +| 悬停态下弹窗默认展示区域示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮(仅折叠屏显示)
2.点击 设置属性按钮
3点击 悬停态下弹窗默认展示区域 选择 上半屏 / 下半屏
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 属性设置结果显示
上半屏:Popup defaults to upper screen area in hover state 下半屏:Popup defaults to lower screen area in hover state | 是 | Pass | +| 注册系统关闭自定义弹窗的监听事件示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 注册系统关闭自定义弹窗的监听事件。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 系统返回操作失效 | 是 | Pass | | 弹框状态示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 点此打开弹窗按钮 查看验证结果
3.点击 弹框中Close Dialog 按钮
4.点击 重置属性按钮 | 弹框状态显示
DIALOG_UNINITIALIZED
DIALOG_INITIALIZED
DIALOG_APPEARING
DIALOG_DISAPPEARED | 是 | Pass | | 背景模糊效果示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景模糊效果。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变为深色 | 是 | Pass | | 背景效果参数示例验证 | 应用位于首页 | 1.点击 OpenCustomDialog_CAPI对接示例按钮
2.点击 设置属性按钮
3.点击 背景效果参数。
4.点击 点此打开弹窗按钮 查看验证结果
5.点击 弹框中Close Dialog 按钮
6.点击 重置属性按钮 | 弹框内变为深色 | 是 | Pass | -- Gitee