!4885 【Openharmony-4.1-Release 】计算器底部分布式弹框UI 设备名称选项被遮挡

Merge pull request !4885 from crane/OpenHarmony-4.1-Release-Calc
This commit is contained in:
openharmony_ci 2024-11-01 09:26:00 +00:00 committed by Gitee
commit 205be4a686
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 18 additions and 17 deletions

View File

@ -29,25 +29,25 @@ export struct DeviceDialog {
build() {
Column() {
Text($r('app.string.choiceDevice'))
.fontSize(px2vp(30))
.fontSize(24)
.width('100%')
.height('20%')
.fontColor(Color.Black)
.textAlign(TextAlign.Start)
.fontWeight(600)
List() {
ForEach(this.deviceList, (item: deviceManager.DeviceBasicInfo, index: number | undefined) => {
ListItem() {
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) {
Text(item.deviceName)
.fontSize(px2vp(30))
.width('80%')
.fontSize(18)
.width('86%')
.fontColor(Color.Black)
.textAlign(TextAlign.Start)
Radio({ value: '', group: 'radioGroup' })
.radioStyle({
checkedBackgroundColor: '#ff0d64fb'
})
.align(Alignment.Top)
.width('3%')
.width('7%')
.checked(index === this.selectedIndex ? true : false)
}
.margin({ top: 17 })
@ -91,8 +91,8 @@ export struct DeviceDialog {
this.deviceDialogWidth = (newArea.width > newArea.height ? newArea.height : newArea.width) as number * 0.1 //percentage
})
.width('80%')
.height(px2vp(240))
.padding({ left: 18, right: 32 })
.height(300)
.padding(16)
.backgroundColor(Color.White)
.border({ color: Color.White, radius: 20 })
}

View File

@ -174,8 +174,9 @@ export struct TitleBarComponent {
})
Text($r('app.string.distributed_calculator'))
.height('60%')
.fontSize('28px')
.fontSize(24)
.margin({ left: 12 })
.fontWeight(600)
Blank().layoutWeight(1)
if (!this.isShow) {
Image($r("app.media.ic_hop_normal1"))

View File

@ -76,14 +76,14 @@ export class KvStoreModel {
put(key: string, value: string) {
if (this.kvStore) {
Logger.debug(TAG, `kvStore.put ${key} = ${value}`)
this.kvStore.put(
Logger.debug(TAG, `kvStore?.put ${key} = ${value}`)
this.kvStore?.put(
key,
value
).then((data) => {
Logger.debug(TAG, `kvStore.put ${key} finished, data= ${JSON.stringify(data)}`)
Logger.debug(TAG, `kvStore?.put ${key} finished, data= ${JSON.stringify(data)}`)
}).catch((err: object) => {
Logger.debug(TAG, `kvStore.put ${key} failed, ${JSON.stringify(err)}`)
Logger.debug(TAG, `kvStore?.put ${key} failed, ${JSON.stringify(err)}`)
})
}
}
@ -91,10 +91,10 @@ export class KvStoreModel {
setOnMessageReceivedListener(context: common.UIAbilityContext, msg: string, callback: Callback<string>) {
Logger.info(TAG, `setOnMessageReceivedListener: ${msg}`);
this.createKvStore(context, () => {
Logger.info(TAG, `kvStore.on(dataChange) begin`);
Logger.info(TAG, `kvStore?.on(dataChange) begin`);
if (this.kvStore !== undefined && this.kvStore !== null) {
try {
this.kvStore!.on('dataChange', distributedData.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (data) => {
this.kvStore?.on('dataChange', distributedData.SubscribeType.SUBSCRIBE_TYPE_REMOTE, (data) => {
Logger.debug(TAG, `dataChange, ${JSON.stringify(data)}`);
let entries = data.insertEntries.length > 0 ? data.insertEntries : data.updateEntries;
for (let i = 0; i < entries.length; i++) {
@ -107,10 +107,10 @@ export class KvStoreModel {
}
})
} catch (err) {
Logger.error(TAG, `kvStore.on(dataChange) err :` + err);
Logger.error(TAG, `kvStore?.on(dataChange) err :` + err);
}
}
Logger.info(TAG, `kvStore.on(dataChange) end`);
Logger.info(TAG, `kvStore?.on(dataChange) end`);
})
}
}