From 1c8ec2d8e0f57e73efc3d927fb8dd88280614036 Mon Sep 17 00:00:00 2001 From: q30043944 Date: Sun, 2 Mar 2025 15:29:30 +0800 Subject: [PATCH] =?UTF-8?q?ux=E5=93=8D=E5=BA=94=E7=94=B5=E6=BA=90=E9=94=AE?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: q30043944 --- display/AppScope/app.json | 4 ++-- display/entry/src/main/ets/pages/ConfirmDialog.ets | 8 ++++++++ display/entry/src/main/ets/pages/PinDialog.ets | 12 ++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/display/AppScope/app.json b/display/AppScope/app.json index c4e9d0b90..bfc8e70ec 100644 --- a/display/AppScope/app.json +++ b/display/AppScope/app.json @@ -2,8 +2,8 @@ "app": { "bundleName": "com.ohos.devicemanagerui", "vendor": "example", - "versionCode": 1000035, - "versionName": "1.0.35", + "versionCode": 1000036, + "versionName": "1.0.36", "icon": "$media:app_icon", "label": "$string:app_name", "minAPIVersion": 10, diff --git a/display/entry/src/main/ets/pages/ConfirmDialog.ets b/display/entry/src/main/ets/pages/ConfirmDialog.ets index 43a0bd10a..fdbd39dfb 100644 --- a/display/entry/src/main/ets/pages/ConfirmDialog.ets +++ b/display/entry/src/main/ets/pages/ConfirmDialog.ets @@ -308,6 +308,14 @@ struct ConfirmCustomDialog { console.log(TAG + 'onKeyEvent eventType: ' + event?.type) this.onCancel(); } + if (event && event?.keyCode === KeyCode.KEYCODE_POWER && event?.type === KeyType.Down) { + console.log(TAG + 'onKeyEvent eventType: ' + event?.type) + return; + } + if (event && event?.keyCode === KeyCode.KEYCODE_POWER && event?.type === KeyType.Up) { + console.log(TAG + 'onKeyEvent eventType: ' + event?.type) + this.onCancel(); + } }) .onClick(() => { this.onCancel(); diff --git a/display/entry/src/main/ets/pages/PinDialog.ets b/display/entry/src/main/ets/pages/PinDialog.ets index df0408e3a..4c76df2a8 100644 --- a/display/entry/src/main/ets/pages/PinDialog.ets +++ b/display/entry/src/main/ets/pages/PinDialog.ets @@ -136,6 +136,18 @@ struct PinCustomDialog { this.cancel(); this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); } + if (event && event?.keyCode === KeyCode.KEYCODE_POWER && event?.type === KeyType.Down) { + console.log(TAG + 'onKeyEvent eventType: ' + event?.type) + return; + } + if (event && event?.keyCode === KeyCode.KEYCODE_POWER && event?.type === KeyType.Up) { + console.log(TAG + 'onKeyEvent eventType: ' + event?.type) + if (this.controller) { + this.controller.close(); + } + this.cancel(); + this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); + } }) .onClick(() => { if (this.controller) { -- Gitee