From 5d5e8ef075c9511a03cc99b1faf3ac192348315e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 5 Sep 2025 02:11:06 +0000 Subject: [PATCH 1/9] update display/AppScope/app.json. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- display/AppScope/app.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/display/AppScope/app.json b/display/AppScope/app.json index aae3daefc..74c4badf4 100644 --- a/display/AppScope/app.json +++ b/display/AppScope/app.json @@ -2,8 +2,8 @@ "app": { "bundleName": "com.ohos.devicemanagerui", "vendor": "example", - "versionCode": 1000049, - "versionName": "1.0.49", + "versionCode": 1000050, + "versionName": "1.0.50", "icon": "$media:app_icon", "label": "$string:app_name", "minAPIVersion": 10, -- Gitee From ec875259afc30a89248de31ac671cc1a62c625ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 5 Sep 2025 02:11:37 +0000 Subject: [PATCH 2/9] update display/entry/src/main/ets/pages/ConfirmDialogTv.ets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- .../src/main/ets/pages/ConfirmDialogTv.ets | 106 +++++++----------- 1 file changed, 41 insertions(+), 65 deletions(-) diff --git a/display/entry/src/main/ets/pages/ConfirmDialogTv.ets b/display/entry/src/main/ets/pages/ConfirmDialogTv.ets index 165a2b203..be68240ea 100644 --- a/display/entry/src/main/ets/pages/ConfirmDialogTv.ets +++ b/display/entry/src/main/ets/pages/ConfirmDialogTv.ets @@ -23,7 +23,6 @@ import { KeyCode } from '@ohos.multimodalInput.keyCode'; let dmClass: deviceManager.DeviceManager | null; let TAG = '[DeviceManagerUI:ConfirmDialog]==>'; -let metaType: number = 11; const ACTION_ALLOW_AUTH_ONCE: number = 0; const ACTION_CANCEL_AUTH: number = 1; const ACTION_AUTH_CONFIRM_TIMEOUT: number = 2; @@ -50,7 +49,7 @@ struct ConfirmCustomDialog { @State isAvailableType: boolean = false; @State btnColor: ResourceColor = Color.Transparent; @State title: string = ''; - @State mLocalWidth: number = 0; + @State mLocalWidth: number = 1; controller?: CustomDialogController; isPC: boolean = false; aboutToAppear() { @@ -60,7 +59,7 @@ struct ConfirmCustomDialog { this.mLocalWidth = display.getDefaultDisplaySync().width; } catch (err) { console.error('Failed to get display width:', err); - this.mLocalWidth = 0; + this.mLocalWidth = 1; } let context = getContext() as common.UIAbilityContext; @@ -87,10 +86,6 @@ struct ConfirmCustomDialog { this.peerCustomDescription = context.resourceManager.getStringSync($r('app.string.dm_confirm_intention').id); } - if (AppStorage.get('metaType') != null) { - metaType = AppStorage.get('metaType') as number; - } - if (AppStorage.get('deviceType') != null) { this.peerDeviceType = AppStorage.get('deviceType') as number; console.log('peerDeviceType is ' + this.peerDeviceType); @@ -102,11 +97,7 @@ struct ConfirmCustomDialog { if (this.secondsNum === 0) { clearInterval(this.times); this.times = 0; - const param = { - 'META_TYPE': metaType - }; - const jsonStr = JSON.stringify(param); - this.setUserOperation(ACTION_AUTH_CONFIRM_TIMEOUT, jsonStr); + this.setUserOperation(ACTION_AUTH_CONFIRM_TIMEOUT); this.destruction(); console.info('click cancel times run out'); } @@ -123,11 +114,7 @@ struct ConfirmCustomDialog { } console.log('allow once' + ACTION_ALLOW_AUTH_ONCE) - const param = { - 'META_TYPE': metaType - }; - const jsonStr = JSON.stringify(param); - this.setUserOperation(ACTION_ALLOW_AUTH_ONCE, jsonStr) + this.setUserOperation(ACTION_ALLOW_AUTH_ONCE) this.destruction() } @@ -139,11 +126,7 @@ struct ConfirmCustomDialog { } console.log('allow always' + ACTION_ALLOW_AUTH_ALWAYS) - const param = { - 'META_TYPE': metaType - }; - const jsonStr = JSON.stringify(param); - this.setUserOperation(ACTION_ALLOW_AUTH_ALWAYS, jsonStr) + this.setUserOperation(ACTION_ALLOW_AUTH_ALWAYS) this.destruction() } @@ -155,22 +138,18 @@ struct ConfirmCustomDialog { } console.log('cancel' + ACTION_CANCEL_AUTH) - const param = { - 'META_TYPE': metaType - }; - const jsonStr = JSON.stringify(param); - this.setUserOperation(ACTION_CANCEL_AUTH, jsonStr) + this.setUserOperation(ACTION_CANCEL_AUTH) this.destruction() } - setUserOperation(operation: number, param: string) { + setUserOperation(operation: number) { console.log(TAG + 'setUserOperation: ' + operation) if (dmClass == null) { console.log(TAG + 'setUserOperation: ' + 'dmClass null') return; } try { - dmClass.setUserOperation(operation, param); + dmClass.setUserOperation(operation, 'extra'); } catch (error) { console.log(TAG + 'dmClass setUserOperation failed') } @@ -220,13 +199,13 @@ struct ConfirmCustomDialog { Shape() { Column() { SymbolGlyph(this.getImages(this.peerDeviceType)) - .fontSize('70vp') + .fontSize('74vp') .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY) .fontColor(['#E5FFFFFF']) } } .visibility(this.isAvailableType ? Visibility.Visible : Visibility.None) - .margin({ bottom: '24vp', top: '24vp' }) + .margin({ bottom: '32vp', top: '32vp' }) } private isTibetanLanguages(): boolean { @@ -248,7 +227,7 @@ struct ConfirmCustomDialog { Column() { Text(this.title) .textAlign(TextAlign.Center) - .fontSize('16fp') + .fontSize('22fp') .fontWeight(FontWeight.Regular) .fontColor('#E5FFFFFF') .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) @@ -261,7 +240,7 @@ struct ConfirmCustomDialog { .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Regular) .textOverflow({ overflow: TextOverflow.Ellipsis }) - .fontSize('16vp') + .fontSize('22vp') .maxLines(2) .width('auto') .lineHeight(this.isTibetanLanguages() ? '22vp' : 0) @@ -269,24 +248,24 @@ struct ConfirmCustomDialog { .visibility(this.peerCustomDescription === '' ? Visibility.None : Visibility.Visible) }.margin({ top: this.isAvailableType ? 0 : '24vp', - bottom: '24vp', left: '24vp', right: '24vp' }) + bottom: '32vp', left: '32vp', right: '32vp' }) Column() { Button($r('app.string.dm_allow_always')) - .margin({ bottom: '12vp' }) + .margin({ bottom: '16vp' }) .onClick(() => { this.onAllowAlways(); }) - .fontSize('18vp') + .fontSize('24vp') .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) - .height(this.isTibetanLanguages() ? 'auto' : '40vp') + .height(this.isTibetanLanguages() ? 'auto' : '54vp') .width('100%') .backgroundColor(this.btnColor) .scale({x: this.firstButtonWidth, y: this.firstButtonHeight}) .focusable(true) .border({ - width: '0.5vp', + width: '1vp', color: '#26ffffff' }) .onHover((isHover?: boolean, event?: HoverEvent): void => { @@ -295,7 +274,7 @@ struct ConfirmCustomDialog { this.firstButtonWidth = 1.05; this.firstButtonHeight = 1.05; } else { - this.btnColor = '#33F1F3F5'; + this.btnColor = $r('sys.color.comp_background_tertiary'); this.firstButtonWidth = 1; this.firstButtonHeight = 1; } @@ -309,24 +288,24 @@ struct ConfirmCustomDialog { .backgroundColor('#4DFFFFFF') }, normal: { - .backgroundColor('#33F1F3F5') + .backgroundColor($r('sys.color.comp_background_tertiary')) } }) Button($r('app.string.dm_allow_this_time')) - .margin({ bottom: '12vp' }) + .margin({ bottom: '16vp' }) .onClick(() => { this.onAllowOnce(); }) - .fontSize('18vp') + .fontSize('24vp') .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) .focusable(true) - .height(this.isTibetanLanguages() ? 'auto' : '40vp') + .height(this.isTibetanLanguages() ? 'auto' : '54vp') .width('100%') .backgroundColor(this.btnColor) .scale({x: this.secondButtonWidth, y: this.secondButtonHeight}) .border({ - width: '0.5vp', + width: '1vp', color: '#26ffffff' }) .onHover((isHover?: boolean, event?: HoverEvent): void => { @@ -335,7 +314,7 @@ struct ConfirmCustomDialog { this.secondButtonWidth = 1.05; this.secondButtonHeight = 1.05; } else { - this.btnColor = '#33F1F3F5'; + this.btnColor = $r('sys.color.comp_background_tertiary'); this.secondButtonWidth = 1; this.secondButtonHeight = 1; } @@ -349,12 +328,12 @@ struct ConfirmCustomDialog { .backgroundColor('#4DFFFFFF') }, normal: { - .backgroundColor('#33F1F3F5') + .backgroundColor($r('sys.color.comp_background_tertiary')) } }) Button($r('app.plural.dm_not_allow', this.secondsNum, this.secondsNum)) .margin({ left: '16vp', right: '16vp' }) - .fontSize('18vp') + .fontSize('24vp') .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) .focusable(true) @@ -371,12 +350,12 @@ struct ConfirmCustomDialog { .onClick(() => { this.onCancel(); }) - .height(this.isTibetanLanguages() ? 'auto' : '40vp') + .height(this.isTibetanLanguages() ? 'auto' : '54vp') .width('100%') .backgroundColor(this.btnColor) .scale({x: this.thirdButtonWidth, y: this.thirdButtonHeight}) .border({ - width: '0.5vp', + width: '1vp', color: '#26ffffff' }) .onHover((isHover?: boolean, event?: HoverEvent): void => { @@ -385,7 +364,7 @@ struct ConfirmCustomDialog { this.thirdButtonWidth = 1.05; this.thirdButtonHeight = 1.05; } else { - this.btnColor = '#33F1F3F5'; + this.btnColor = $r('sys.color.comp_background_tertiary'); this.thirdButtonWidth = 1; this.thirdButtonHeight = 1; } @@ -399,22 +378,23 @@ struct ConfirmCustomDialog { .backgroundColor('#4DFFFFFF') }, normal: { - .backgroundColor('#33F1F3F5') + .backgroundColor($r('sys.color.comp_background_tertiary')) } }) } .margin({ - left: '24vp', - right: '24vp', - bottom: '24vp' + left: '32vp', + right: '32vp', + bottom: '32vp' }) } - .backgroundColor('#3C3C3C') - .borderRadius(16) + .backgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK) + .shadow(ShadowStyle.OUTER_FLOATING_SM) + .borderRadius(32) .border({ - width: '0.5', + width: '1', color: '#26ffffff', - radius: '16vp' + radius: '32vp' }) .margin({ left: $r('sys.float.ohos_id_dialog_margin_start'), right: $r('sys.float.ohos_id_dialog_margin_end') }) .width(px2vp(this.mLocalWidth) * 0.36) @@ -478,22 +458,18 @@ struct dialogPlusPage { onWillDismiss() { console.log(TAG + 'onWillDismiss: ' + ACTION_CANCEL_AUTH) - const param = { - 'META_TYPE': metaType - }; - const jsonStr = JSON.stringify(param); - this.setUserOperation(ACTION_CANCEL_AUTH, jsonStr); + this.setUserOperation(ACTION_CANCEL_AUTH); this.destruction(); } - setUserOperation(operation: number, param: string) { + setUserOperation(operation: number) { console.log(TAG + 'setUserOperation: ' + operation) if (dmClass == null) { console.log(TAG + 'setUserOperation: ' + 'dmClass null') return; } try { - dmClass.setUserOperation(operation, param); + dmClass.setUserOperation(operation, 'extra'); } catch (error) { console.log(TAG + 'dmClass setUserOperation failed') } -- Gitee From a0c1b532a290f4517f1612ce81d5791ee95af4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 5 Sep 2025 02:11:56 +0000 Subject: [PATCH 3/9] update display/entry/src/main/ets/pages/PinDialogTv.ets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- .../entry/src/main/ets/pages/PinDialogTv.ets | 77 ++++++++----------- 1 file changed, 31 insertions(+), 46 deletions(-) diff --git a/display/entry/src/main/ets/pages/PinDialogTv.ets b/display/entry/src/main/ets/pages/PinDialogTv.ets index 59864ef96..86388574f 100644 --- a/display/entry/src/main/ets/pages/PinDialogTv.ets +++ b/display/entry/src/main/ets/pages/PinDialogTv.ets @@ -23,7 +23,6 @@ import { KeyCode } from '@ohos.multimodalInput.keyCode'; let dmClass: deviceManager.DeviceManager | null; let TAG = '[DeviceManagerUI:PinDialog]==>'; -let metaType: number = 11; const ACTION_CANCEL_PINCODE_DISPLAY: number = 3; const MSG_CANCEL_PIN_CODE_SHOW: number = 2; @@ -36,7 +35,7 @@ struct PinCustomDialog { @State pinCodeArr: Array = []; @State btnColor: ResourceColor = Color.Transparent; @State isPC: boolean = false; - @State mLocalWidth: number = 0; + @State mLocalWidth: number = 1; controller?: CustomDialogController cancel() { @@ -58,24 +57,21 @@ struct PinCustomDialog { this.mLocalWidth = display.getDefaultDisplaySync().width; } catch (err) { console.error('Failed to get display width:', err); - this.mLocalWidth = 0; - } - if (AppStorage.get('metaType') != null) { - metaType = AppStorage.get('metaType') as number; + this.mLocalWidth = 1; } this.isPC = Constant.isPC(); this.pinCode = AppStorage.get('pinCode') as string; this.pinCodeArr = this.pinCode.split(''); } - setUserOperation(operation: number, param: string) { + setUserOperation(operation: number) { console.log(TAG + 'setUserOperation: ' + operation); if (dmClass == null) { console.log(TAG + 'setUserOperation: ' + 'dmClass null'); return; } try { - dmClass.setUserOperation(operation, param); + dmClass.setUserOperation(operation, 'extra'); } catch (error) { console.log(TAG + 'dmClass setUserOperation failed'); } @@ -98,46 +94,46 @@ struct PinCustomDialog { Column() { Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Text($r('app.string.dm_connect_code')) - .fontSize('20fp') + .fontSize('32fp') .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) .lineHeight(this.isTibetanLanguages() ? '32.5vp' : 0) .margin({ - left: '24vp', - right: '24vp' + left: '32vp', + right: '32vp' }) } - .margin({ bottom: '24vp', top: '24vp' }) + .margin({ bottom: '32vp', top: '32vp' }) Row() { Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { ForEach(this.pinCodeArr, (item: string, index: number) => { Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { Text(item) - .fontSize('30fp') + .fontSize('40fp') .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) - }.width('24vp') + }.width('32vp') .height('100%') - .margin(index === this.pinCodeArr.length - 1 ? {} : { right: '16vp' }) + .margin(index === this.pinCodeArr.length - 1 ? {} : { right: '22vp' }) }) } - .height('40vp') + .height('53vp') .accessibilityText('[n1]' + this.pinCode + '[n0]') } - .margin({ bottom: '24vp' }) + .margin({ bottom: '32vp' }) Flex({ justifyContent: FlexAlign.Center }) { Button($r('app.string.dm_cancel')) - .fontSize('18vp') + .fontSize('24vp') .fontWeight(FontWeight.Medium) .fontColor('#E5FFFFFF') .width('100%') - .height('40vp') + .height('54vp') .backgroundColor(this.btnColor) .scale({x: this.buttonWidth, y: this.buttonHeight}) .border({ - width: '0.5vp', + width: '1vp', color: '#26ffffff' }) .defaultFocus(true) @@ -152,11 +148,7 @@ struct PinCustomDialog { this.controller.close(); } this.cancel(); - const param = { - 'META_TYPE': metaType - }; - const jsonStr = JSON.stringify(param); - this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY, jsonStr); + this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); } }) .onClick(() => { @@ -164,11 +156,7 @@ struct PinCustomDialog { this.controller.close(); } this.cancel(); - const param = { - 'META_TYPE': metaType - }; - const jsonStr = JSON.stringify(param); - this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY, jsonStr); + this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); }) .onHover((isHover?: boolean, event?: HoverEvent): void => { if (isHover) { @@ -176,7 +164,7 @@ struct PinCustomDialog { this.buttonWidth = 1.05; this.buttonHeight = 1.05; } else { - this.btnColor = '#33F1F3F5'; + this.btnColor = $r('sys.color.comp_background_tertiary'); this.buttonWidth = 1; this.buttonHeight = 1; } @@ -190,20 +178,21 @@ struct PinCustomDialog { .backgroundColor('#4DFFFFFF') }, normal: { - .backgroundColor('#33F1F3F5') + .backgroundColor($r('sys.color.comp_background_tertiary')) } }) }.margin({ - left: '24vp', - right: '24vp', - bottom: '24vp' }) + left: '32vp', + right: '32vp', + bottom: '32vp' }) } - .backgroundColor('#3C3C3C') - .borderRadius('16vp') + .backgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK) + .shadow(ShadowStyle.OUTER_FLOATING_SM) + .borderRadius('32vp') .border({ - width: '0.5vp', + width: '1vp', color: '#26ffffff', - radius: '16vp' + radius: '32vp' }) .width(px2vp(this.mLocalWidth) * 0.36) .margin({ left: $r('sys.float.ohos_id_dialog_margin_start'), right: $r('sys.float.ohos_id_dialog_margin_end') }) @@ -234,11 +223,7 @@ struct dialogPlusPage { onWillDismiss() { console.log(TAG + 'onWillDismiss: ' + ACTION_CANCEL_PINCODE_DISPLAY) - const param = { - 'META_TYPE': metaType - }; - const jsonStr = JSON.stringify(param); - this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY, jsonStr); + this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); this.destruction(); } @@ -288,14 +273,14 @@ struct dialogPlusPage { }); } - setUserOperation(operation: number, param: string) { + setUserOperation(operation: number) { console.log(TAG + 'setUserOperation: ' + operation) if (dmClass == null) { console.log(TAG + 'setUserOperation: ' + 'dmClass null') return; } try { - dmClass.setUserOperation(operation, param); + dmClass.setUserOperation(operation, 'extra'); } catch (error) { console.log(TAG + 'dmClass setUserOperation failed') } -- Gitee From c52f10f85a3012244cf5816a6e8128de35929131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 5 Sep 2025 02:16:22 +0000 Subject: [PATCH 4/9] update display/entry/src/main/ets/pages/ConfirmDialogTv.ets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- .../src/main/ets/pages/ConfirmDialogTv.ets | 202 +++++------------- 1 file changed, 59 insertions(+), 143 deletions(-) diff --git a/display/entry/src/main/ets/pages/ConfirmDialogTv.ets b/display/entry/src/main/ets/pages/ConfirmDialogTv.ets index be68240ea..52ab69289 100644 --- a/display/entry/src/main/ets/pages/ConfirmDialogTv.ets +++ b/display/entry/src/main/ets/pages/ConfirmDialogTv.ets @@ -199,13 +199,13 @@ struct ConfirmCustomDialog { Shape() { Column() { SymbolGlyph(this.getImages(this.peerDeviceType)) - .fontSize('74vp') + .fontSize('70vp') .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY) .fontColor(['#E5FFFFFF']) } } .visibility(this.isAvailableType ? Visibility.Visible : Visibility.None) - .margin({ bottom: '32vp', top: '32vp' }) + .margin({ bottom: '24vp', top: '24vp' }) } private isTibetanLanguages(): boolean { @@ -218,155 +218,86 @@ struct ConfirmCustomDialog { build() { GridRow({ columns: { xs: 4, sm: 8, md: 24 }, - gutter: { x: 4 }, + gutter: { x: '4vp' }, breakpoints: { value: ['600vp', '840vp'] } }) { GridCol({ span: { xs: 4, sm: 4, md: 6 }, offset: { sm: 2, md: 9 } }) { Column() { - this.Symbol(); - Column() { - Text(this.title) - .textAlign(TextAlign.Center) - .fontSize('22fp') - .fontWeight(FontWeight.Regular) - .fontColor('#E5FFFFFF') - .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) - .lineHeight(this.isTibetanLanguages() ? '22vp' : 0) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - .width('auto') - .maxLines(2) - Text(this.peerCustomDescription) - .textAlign(TextAlign.Start) - .fontColor('#E5FFFFFF') - .fontWeight(FontWeight.Regular) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - .fontSize('22vp') - .maxLines(2) - .width('auto') - .lineHeight(this.isTibetanLanguages() ? '22vp' : 0) - .margin({ top: '8vp' }) - .visibility(this.peerCustomDescription === '' ? Visibility.None : Visibility.Visible) - }.margin({ - top: this.isAvailableType ? 0 : '24vp', - bottom: '32vp', left: '32vp', right: '32vp' }) - - Column() { - Button($r('app.string.dm_allow_always')) - .margin({ bottom: '16vp' }) - .onClick(() => { - this.onAllowAlways(); - }) - .fontSize('24vp') + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text($r('app.string.dm_connect_code')) + .fontSize('32fp') .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) - .height(this.isTibetanLanguages() ? 'auto' : '54vp') - .width('100%') - .backgroundColor(this.btnColor) - .scale({x: this.firstButtonWidth, y: this.firstButtonHeight}) - .focusable(true) - .border({ - width: '1vp', - color: '#26ffffff' + .lineHeight(this.isTibetanLanguages() ? '32.5vp' : 0) + .margin({ + left: '32vp', + right: '32vp' }) - .onHover((isHover?: boolean, event?: HoverEvent): void => { - if (isHover) { - this.btnColor = '#4DFFFFFF'; - this.firstButtonWidth = 1.05; - this.firstButtonHeight = 1.05; - } else { - this.btnColor = $r('sys.color.comp_background_tertiary'); - this.firstButtonWidth = 1; - this.firstButtonHeight = 1; - } - }) - .stateStyles({ - pressed: { - .backgroundColor('#26FFFFFF') - }, - focused: { - .scale({x: 1.05, y: 1.05}) - .backgroundColor('#4DFFFFFF') - }, - normal: { - .backgroundColor($r('sys.color.comp_background_tertiary')) - } - }) - Button($r('app.string.dm_allow_this_time')) - .margin({ bottom: '16vp' }) - .onClick(() => { - this.onAllowOnce(); + } + .margin({ bottom: '32vp', top: '32vp' }) + + Row() { + Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + ForEach(this.pinCodeArr, (item: string, index: number) => { + Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { + Text(item) + .fontSize('40fp') + .fontColor('#E5FFFFFF') + .fontWeight(FontWeight.Medium) + }.width('32vp') + .height('100%') + .margin(index === this.pinCodeArr.length - 1 ? {} : { right: '22vp' }) }) + } + .height('53vp') + .accessibilityText('[n1]' + this.pinCode + '[n0]') + } + .margin({ bottom: '32vp' }) + + Flex({ justifyContent: FlexAlign.Center }) { + Button($r('app.string.dm_cancel')) .fontSize('24vp') - .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) - .focusable(true) - .height(this.isTibetanLanguages() ? 'auto' : '54vp') + .fontColor('#E5FFFFFF') .width('100%') + .height('54vp') .backgroundColor(this.btnColor) - .scale({x: this.secondButtonWidth, y: this.secondButtonHeight}) + .scale({x: this.buttonWidth, y: this.buttonHeight}) .border({ width: '1vp', color: '#26ffffff' }) - .onHover((isHover?: boolean, event?: HoverEvent): void => { - if (isHover) { - this.btnColor = '#4DFFFFFF'; - this.secondButtonWidth = 1.05; - this.secondButtonHeight = 1.05; - } else { - this.btnColor = $r('sys.color.comp_background_tertiary'); - this.secondButtonWidth = 1; - this.secondButtonHeight = 1; - } - }) - .stateStyles({ - pressed: { - .backgroundColor('#26FFFFFF') - }, - focused: { - .scale({x: 1.05, y: 1.05}) - .backgroundColor('#4DFFFFFF') - }, - normal: { - .backgroundColor($r('sys.color.comp_background_tertiary')) - } - }) - Button($r('app.plural.dm_not_allow', this.secondsNum, this.secondsNum)) - .margin({ left: '16vp', right: '16vp' }) - .fontSize('24vp') - .fontColor('#E5FFFFFF') - .fontWeight(FontWeight.Medium) - .focusable(true) + .defaultFocus(true) .onKeyEvent((event?: KeyEvent) => { if (event && event?.keyCode === KeyCode.KEYCODE_HOME && event?.type === KeyType.Down) { - console.log(TAG + 'onKeyEvent KEYCODE_HOME:' + event?.type) + console.log(TAG + 'onKeyEvent eventType: ' + event?.type) return; } - if (event?.keyCode == KeyCode.KEYCODE_HOME) { - console.log(TAG + 'onKeyEvent KEYCODE_HOME:' + event?.type) - this.onCancel(); + if (event && event?.keyCode === KeyCode.KEYCODE_HOME && 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(() => { - this.onCancel(); - }) - .height(this.isTibetanLanguages() ? 'auto' : '54vp') - .width('100%') - .backgroundColor(this.btnColor) - .scale({x: this.thirdButtonWidth, y: this.thirdButtonHeight}) - .border({ - width: '1vp', - color: '#26ffffff' + if (this.controller) { + this.controller.close(); + } + this.cancel(); + this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); }) .onHover((isHover?: boolean, event?: HoverEvent): void => { if (isHover) { - this.btnColor = '#4DFFFFFF'; - this.thirdButtonWidth = 1.05; - this.thirdButtonHeight = 1.05; + this.btnColor = '#F1F3F5'; + this.buttonWidth = 1.05; + this.buttonHeight = 1.05; } else { this.btnColor = $r('sys.color.comp_background_tertiary'); - this.thirdButtonWidth = 1; - this.thirdButtonHeight = 1; + this.buttonWidth = 1; + this.buttonHeight = 1; } }) .stateStyles({ @@ -381,37 +312,22 @@ struct ConfirmCustomDialog { .backgroundColor($r('sys.color.comp_background_tertiary')) } }) - } - .margin({ + }.margin({ left: '32vp', right: '32vp', - bottom: '32vp' - }) + bottom: '32vp' }) } .backgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK) .shadow(ShadowStyle.OUTER_FLOATING_SM) - .borderRadius(32) + .borderRadius('32vp') .border({ - width: '1', + width: '1vp', color: '#26ffffff', radius: '32vp' }) - .margin({ left: $r('sys.float.ohos_id_dialog_margin_start'), right: $r('sys.float.ohos_id_dialog_margin_end') }) .width(px2vp(this.mLocalWidth) * 0.36) + .margin({ left: $r('sys.float.ohos_id_dialog_margin_start'), right: $r('sys.float.ohos_id_dialog_margin_end') }) } - .onKeyPreIme((event:KeyEvent) => { - if (event?.keyCode === KeyCode.KEYCODE_MENU && event?.type === KeyType.Up) { - console.log(TAG + 'onKeyEvent KEYCODE_MENU:' + event?.type) - return true; - } - return false; - }) - .onKeyEvent((event?: KeyEvent) => { - if (event?.keyCode == KeyCode.KEYCODE_HOME) { - console.log(TAG + 'onKeyEvent KEYCODE_HOME:' + event?.type) - this.onCancel(); - } - }) } .constraintSize({ maxHeight: '80%' }) } -- Gitee From ba06c1e3f41d25452a1c9976bf351ccca6f834a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 5 Sep 2025 02:18:59 +0000 Subject: [PATCH 5/9] update display/entry/src/main/ets/pages/ConfirmDialogTv.ets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- .../src/main/ets/pages/ConfirmDialogTv.ets | 215 ++++++++++++------ 1 file changed, 149 insertions(+), 66 deletions(-) diff --git a/display/entry/src/main/ets/pages/ConfirmDialogTv.ets b/display/entry/src/main/ets/pages/ConfirmDialogTv.ets index 52ab69289..828314d57 100644 --- a/display/entry/src/main/ets/pages/ConfirmDialogTv.ets +++ b/display/entry/src/main/ets/pages/ConfirmDialogTv.ets @@ -218,86 +218,155 @@ struct ConfirmCustomDialog { build() { GridRow({ columns: { xs: 4, sm: 8, md: 24 }, - gutter: { x: '4vp' }, + gutter: { x: 4 }, breakpoints: { value: ['600vp', '840vp'] } }) { GridCol({ span: { xs: 4, sm: 4, md: 6 }, offset: { sm: 2, md: 9 } }) { Column() { - Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text($r('app.string.dm_connect_code')) - .fontSize('32fp') + this.Symbol(); + Column() { + Text(this.title) + .textAlign(TextAlign.Center) + .fontSize('16fp') + .fontWeight(FontWeight.Regular) .fontColor('#E5FFFFFF') - .fontWeight(FontWeight.Medium) - .lineHeight(this.isTibetanLanguages() ? '32.5vp' : 0) - .margin({ - left: '32vp', - right: '32vp' - }) - } - .margin({ bottom: '32vp', top: '32vp' }) + .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) + .lineHeight(this.isTibetanLanguages() ? '22vp' : 0) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .width('auto') + .maxLines(2) + Text(this.peerCustomDescription) + .textAlign(TextAlign.Start) + .fontColor('#E5FFFFFF') + .fontWeight(FontWeight.Regular) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + .fontSize('16vp') + .maxLines(2) + .width('auto') + .lineHeight(this.isTibetanLanguages() ? '22vp' : 0) + .margin({ top: '8vp' }) + .visibility(this.peerCustomDescription === '' ? Visibility.None : Visibility.Visible) + }.margin({ + top: this.isAvailableType ? 0 : '24vp', + bottom: '24vp', left: '24vp', right: '24vp' }) - Row() { - Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - ForEach(this.pinCodeArr, (item: string, index: number) => { - Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { - Text(item) - .fontSize('40fp') - .fontColor('#E5FFFFFF') - .fontWeight(FontWeight.Medium) - }.width('32vp') - .height('100%') - .margin(index === this.pinCodeArr.length - 1 ? {} : { right: '22vp' }) + Column() { + Button($r('app.string.dm_allow_always')) + .margin({ bottom: '12vp' }) + .onClick(() => { + this.onAllowAlways(); }) - } - .height('53vp') - .accessibilityText('[n1]' + this.pinCode + '[n0]') - } - .margin({ bottom: '32vp' }) - - Flex({ justifyContent: FlexAlign.Center }) { - Button($r('app.string.dm_cancel')) - .fontSize('24vp') + .fontSize('18vp') + .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) + .height(this.isTibetanLanguages() ? 'auto' : '40vp') + .width('100%') + .backgroundColor(this.btnColor) + .scale({x: this.firstButtonWidth, y: this.firstButtonHeight}) + .focusable(true) + .border({ + width: '0.5vp', + color: '#26ffffff' + }) + .onHover((isHover?: boolean, event?: HoverEvent): void => { + if (isHover) { + this.btnColor = '#4DFFFFFF'; + this.firstButtonWidth = 1.05; + this.firstButtonHeight = 1.05; + } else { + this.btnColor = '#33F1F3F5'; + this.firstButtonWidth = 1; + this.firstButtonHeight = 1; + } + }) + .stateStyles({ + pressed: { + .backgroundColor('#26FFFFFF') + }, + focused: { + .scale({x: 1.05, y: 1.05}) + .backgroundColor('#4DFFFFFF') + }, + normal: { + .backgroundColor('#33F1F3F5') + } + }) + Button($r('app.string.dm_allow_this_time')) + .margin({ bottom: '12vp' }) + .onClick(() => { + this.onAllowOnce(); + }) + .fontSize('18vp') .fontColor('#E5FFFFFF') + .fontWeight(FontWeight.Medium) + .focusable(true) + .height(this.isTibetanLanguages() ? 'auto' : '40vp') .width('100%') - .height('54vp') .backgroundColor(this.btnColor) - .scale({x: this.buttonWidth, y: this.buttonHeight}) + .scale({x: this.secondButtonWidth, y: this.secondButtonHeight}) .border({ - width: '1vp', + width: '0.5vp', color: '#26ffffff' }) - .defaultFocus(true) + .onHover((isHover?: boolean, event?: HoverEvent): void => { + if (isHover) { + this.btnColor = '#4DFFFFFF'; + this.secondButtonWidth = 1.05; + this.secondButtonHeight = 1.05; + } else { + this.btnColor = '#33F1F3F5'; + this.secondButtonWidth = 1; + this.secondButtonHeight = 1; + } + }) + .stateStyles({ + pressed: { + .backgroundColor('#26FFFFFF') + }, + focused: { + .scale({x: 1.05, y: 1.05}) + .backgroundColor('#4DFFFFFF') + }, + normal: { + .backgroundColor('#33F1F3F5') + } + }) + Button($r('app.plural.dm_not_allow', this.secondsNum, this.secondsNum)) + .margin({ left: '16vp', right: '16vp' }) + .fontSize('18vp') + .fontColor('#E5FFFFFF') + .fontWeight(FontWeight.Medium) + .focusable(true) .onKeyEvent((event?: KeyEvent) => { if (event && event?.keyCode === KeyCode.KEYCODE_HOME && event?.type === KeyType.Down) { - console.log(TAG + 'onKeyEvent eventType: ' + event?.type) + console.log(TAG + 'onKeyEvent KEYCODE_HOME:' + event?.type) return; } - if (event && event?.keyCode === KeyCode.KEYCODE_HOME && 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); + if (event?.keyCode == KeyCode.KEYCODE_HOME) { + console.log(TAG + 'onKeyEvent KEYCODE_HOME:' + event?.type) + this.onCancel(); } }) .onClick(() => { - if (this.controller) { - this.controller.close(); - } - this.cancel(); - this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); + this.onCancel(); + }) + .height(this.isTibetanLanguages() ? 'auto' : '40vp') + .width('100%') + .backgroundColor(this.btnColor) + .scale({x: this.thirdButtonWidth, y: this.thirdButtonHeight}) + .border({ + width: '0.5vp', + color: '#26ffffff' }) .onHover((isHover?: boolean, event?: HoverEvent): void => { if (isHover) { - this.btnColor = '#F1F3F5'; - this.buttonWidth = 1.05; - this.buttonHeight = 1.05; + this.btnColor = '#4DFFFFFF'; + this.thirdButtonWidth = 1.05; + this.thirdButtonHeight = 1.05; } else { - this.btnColor = $r('sys.color.comp_background_tertiary'); - this.buttonWidth = 1; - this.buttonHeight = 1; + this.btnColor = '#33F1F3F5'; + this.thirdButtonWidth = 1; + this.thirdButtonHeight = 1; } }) .stateStyles({ @@ -309,25 +378,39 @@ struct ConfirmCustomDialog { .backgroundColor('#4DFFFFFF') }, normal: { - .backgroundColor($r('sys.color.comp_background_tertiary')) + .backgroundColor('#33F1F3F5') } }) - }.margin({ - left: '32vp', - right: '32vp', - bottom: '32vp' }) + } + .margin({ + left: '24vp', + right: '24vp', + bottom: '24vp' + }) } - .backgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK) - .shadow(ShadowStyle.OUTER_FLOATING_SM) - .borderRadius('32vp') + .backgroundColor('#3C3C3C') + .borderRadius(16) .border({ - width: '1vp', + width: '0.5', color: '#26ffffff', - radius: '32vp' + radius: '16vp' }) - .width(px2vp(this.mLocalWidth) * 0.36) .margin({ left: $r('sys.float.ohos_id_dialog_margin_start'), right: $r('sys.float.ohos_id_dialog_margin_end') }) + .width(px2vp(this.mLocalWidth) * 0.36) } + .onKeyPreIme((event:KeyEvent) => { + if (event?.keyCode === KeyCode.KEYCODE_MENU && event?.type === KeyType.Up) { + console.log(TAG + 'onKeyEvent KEYCODE_MENU:' + event?.type) + return true; + } + return false; + }) + .onKeyEvent((event?: KeyEvent) => { + if (event?.keyCode == KeyCode.KEYCODE_HOME) { + console.log(TAG + 'onKeyEvent KEYCODE_HOME:' + event?.type) + this.onCancel(); + } + }) } .constraintSize({ maxHeight: '80%' }) } -- Gitee From 69ecf84125beb2232a87b921ee59ace1be481bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 5 Sep 2025 02:24:45 +0000 Subject: [PATCH 6/9] update display/entry/src/main/ets/pages/ConfirmDialogTv.ets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- .../src/main/ets/pages/ConfirmDialogTv.ets | 106 +++++++++++------- 1 file changed, 66 insertions(+), 40 deletions(-) diff --git a/display/entry/src/main/ets/pages/ConfirmDialogTv.ets b/display/entry/src/main/ets/pages/ConfirmDialogTv.ets index 828314d57..c1137b61b 100644 --- a/display/entry/src/main/ets/pages/ConfirmDialogTv.ets +++ b/display/entry/src/main/ets/pages/ConfirmDialogTv.ets @@ -23,6 +23,7 @@ import { KeyCode } from '@ohos.multimodalInput.keyCode'; let dmClass: deviceManager.DeviceManager | null; let TAG = '[DeviceManagerUI:ConfirmDialog]==>'; +let metaType: number = 11; const ACTION_ALLOW_AUTH_ONCE: number = 0; const ACTION_CANCEL_AUTH: number = 1; const ACTION_AUTH_CONFIRM_TIMEOUT: number = 2; @@ -49,7 +50,7 @@ struct ConfirmCustomDialog { @State isAvailableType: boolean = false; @State btnColor: ResourceColor = Color.Transparent; @State title: string = ''; - @State mLocalWidth: number = 1; + @State mLocalWidth: number = 0; controller?: CustomDialogController; isPC: boolean = false; aboutToAppear() { @@ -59,7 +60,7 @@ struct ConfirmCustomDialog { this.mLocalWidth = display.getDefaultDisplaySync().width; } catch (err) { console.error('Failed to get display width:', err); - this.mLocalWidth = 1; + this.mLocalWidth = 0; } let context = getContext() as common.UIAbilityContext; @@ -86,6 +87,10 @@ struct ConfirmCustomDialog { this.peerCustomDescription = context.resourceManager.getStringSync($r('app.string.dm_confirm_intention').id); } + if (AppStorage.get('metaType') != null) { + metaType = AppStorage.get('metaType') as number; + } + if (AppStorage.get('deviceType') != null) { this.peerDeviceType = AppStorage.get('deviceType') as number; console.log('peerDeviceType is ' + this.peerDeviceType); @@ -97,7 +102,11 @@ struct ConfirmCustomDialog { if (this.secondsNum === 0) { clearInterval(this.times); this.times = 0; - this.setUserOperation(ACTION_AUTH_CONFIRM_TIMEOUT); + const param = { + 'META_TYPE': metaType + }; + const jsonStr = JSON.stringify(param); + this.setUserOperation(ACTION_AUTH_CONFIRM_TIMEOUT, jsonStr); this.destruction(); console.info('click cancel times run out'); } @@ -114,7 +123,11 @@ struct ConfirmCustomDialog { } console.log('allow once' + ACTION_ALLOW_AUTH_ONCE) - this.setUserOperation(ACTION_ALLOW_AUTH_ONCE) + const param = { + 'META_TYPE': metaType + }; + const jsonStr = JSON.stringify(param); + this.setUserOperation(ACTION_ALLOW_AUTH_ONCE, jsonStr) this.destruction() } @@ -126,7 +139,11 @@ struct ConfirmCustomDialog { } console.log('allow always' + ACTION_ALLOW_AUTH_ALWAYS) - this.setUserOperation(ACTION_ALLOW_AUTH_ALWAYS) + const param = { + 'META_TYPE': metaType + }; + const jsonStr = JSON.stringify(param); + this.setUserOperation(ACTION_ALLOW_AUTH_ALWAYS, jsonStr) this.destruction() } @@ -138,18 +155,22 @@ struct ConfirmCustomDialog { } console.log('cancel' + ACTION_CANCEL_AUTH) - this.setUserOperation(ACTION_CANCEL_AUTH) + const param = { + 'META_TYPE': metaType + }; + const jsonStr = JSON.stringify(param); + this.setUserOperation(ACTION_CANCEL_AUTH, jsonStr) this.destruction() } - setUserOperation(operation: number) { + setUserOperation(operation: number, param: string) { console.log(TAG + 'setUserOperation: ' + operation) if (dmClass == null) { console.log(TAG + 'setUserOperation: ' + 'dmClass null') return; } try { - dmClass.setUserOperation(operation, 'extra'); + dmClass.setUserOperation(operation, param); } catch (error) { console.log(TAG + 'dmClass setUserOperation failed') } @@ -199,13 +220,13 @@ struct ConfirmCustomDialog { Shape() { Column() { SymbolGlyph(this.getImages(this.peerDeviceType)) - .fontSize('70vp') + .fontSize('74vp') .renderingStrategy(SymbolRenderingStrategy.MULTIPLE_OPACITY) .fontColor(['#E5FFFFFF']) } } .visibility(this.isAvailableType ? Visibility.Visible : Visibility.None) - .margin({ bottom: '24vp', top: '24vp' }) + .margin({ bottom: '32vp', top: '32vp' }) } private isTibetanLanguages(): boolean { @@ -227,7 +248,7 @@ struct ConfirmCustomDialog { Column() { Text(this.title) .textAlign(TextAlign.Center) - .fontSize('16fp') + .fontSize('22fp') .fontWeight(FontWeight.Regular) .fontColor('#E5FFFFFF') .heightAdaptivePolicy(TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST) @@ -240,7 +261,7 @@ struct ConfirmCustomDialog { .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Regular) .textOverflow({ overflow: TextOverflow.Ellipsis }) - .fontSize('16vp') + .fontSize('22vp') .maxLines(2) .width('auto') .lineHeight(this.isTibetanLanguages() ? '22vp' : 0) @@ -248,24 +269,24 @@ struct ConfirmCustomDialog { .visibility(this.peerCustomDescription === '' ? Visibility.None : Visibility.Visible) }.margin({ top: this.isAvailableType ? 0 : '24vp', - bottom: '24vp', left: '24vp', right: '24vp' }) + bottom: '32vp', left: '32vp', right: '32vp' }) Column() { Button($r('app.string.dm_allow_always')) - .margin({ bottom: '12vp' }) + .margin({ bottom: '16vp' }) .onClick(() => { this.onAllowAlways(); }) - .fontSize('18vp') + .fontSize('24vp') .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) - .height(this.isTibetanLanguages() ? 'auto' : '40vp') + .height(this.isTibetanLanguages() ? 'auto' : '54vp') .width('100%') .backgroundColor(this.btnColor) .scale({x: this.firstButtonWidth, y: this.firstButtonHeight}) .focusable(true) .border({ - width: '0.5vp', + width: '1vp', color: '#26ffffff' }) .onHover((isHover?: boolean, event?: HoverEvent): void => { @@ -274,7 +295,7 @@ struct ConfirmCustomDialog { this.firstButtonWidth = 1.05; this.firstButtonHeight = 1.05; } else { - this.btnColor = '#33F1F3F5'; + this.btnColor = $r('sys.color.comp_background_tertiary'); this.firstButtonWidth = 1; this.firstButtonHeight = 1; } @@ -288,24 +309,24 @@ struct ConfirmCustomDialog { .backgroundColor('#4DFFFFFF') }, normal: { - .backgroundColor('#33F1F3F5') + .backgroundColor($r('sys.color.comp_background_tertiary')) } }) Button($r('app.string.dm_allow_this_time')) - .margin({ bottom: '12vp' }) + .margin({ bottom: '16vp' }) .onClick(() => { this.onAllowOnce(); }) - .fontSize('18vp') + .fontSize('24vp') .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) .focusable(true) - .height(this.isTibetanLanguages() ? 'auto' : '40vp') + .height(this.isTibetanLanguages() ? 'auto' : '54vp') .width('100%') .backgroundColor(this.btnColor) .scale({x: this.secondButtonWidth, y: this.secondButtonHeight}) .border({ - width: '0.5vp', + width: '1vp', color: '#26ffffff' }) .onHover((isHover?: boolean, event?: HoverEvent): void => { @@ -314,7 +335,7 @@ struct ConfirmCustomDialog { this.secondButtonWidth = 1.05; this.secondButtonHeight = 1.05; } else { - this.btnColor = '#33F1F3F5'; + this.btnColor = $r('sys.color.comp_background_tertiary'); this.secondButtonWidth = 1; this.secondButtonHeight = 1; } @@ -328,12 +349,12 @@ struct ConfirmCustomDialog { .backgroundColor('#4DFFFFFF') }, normal: { - .backgroundColor('#33F1F3F5') + .backgroundColor($r('sys.color.comp_background_tertiary')) } }) Button($r('app.plural.dm_not_allow', this.secondsNum, this.secondsNum)) .margin({ left: '16vp', right: '16vp' }) - .fontSize('18vp') + .fontSize('24vp') .fontColor('#E5FFFFFF') .fontWeight(FontWeight.Medium) .focusable(true) @@ -350,12 +371,12 @@ struct ConfirmCustomDialog { .onClick(() => { this.onCancel(); }) - .height(this.isTibetanLanguages() ? 'auto' : '40vp') + .height(this.isTibetanLanguages() ? 'auto' : '54vp') .width('100%') .backgroundColor(this.btnColor) .scale({x: this.thirdButtonWidth, y: this.thirdButtonHeight}) .border({ - width: '0.5vp', + width: '1vp', color: '#26ffffff' }) .onHover((isHover?: boolean, event?: HoverEvent): void => { @@ -364,7 +385,7 @@ struct ConfirmCustomDialog { this.thirdButtonWidth = 1.05; this.thirdButtonHeight = 1.05; } else { - this.btnColor = '#33F1F3F5'; + this.btnColor = $r('sys.color.comp_background_tertiary'); this.thirdButtonWidth = 1; this.thirdButtonHeight = 1; } @@ -378,22 +399,23 @@ struct ConfirmCustomDialog { .backgroundColor('#4DFFFFFF') }, normal: { - .backgroundColor('#33F1F3F5') + .backgroundColor($r('sys.color.comp_background_tertiary')) } }) } .margin({ - left: '24vp', - right: '24vp', - bottom: '24vp' + left: '32vp', + right: '32vp', + bottom: '32vp' }) } - .backgroundColor('#3C3C3C') - .borderRadius(16) + .backgroundBlurStyle(BlurStyle.COMPONENT_ULTRA_THICK) + .shadow(ShadowStyle.OUTER_FLOATING_SM) + .borderRadius(32) .border({ - width: '0.5', + width: '1', color: '#26ffffff', - radius: '16vp' + radius: '32vp' }) .margin({ left: $r('sys.float.ohos_id_dialog_margin_start'), right: $r('sys.float.ohos_id_dialog_margin_end') }) .width(px2vp(this.mLocalWidth) * 0.36) @@ -457,18 +479,22 @@ struct dialogPlusPage { onWillDismiss() { console.log(TAG + 'onWillDismiss: ' + ACTION_CANCEL_AUTH) - this.setUserOperation(ACTION_CANCEL_AUTH); + const param = { + 'META_TYPE': metaType + }; + const jsonStr = JSON.stringify(param); + this.setUserOperation(ACTION_CANCEL_AUTH, jsonStr); this.destruction(); } - setUserOperation(operation: number) { + setUserOperation(operation: number, param: string) { console.log(TAG + 'setUserOperation: ' + operation) if (dmClass == null) { console.log(TAG + 'setUserOperation: ' + 'dmClass null') return; } try { - dmClass.setUserOperation(operation, 'extra'); + dmClass.setUserOperation(operation, param); } catch (error) { console.log(TAG + 'dmClass setUserOperation failed') } -- Gitee From cd2ec62087babb1abed15cbd675143989e6fd233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 5 Sep 2025 02:26:28 +0000 Subject: [PATCH 7/9] update display/entry/src/main/ets/pages/PinDialogTv.ets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- .../entry/src/main/ets/pages/PinDialogTv.ets | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/display/entry/src/main/ets/pages/PinDialogTv.ets b/display/entry/src/main/ets/pages/PinDialogTv.ets index 86388574f..f4f1da9bd 100644 --- a/display/entry/src/main/ets/pages/PinDialogTv.ets +++ b/display/entry/src/main/ets/pages/PinDialogTv.ets @@ -23,6 +23,7 @@ import { KeyCode } from '@ohos.multimodalInput.keyCode'; let dmClass: deviceManager.DeviceManager | null; let TAG = '[DeviceManagerUI:PinDialog]==>'; +let metaType: number = 11; const ACTION_CANCEL_PINCODE_DISPLAY: number = 3; const MSG_CANCEL_PIN_CODE_SHOW: number = 2; @@ -35,7 +36,7 @@ struct PinCustomDialog { @State pinCodeArr: Array = []; @State btnColor: ResourceColor = Color.Transparent; @State isPC: boolean = false; - @State mLocalWidth: number = 1; + @State mLocalWidth: number = 0; controller?: CustomDialogController cancel() { @@ -57,21 +58,24 @@ struct PinCustomDialog { this.mLocalWidth = display.getDefaultDisplaySync().width; } catch (err) { console.error('Failed to get display width:', err); - this.mLocalWidth = 1; + this.mLocalWidth = 0; + } + if (AppStorage.get('metaType') != null) { + metaType = AppStorage.get('metaType') as number; } this.isPC = Constant.isPC(); this.pinCode = AppStorage.get('pinCode') as string; this.pinCodeArr = this.pinCode.split(''); } - setUserOperation(operation: number) { + setUserOperation(operation: number, param: string) { console.log(TAG + 'setUserOperation: ' + operation); if (dmClass == null) { console.log(TAG + 'setUserOperation: ' + 'dmClass null'); return; } try { - dmClass.setUserOperation(operation, 'extra'); + dmClass.setUserOperation(operation, param); } catch (error) { console.log(TAG + 'dmClass setUserOperation failed'); } @@ -223,7 +227,11 @@ struct dialogPlusPage { onWillDismiss() { console.log(TAG + 'onWillDismiss: ' + ACTION_CANCEL_PINCODE_DISPLAY) - this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); + const param = { + 'META_TYPE': metaType + }; + const jsonStr = JSON.stringify(param); + this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY, jsonStr); this.destruction(); } @@ -273,14 +281,14 @@ struct dialogPlusPage { }); } - setUserOperation(operation: number) { + setUserOperation(operation: number, param: string) { console.log(TAG + 'setUserOperation: ' + operation) if (dmClass == null) { console.log(TAG + 'setUserOperation: ' + 'dmClass null') return; } try { - dmClass.setUserOperation(operation, 'extra'); + dmClass.setUserOperation(operation, param); } catch (error) { console.log(TAG + 'dmClass setUserOperation failed') } -- Gitee From 114814c7ea80b1ec80a30a8b1e1cc1e1061b866b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 5 Sep 2025 02:28:07 +0000 Subject: [PATCH 8/9] update display/entry/src/main/ets/pages/PinDialogTv.ets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- display/entry/src/main/ets/pages/PinDialogTv.ets | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/display/entry/src/main/ets/pages/PinDialogTv.ets b/display/entry/src/main/ets/pages/PinDialogTv.ets index f4f1da9bd..18fa08e01 100644 --- a/display/entry/src/main/ets/pages/PinDialogTv.ets +++ b/display/entry/src/main/ets/pages/PinDialogTv.ets @@ -152,7 +152,11 @@ struct PinCustomDialog { this.controller.close(); } this.cancel(); - this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); + const param = { + 'META_TYPE': metaType + }; + const jsonStr = JSON.stringify(param); + this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY, jsonStr); } }) .onClick(() => { @@ -160,7 +164,11 @@ struct PinCustomDialog { this.controller.close(); } this.cancel(); - this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY); + const param = { + 'META_TYPE': metaType + }; + const jsonStr = JSON.stringify(param); + this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY, jsonStr); }) .onHover((isHover?: boolean, event?: HoverEvent): void => { if (isHover) { -- Gitee From 7d561052bce8d9b13034a06cc0111dac031e6ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Fri, 5 Sep 2025 02:29:08 +0000 Subject: [PATCH 9/9] update display/entry/src/main/ets/pages/PinDialogTv.ets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- display/entry/src/main/ets/pages/PinDialogTv.ets | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/display/entry/src/main/ets/pages/PinDialogTv.ets b/display/entry/src/main/ets/pages/PinDialogTv.ets index 18fa08e01..077a1883f 100644 --- a/display/entry/src/main/ets/pages/PinDialogTv.ets +++ b/display/entry/src/main/ets/pages/PinDialogTv.ets @@ -164,11 +164,11 @@ struct PinCustomDialog { this.controller.close(); } this.cancel(); - const param = { - 'META_TYPE': metaType - }; - const jsonStr = JSON.stringify(param); - this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY, jsonStr); + const param = { + 'META_TYPE': metaType + }; + const jsonStr = JSON.stringify(param); + this.setUserOperation(ACTION_CANCEL_PINCODE_DISPLAY, jsonStr); }) .onHover((isHover?: boolean, event?: HoverEvent): void => { if (isHover) { -- Gitee