diff --git a/display/AppScope/app.json b/display/AppScope/app.json index c4e9d0b90f360e0ac8e0f84ffb8e901b65aaf702..bfc8e70ec0bf34e9c9427f02d811b4bc34080c71 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 266b5cf4dcd7f918fab1d23e8faf2fc062932234..1add1ade8038e8d8036f05ca1124ec2b130d00ab 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() {