diff --git a/display/AppScope/app.json b/display/AppScope/app.json index 14c36944eee17c668c4d8daf76cd36d83a099dc1..c7b1de6abf11c82b0e0ac68cb5628201dbad74da 100644 --- a/display/AppScope/app.json +++ b/display/AppScope/app.json @@ -2,8 +2,8 @@ "app": { "bundleName": "com.ohos.devicemanagerui", "vendor": "example", - "versionCode": 1000038, - "versionName": "1.0.38", + "versionCode": 1000039, + "versionName": "1.0.39", "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 1add1ade8038e8d8036f05ca1124ec2b130d00ab..97b3ab44e7c34d8c9d587b754eafa749fd1547a2 100644 --- a/display/entry/src/main/ets/pages/InputPinDialog.ets +++ b/display/entry/src/main/ets/pages/InputPinDialog.ets @@ -16,6 +16,7 @@ import deviceManager from '@ohos.distributedHardware.deviceManager'; import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession' import mediaquery from '@ohos.mediaquery'; import deviceInfo from '@ohos.deviceInfo'; +import display from '@ohos.display'; import inputMethod from '@ohos.inputMethod'; import Constant from '../common/constant'; import accessibility from '@ohos.accessibility'; @@ -43,14 +44,16 @@ struct InputCustomDialog { @State targetDeviceName: string = ''; @State model: string = MODEL_PIN; @State isPC: boolean = false; + @State isPhone: boolean = false; @State btnColor: ResourceColor = Color.Transparent; + @State mLocalHeight: number = display.getDefaultDisplaySync().height; listener: mediaquery.MediaQueryListener = mediaquery.matchMediaSync('(orientation: landscape)'); controller?: CustomDialogController; private scroller: Scroller = new Scroller(); onPortrait(mediaQueryResult: mediaquery.MediaQueryResult) { if (mediaQueryResult.matches as boolean) { - this.heightNum = 100; + this.heightNum = 300; } else { this.heightNum = 800; } @@ -65,12 +68,18 @@ struct InputCustomDialog { aboutToAppear() { console.info(TAG + 'InputCustomDialog aboutToAppear'); this.isPC = Constant.isPC(); + this.isPhone = Constant.isPhone(); let ims = inputMethod.getSetting(); 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('mediaQueryResult') != null && AppStorage.get('mediaQueryResult') as boolean && this.isPhone) { + let heightRatio = px2vp(this.mLocalHeight) * 0.2; + if (display.isFoldable() && display.getFoldDisplayMode() === display.FoldDisplayMode.FOLD_DISPLAY_MODE_MAIN) { + this.heightNum = heightRatio; + } else if (!display.isFoldable()) { + this.heightNum = heightRatio; + } } if (AppStorage.get('targetDeviceName') != null) { this.targetDeviceName = AppStorage.get('targetDeviceName') as string;