From fa8177e965c3b58ad17c90d0af0516e193da22a8 Mon Sep 17 00:00:00 2001 From: q30043944 Date: Wed, 26 Feb 2025 11:56:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BB=91=E5=8A=A8=E7=BB=84=E4=BB=B6=E9=80=82?= =?UTF-8?q?=E9=85=8D?= 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/InputPinDialog.ets | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 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/InputPinDialog.ets b/display/entry/src/main/ets/pages/InputPinDialog.ets index 266b5cf4d..1add1ade8 100644 --- a/display/entry/src/main/ets/pages/InputPinDialog.ets +++ b/display/entry/src/main/ets/pages/InputPinDialog.ets @@ -50,7 +50,7 @@ struct InputCustomDialog { onPortrait(mediaQueryResult: mediaquery.MediaQueryResult) { if (mediaQueryResult.matches as boolean) { - this.heightNum = 300; + this.heightNum = 100; } else { this.heightNum = 800; } @@ -69,6 +69,9 @@ struct InputCustomDialog { ims.on('imeShow', (info: Array) => { this.scroller.scrollTo({yOffset: 72, xOffset: 0}); }); + if (AppStorage.get('mediaQueryResult') != null && AppStorage.get('mediaQueryResult') as boolean) { + this.heightNum = 100; + } if (AppStorage.get('targetDeviceName') != null) { this.targetDeviceName = AppStorage.get('targetDeviceName') as string; console.log('targetDeviceName is ' + this.targetDeviceName); @@ -380,6 +383,7 @@ struct InputCustomDialog { @Entry @Component struct dialogPlusPage { + mediaQueryListener: mediaquery.MediaQueryListener = mediaquery.matchMediaSync('(orientation: landscape)'); dialogController: CustomDialogController = new CustomDialogController({ builder: InputCustomDialog(), autoCancel: false, @@ -391,6 +395,11 @@ struct dialogPlusPage { aboutToAppear() { console.log(TAG + 'aboutToAppear aboutToAppear'); + this.mediaQueryListener.on('change', this.onPortrait.bind(this)); + } + + onPortrait(mediaQueryResult: mediaquery.MediaQueryResult) { + AppStorage.setOrCreate('mediaQueryResult', mediaQueryResult.matches as boolean); } aboutToDisappear() { -- Gitee